feat: add target repo examples and file layout guidance
This commit is contained in:
25
examples/rust-project/AGENTS.md
Normal file
25
examples/rust-project/AGENTS.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# AGENTS.md
|
||||
|
||||
## Project overview
|
||||
This repository is a Rust service or CLI with one or more crates.
|
||||
|
||||
## Important directories
|
||||
- `src/` — primary crate source
|
||||
- `crates/` — workspace member crates if present
|
||||
- `tests/` — integration tests
|
||||
- `benches/` — benchmarks if present
|
||||
|
||||
## Commands
|
||||
- test: `cargo test`
|
||||
- build: `cargo build`
|
||||
- lint: `cargo clippy --all-targets --all-features -- -D warnings`
|
||||
- format check: `cargo fmt --check`
|
||||
|
||||
## Working rules
|
||||
- Prefer minimal diffs
|
||||
- Do not casually update `Cargo.lock`
|
||||
- Avoid changing workspace structure unless explicitly requested
|
||||
- Add or update tests for behavior changes
|
||||
|
||||
## Additional harness files
|
||||
See `ai/project-map.md`, `ai/task-templates.md`, and `ai/risk-guardrails.md`.
|
||||
13
examples/rust-project/ai/harness-health.md
Normal file
13
examples/rust-project/ai/harness-health.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Harness Health
|
||||
|
||||
- project map clarity: partial
|
||||
- validation commands: strong
|
||||
- fast feedback: partial
|
||||
- task templates: partial
|
||||
- guardrails: strong
|
||||
- doc-code alignment: partial
|
||||
|
||||
## Top priorities
|
||||
1. Document workspace crate roles more clearly
|
||||
2. Call out feature-flag-specific validation paths
|
||||
3. Keep examples aligned with actual crate boundaries
|
||||
10
examples/rust-project/ai/project-map.md
Normal file
10
examples/rust-project/ai/project-map.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# Project Map
|
||||
|
||||
## Main structure
|
||||
- root crate or workspace declared in `Cargo.toml`
|
||||
- `src/main.rs` or `src/lib.rs` as primary entrypoints
|
||||
- `crates/` for workspace members where applicable
|
||||
|
||||
## Notes
|
||||
- Distinguish unit tests from integration tests
|
||||
- Check whether feature flags alter build or test behavior
|
||||
6
examples/rust-project/ai/risk-guardrails.md
Normal file
6
examples/rust-project/ai/risk-guardrails.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Risk Guardrails
|
||||
|
||||
- Do not casually modify `Cargo.lock`
|
||||
- Be careful with feature flags and workspace-wide effects
|
||||
- Avoid broad lifetime or trait refactors for narrow tasks
|
||||
- Treat unsafe code paths as high scrutiny areas
|
||||
14
examples/rust-project/ai/task-templates.md
Normal file
14
examples/rust-project/ai/task-templates.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Task Templates
|
||||
|
||||
## Bugfix
|
||||
1. Read the affected module and relevant tests
|
||||
2. Confirm whether the crate is part of a workspace
|
||||
3. Implement the narrowest safe fix
|
||||
4. Run targeted checks first, then broader cargo validation
|
||||
5. Report any feature-flag or cross-crate risks
|
||||
|
||||
## Feature
|
||||
1. Preserve existing public interfaces unless instructed otherwise
|
||||
2. Keep new dependencies to a minimum
|
||||
3. Add tests for normal and edge cases
|
||||
4. Run fmt, clippy, and tests before reporting completion
|
||||
Reference in New Issue
Block a user