Ensures all code changes are grounded in the project's documentation, preventing drift and misinterpretation.
-
Locate and read the relevant docs (docs/architecture/.md, docs/api/.yaml, docs/schema/*.sql, READMEs, config files) before making changes.
-
Verify that proposed changes conform to documented design intents, service boundaries, and constraints.
-
If documentation conflicts with implementation, do not modify code to match undocumented behavior; report discrepancies and decide whether to update docs or adjust code.
-
Cite documentation during changes with explicit references, e.g., "According to architecture.md section X" and "API spec dictates...".
-
Common Documentation Locations:
-
Architecture: docs/architecture/microservices.md
-
Data Flow: docs/architecture/data-flow.md
-
API Specs: docs/api/
-
Database Schema: configs/mysql/init.sql
-
Service READMEs: services/*/README.md
-
Red Flags:
-
Don't guess or improvise; verify against docs.
-
Do reference and confirm consistency with intent.
-
Output guidelines and expectations for compliance.
Before editing any code, locate the relevant documentation and verify all changes against it.