|
| 1 | +--- |
| 2 | +description: |
| 3 | +globs: |
| 4 | +alwaysApply: true |
| 5 | +--- |
| 6 | +# Rule: Agent Use of Project Documentation |
| 7 | + |
| 8 | +## Purpose |
| 9 | +Ensure that agents actively reference existing project documentation during planning, implementation, and debugging. This reinforces architecture decisions, prevents duplication, and leverages prior domain knowledge. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## When to Read Docs |
| 14 | + |
| 15 | +Agents MUST consult relevant documentation: |
| 16 | + |
| 17 | +- Before implementing or planning a new feature |
| 18 | +- Before debugging a non-trivial issue |
| 19 | +- When using or modifying any shared component, service, or utility |
| 20 | +- When setting up a new app, package, or configuration |
| 21 | +- When unsure about naming, architecture, or design patterns |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## What to Read |
| 26 | + |
| 27 | +Agents should prioritize: |
| 28 | + |
| 29 | +- `docs/features/` — Feature implementation and rationale |
| 30 | +- `docs/architecture/adr/` — Architectural decisions |
| 31 | +- `docs/concepts/` — Core patterns and abstractions |
| 32 | +- `docs/packages/[name]/` — Workspace-specific details |
| 33 | +- `README.md`, `ONBOARDING.md`, `CONTRIBUTING.md` — Setup and standards |
| 34 | + |
| 35 | +Use index files (`*.index.md`) to navigate efficiently. |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +## Usage Expectations |
| 40 | + |
| 41 | +- ✅ Reference relevant documents in the plan or task file |
| 42 | +- ✅ Reuse prior design decisions and avoid re-debating settled architecture |
| 43 | +- ✅ Cross-link helpful docs in responses where appropriate |
| 44 | +- ✅ Load related `.md` files into memory when working on relevant code |
| 45 | +- ✅ If unclear, run the `consult-documentation-index` process to search |
| 46 | + |
| 47 | +--- |
| 48 | + |
| 49 | +## Related Rules |
| 50 | + |
| 51 | +- @project-documentation-structure.rules.mdc |
| 52 | +- @feature-task-plan-generator.rules.mdc |
| 53 | +- @agent-self-report.rules.mdc |
0 commit comments