Generated by: PROP-EXT-OM-03-CODING-STANDARDS
Update Codemaps
Analyze the codebase structure and generate token-lean architecture documentation.
Step 1: Scan Project Structure
- Identify the project type (monorepo, single app, library, microservice)
- Find all source directories (src/, lib/, app/, packages/)
- Map entry points (main.ts, index.ts, app.py, main.go, etc.)
Step 2: Generate Codemaps
Create or update codemaps in docs/CODEMAPS/ (or .reports/codemaps/):
| File |
Contents |
architecture.md |
High-level system diagram, service boundaries, data flow |
backend.md |
API routes, middleware chain, service → repository mapping |
frontend.md |
Page tree, component hierarchy, state management flow |
data.md |
Database tables, relationships, migration history |
dependencies.md |
External services, third-party integrations, shared libraries |
Codemap Format
Each codemap should be token-lean — optimized for AI context consumption:
# Backend Architecture
## Routes
POST /api/users → UserController.create → UserService.create → UserRepo.insert
GET /api/users/:id → UserController.get → UserService.findById → UserRepo.findById
## Key Files
src/services/user.ts (business logic, 120 lines)
src/repos/user.ts (database access, 80 lines)
## Dependencies
- PostgreSQL (primary data store)
- Redis (session cache, rate limiting)
- Stripe (payment processing)
Step 3: Diff Detection
- If previous codemaps exist, calculate the diff percentage
- If changes > 30%, show the diff and request user approval before overwriting
- If changes <= 30%, update in place
Step 4: Add Metadata
Add a freshness header to each codemap:
<!-- Generated: 2026-02-11 | Files scanned: 142 | Token estimate: ~800 -->
Step 5: Save Analysis Report
Write a summary to .reports/codemap-diff.txt:
- Files added/removed/modified since last scan
- New dependencies detected
- Architecture changes (new routes, new services, etc.)
- Staleness warnings for docs not updated in 90+ days
Tips
- Focus on high-level structure, not implementation details
- Prefer file paths and function signatures over full code blocks
- Keep each codemap under 1000 tokens for efficient context loading
- Use ASCII diagrams for data flow instead of verbose descriptions
- Run after major feature additions or refactoring sessions
1---2name: codemap-sync3metadata:4 source: https://skillmd.com/skills/auto-skiller/codemap-sync5 name: codemap-sync6 class: toolboxes7 type: skill8 version: '1.0'9 schema_version: '1.0'10 freshness:11 status: active12 sync_count: 013 last_synced_by: daemon14 last_synced: '2026-06-27T00:00:00'15credentials:16 maturity: "functional"17 description: "Analyze the codebase structure and generate token-lean architecture documentation."18 when_to_use: "Use when task involves codemap sync"19 triggers: ["codemap"]20 inputs: ["task description", "context"]21 outputs: ["result"]22---2324# Generated by: PROP-EXT-OM-03-CODING-STANDARDS25---26# Update Codemaps2728Analyze the codebase structure and generate token-lean architecture documentation.2930## Step 1: Scan Project Structure31321. Identify the project type (monorepo, single app, library, microservice)332. Find all source directories (src/, lib/, app/, packages/)343. Map entry points (main.ts, index.ts, app.py, main.go, etc.)3536## Step 2: Generate Codemaps3738Create or update codemaps in `docs/CODEMAPS/` (or `.reports/codemaps/`):3940| File | Contents |41|------|----------|42| `architecture.md` | High-level system diagram, service boundaries, data flow |43| `backend.md` | API routes, middleware chain, service → repository mapping |44| `frontend.md` | Page tree, component hierarchy, state management flow |45| `data.md` | Database tables, relationships, migration history |46| `dependencies.md` | External services, third-party integrations, shared libraries |4748### Codemap Format4950Each codemap should be token-lean — optimized for AI context consumption:5152```markdown53# Backend Architecture5455## Routes56POST /api/users → UserController.create → UserService.create → UserRepo.insert57GET /api/users/:id → UserController.get → UserService.findById → UserRepo.findById5859## Key Files60src/services/user.ts (business logic, 120 lines)61src/repos/user.ts (database access, 80 lines)6263## Dependencies64- PostgreSQL (primary data store)65- Redis (session cache, rate limiting)66- Stripe (payment processing)67```6869## Step 3: Diff Detection70711. If previous codemaps exist, calculate the diff percentage722. If changes > 30%, show the diff and request user approval before overwriting733. If changes <= 30%, update in place7475## Step 4: Add Metadata7677Add a freshness header to each codemap:7879```markdown80<!-- Generated: 2026-02-11 | Files scanned: 142 | Token estimate: ~800 -->81```8283## Step 5: Save Analysis Report8485Write a summary to `.reports/codemap-diff.txt`:86- Files added/removed/modified since last scan87- New dependencies detected88- Architecture changes (new routes, new services, etc.)89- Staleness warnings for docs not updated in 90+ days9091## Tips9293- Focus on **high-level structure**, not implementation details94- Prefer **file paths and function signatures** over full code blocks95- Keep each codemap under **1000 tokens** for efficient context loading96- Use ASCII diagrams for data flow instead of verbose descriptions97- Run after major feature additions or refactoring sessions