diff --git a/AGENTS.md b/AGENTS.md index b1dbd53f3..7a81eab40 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -51,6 +51,19 @@ Before finalizing a large change to `codex-rs`, run `just fix -p ` (in Also run `just argument-comment-lint` to ensure the codebase is clean of comment lint errors. +## The `codex-core` crate + +Over time, the `codex-core` crate (defined in `codex-rs/core/`) has become bloated because it is the largest crate, so it is often easier to add something new to `codex-core` rather than refactor out the library code you need so your new code neither takes a dependency on, nor contributes to the size of, `codex-core`. + +To that end: **resist adding code to codex-core**! + +Particularly when introducing a new concept/feature/API, before adding to `codex-core`, consider whether: + +- There is an existing crate other than `codex-core` that is an appropriate place for your new code to live. +- It is time to introduce a new crate to the Cargo workspace for your new functionality. Refactor existing code as necessary to make this happen. + +Likewise, when reviewing code, do not hesitate to push back on PRs that would unnecessarily add code to `codex-core`. + ## TUI style conventions See `codex-rs/tui/styles.md`.