This file tells AI coding agents how to work safely and effectively in this repository.
- Project type: Rust CLI tool (
git-wippy) - Entry point:
src/main.rs - Command modules:
src/commands/ - Shared utilities:
src/utils/ - Integration tests:
tests/cli.rs - Locales:
locales/*.ftl
- Never change behavior without tests or clear rationale.
- Prefer small, reviewable patches over large rewrites.
- Keep output and localization consistent across locales.
- Avoid broad
#[allow(...)]attributes; use narrow exceptions only. - Never use type-safety bypasses or suppression hacks.
A change is complete only if all are true:
- Code compiles locally.
cargo fmt --all -- --checkpasses.cargo clippy --workspace --all-targets --all-features -- -D warnings -W clippy::pedantic -W clippy::nurserypasses.cargo test --workspace --all-features --lockedpasses.- Documentation builds:
cargo doc --workspace --all-features --no-deps. - mdBook builds:
mdbook build book. - Any behavior change updates docs/tests/changelog as needed.
In scope for routine work:
- Rust source in
src/ - Tests in
tests/ - CI files in
.github/workflows/ - Docs/specs (
README.md,.specs/)
Out of scope unless explicitly requested:
- Release process redesign
- Cross-platform packaging overhaul
- Large architectural rewrites across all commands
- Read relevant command module(s) and tests first.
- Reuse existing patterns in
src/commands/*andsrc/utils/*. - Apply smallest possible patch.
- Run verification commands locally.
- Report exactly what changed and which checks ran.
- Use idiomatic Rust 2021 patterns already present in codebase.
- Propagate errors with
anyhow::Result; avoidunwrap/expectin production paths. - Keep functions focused and testable.
- Add comments only when logic is non-obvious.
- Keep user-visible strings localized through existing i18n flow.
- For command behavior changes, update or add integration coverage in
tests/cli.rs. - For utility-level logic, add focused unit tests close to the module when practical.
- Prefer deterministic tests; avoid time/network flakiness.
- Main CI workflow:
.github/workflows/main.yml. - Required CI jobs: fmt, clippy, test (stable + MSRV lane), build, docs, security audit.
- Documentation system: mdBook (
book.toml,book/src/). - Keep action versions current and avoid deprecated actions.
- Use atomic commits: one logical change per commit, with tests/docs paired to that change.
- Use Conventional Commits format:
type(scope): subject. - Allowed types:
feat,fix,refactor,perf,test,docs,ci,chore. - Keep subject imperative, concise, and lower-case (except proper nouns).
- Do not mix unrelated refactors with behavior changes in the same commit.
- If a change is too large, split into ordered commits that each pass checks.
- Do not commit secrets, tokens, or machine-specific data.
- Do not run destructive git history commands.
- Do not silently weaken lint/test gates to make CI pass.
- Follow existing repository patterns first.
- Choose the less risky, less invasive option.
- Document assumptions and trade-offs in the change summary.