These guidelines apply to all AI-assisted code changes in this repository.
- Read the full contents of any file you plan to change, plus directly related modules.
- Summarize current behavior and invariants before proposing edits.
- Propose a minimal patch plan (files + rationale) before modifying code.
- Correctness first; then idiomatic, reviewable Rust.
- Prefer clarity over cleverness: small functions, early returns, shallow nesting.
- Keep diffs small and reviewable; avoid cosmetic churn.
- Do not include expository or 'my way' style comments
- Do not include any comments that focus on the change itself and lack suitable generality ('low overhead version' or 'fully optimal version', etc.)
- Comments should document the code not the change we are making
- Naming must be semantic, not pattern-based.
- Avoid suffixes like
State,Context,Managerunless there is a real contrast (e.g.,ConfigvsRuntime,SnapshotvsLive). - Do not use either prefixes or suffixes as namespaces.
- Rust is strongly typed, do not express type information through naming
- Abstract only when it removes duplication or encodes invariants.
- Prefer concrete domain types over generic wrappers.
- prefer the standard library
- use external packages only with approval
- never duplicate code
- Always add test coverage for added functionality
- Code must compile, pass tests, respect schema stability.
- Run
cargo fmt,cargo clippy, and relevant tests after edits. - Unit tests must not access external files and data, however integration tests may