Create token-aware architecture documentation for AI agent context. Use when starting work on unfamiliar codebase or before planning features that touch multiple areas.
This skill inherits all available tools. When active, it can use any tool Claude has access to.
references/CODEMAPS_TEMPLATE.mdToken-efficient architecture documentation that gives AI agents the context they need to work effectively—navigation aids, not comprehensive docs.
CODEMAPS/
├── overview.md # Project-level summary (always start here)
├── api.md # API routes, middleware, request lifecycle
├── database.md # Schema, queries, migrations
├── auth.md # Authentication flow, tokens, security
├── frontend.md # Components, state, patterns
└── [module].md # One per major domain area
Determine what area needs documentation. Start with overview.md for new projects.
List the 5-10 most important files with one-line responsibilities.
Create ASCII diagram showing how data moves through the area.
Input → Validation → Processing → Output
↓
Error Handler → Logger
List 3-5 patterns the codebase uses with when/how to apply.
Table format: "If you want to X, do Y"
Non-obvious behaviors that trip people up.
| File | Responsibility |
|---|---|
src/api/routes.ts | Route definitions |
src/api/middleware/auth.ts | JWT verification |
Request → Rate Limiter → Auth → Validation → Handler → Response
| Task | How |
|---|---|
| Add endpoint | Define in routes.ts, create handler, add tests |
| Debug auth | Check JWT expiry, verify middleware order |
# Pre-commit reminder
if git diff --name-only | grep -q "src/api/"; then
echo "API changed - consider updating CODEMAPS/api.md"
fi
Too Detailed: Codemaps are not comprehensive documentation
# Bad
The UserService class was created in 2023 by the platform team...
[500 more lines]
Too Vague: Must provide actionable information
# Bad
## Files
- There are files in src/
- They do things
Out of Date: Stale information is worse than none
# Bad
Use the old AuthController (note: was replaced 6 months ago)
See references/CODEMAPS_TEMPLATE.md for complete templates: