- Source:
src/src/main.rs— process entry; IO and runtime setup.src/agent.rs— ACP agent implementation (sessions, streaming, approvals).src/agent/commands.rs— slash command handling and helpers.
- Config/build:
Cargo.toml,rust-toolchain.toml - Docs:
README.md - Tests: inline unit tests; integration tests in
tests/.
cargo build— compile the project with dependencies.cargo check— fast type/lint pass.RUST_LOG=info cargo run --quiet— run the agent over stdio.cargo fmt --all— format with rustfmt.cargo clippy -- -D warnings— lint and deny warnings.cargo test— run unit and integration tests.
- Rust 2024 edition; 4-space indentation;
rustfmtenforced. - Naming:
snake_case(functions/vars),CamelCase(types/traits),SCREAMING_SNAKE_CASE(consts). - Imports: explicit paths; group std/crate/local; avoid unused imports.
- Errors: prefer
anyhow::Result<T>at boundaries; map external errors early. - Logging: use
tracing; gate verbosity withRUST_LOG.
- Unit tests inline via
#[cfg(test)] mod tests { ... }; keep deterministic (avoid timing races). - Integration tests in
tests/(e.g.,tests/agent_status_test.rs). - Name tests by behavior in
snake_case(e.g.,advertises_available_commands). - Run with
cargo test; ensurecargo clippypasses before pushing.
- Commits: small, focused; use Conventional Commits (
feat:,fix:,refactor:). - Pull Requests include: problem statement and approach; linked issues; test plan (commands run, expected output) with relevant
RUST_LOGsnippets; screenshots/logs for ACP interactions when helpful.
- Auth: use
codex loginorOPENAI_API_KEYfor API key mode. - Secrets: never commit keys or
auth.json; use env/OS keychain. - Network: first build fetches git dependencies; subsequent builds cached.
- Safety: default to on-request approvals; avoid destructive examples.
- Add new slash commands in
src/agent/commands.rs; document usage in help output. - Prefer clear, actionable logs and deterministic async flows (use
LocalSetwhere applicable`).