/update-docs Command
Sync documentation with the codebase, generating from source-of-truth files.Sources of Truth
| Source | Generates |
|---|---|
package.json scripts | Available commands reference |
.env.example | Environment variable documentation |
openapi.yaml / route files | API endpoint reference |
| Source code exports | Public API documentation |
Dockerfile / docker-compose.yml | Infrastructure setup docs |
Process
- Identify Sources - Find source-of-truth files
- Generate Script Reference - Extract commands from package.json
- Generate Environment Docs - Extract variables from .env.example
- Update Contributing Guide - Development setup and procedures
- Update Runbook - Deployment and operations
- Staleness Check - Flag docs not modified in 90+ days
- Show Summary - Report what was updated
Command Syntax
Example Output
Generated Sections
Script Reference
Environment Variables
Rules
- Single source of truth: Always generate from code
- Preserve manual sections: Only update generated sections
- Mark generated content: Use
<!-- AUTO-GENERATED -->markers - Don’t create docs unprompted: Only create new files if explicitly requested
Related
- Commands:
/update-codemaps