Before reading any source code, ALWAYS check if llmdoc/ exists in the project root. If it exists, this is your primary source of truth.
THIS IS NON-NEGOTIABLE. Every task, every investigation, every code change MUST start with reading the documentation.
- Efficiency: Documentation is pre-digested knowledge, faster than parsing code
- Context: Provides architectural understanding that code alone cannot convey
- Accuracy: Maintained by developers, reflects intended design not just implementation
llmdoc/
├── index.md # START HERE - Navigation and overview
├── overview/ # "What is this project?"
│ └── project-overview.md
├── architecture/ # "How does it work?" (LLM Retrieval Map)
│ └── *.md
├── guides/ # "How do I do X?"
│ └── *.md
└── reference/ # "What are the specifics?"
└── *.md
- Always read
llmdoc/index.mdfirst - Contains navigation and document summaries - Read ALL documents in
llmdoc/overview/- Essential project context - Read relevant
architecture/docs - Before modifying related code - Consult
guides/- For step-by-step workflows - Check
reference/- For conventions, data models, API specs
1. Check: Does llmdoc/ exist?
- YES → Read index.md, then relevant docs
- NO → Proceed with caution, suggest initializing docs
2. Find relevant architecture docs for the area you're modifying
3. Check guides/ for existing workflows
4. Review reference/ for conventions to follow
Documentation updates are NOT automatic. After completing a task:
- Identify which concepts/features were affected
- Ask the user: "Would you like to update the project documentation?"
- If confirmed, update relevant docs in
llmdoc/:- Modify existing docs to reflect changes
- Add new docs if new concepts were introduced
- Keep updates minimal and precise
- Update
index.mdif document structure changed
- Minimality: Use fewest words necessary
- Accuracy: Based on actual code, not assumptions
- No Code Blocks: Reference code with
path/file.ext:lineformat - LLM-Friendly: Write for machine consumption, not human tutorials
When referencing code in documentation or reports:
# Good - Reference format
`src/auth/jwt.js` (generateToken, verifyToken): Handles JWT creation and validation
# Bad - Pasting code
```javascript
function generateToken(payload) {
// ... 50 lines of code
}
| Task | Action |
|---|---|
| Understand project | Read llmdoc/index.md → overview/ |
| Modify feature X | Read architecture/x-*.md first |
| Follow workflow | Check guides/ |
| Check conventions | Read reference/ |
| After code changes | Offer to update relevant docs |
If llmdoc/ doesn't exist:
- The project hasn't initialized documentation yet
- Work carefully, relying on README.md and code comments