Update Docs
Sync documentation from source-of-truth files. Treat code, schemas, configs, and route definitions as authoritative; preserve manual documentation sections.
Source Discovery
Scan the repo for source-of-truth files:
| Source |
Generated Documentation |
package.json, Makefile, Cargo.toml, pyproject.toml, task files |
commands/scripts reference |
.env.example, .env.template, .env.sample |
environment variable reference |
openapi.yaml, openapi.json, route files, controllers |
API endpoint reference |
| public exports, CLI entry points, library modules |
public API reference |
Dockerfile, docker-compose.yml, deployment configs |
infrastructure and runbook notes |
If sources are missing, skip that section and explain why. Do not invent commands, env vars, routes, or deployment procedures.
Generated Section Contract
Only replace content inside generated markers. Support both Codex section markers and legacy ECC markers.
<!-- BEGIN GENERATED: section-name -->
...
<!-- END GENERATED: section-name -->
<!-- AUTO-GENERATED -->
...
<!-- /AUTO-GENERATED -->
If a file exists without markers, preserve all prose and ask before rewriting broad sections. If a needed doc file is missing, create it only when the user explicitly requested that new file or doc type. For a generic "update docs" request, update existing docs only and report missing docs as skipped.
Workflow
Build an inventory.
- Identify available source files and existing docs.
- Note stale docs: documentation files older than 90 days that overlap recently changed source areas.
- Decide target docs based on discovered sources and user scope.
Generate command reference.
- Extract scripts/tasks/commands from package and build files.
- Prefer descriptions from adjacent comments, script names, existing docs, or conventional meanings.
- Mark unknown descriptions as
Needs description rather than guessing.
Generate environment reference.
- Read env templates, never secret
.env files.
- Categorize variables as required vs optional when defaults or comments make that clear.
- Document expected format, valid values, and safe examples.
Generate API or public surface reference.
- Prefer OpenAPI files when present.
- Otherwise summarize route files/controllers or exported modules.
- Include method/path, handler, auth requirement when discoverable, and source file.
Update contributor docs.
- Prefer the repo's existing contributor guide:
CONTRIBUTING.md, docs/CONTRIBUTING.md, or equivalent.
- Update generated sections for prerequisites, install, scripts, tests, lint/format, and PR checklist.
Update runbook docs.
- Prefer the repo's existing runbook:
RUNBOOK.md, docs/RUNBOOK.md, docs/operations.md, or equivalent.
- Update generated sections for deploy steps, health checks, monitoring, rollback, and escalation only when source files reveal them.
Show a concise summary:
Documentation Update
Updated: docs/CONTRIBUTING.md (scripts table)
Updated: docs/ENV.md (3 new variables)
Flagged: docs/DEPLOY.md (142 days stale)
Skipped: docs/API.md (no route source found)
Safety Rules
- Never read or copy real secret values from
.env, local credential files, keychains, or deployment secrets.
- Preserve manual sections outside generated markers.
- Do not create broad new docs unless the user explicitly asks for new docs or names the missing doc type/path.
- Do not document behavior not supported by source files.
- Keep generated docs concise and easy to diff.
Verification
Before finishing:
- Confirm generated markers are balanced.
- Confirm no secrets or local-only values were copied.
- Run markdown formatting or link checks if the repo already provides them.
- Report updated, created, skipped, and flagged docs.
Source Parity
For conversion notes and ECC parity decisions, read references/source-parity.md only when auditing or modifying this skill.
1---2name: update-docs3description: Use this skill when the user invokes `/update-docs`, asks to sync documentation from source-of-truth files, refresh generated docs, update command/env/API/contributing/runbook docs from code, or check docs for staleness after code changes. Converted from ECC `commands/update-docs.md` for Codex. The skill derives docs from scripts, schemas, routes, exports, env templates, and deployment files while preserving manual prose.4---56# Update Docs78Sync documentation from source-of-truth files. Treat code, schemas, configs, and route definitions as authoritative; preserve manual documentation sections.910## Source Discovery1112Scan the repo for source-of-truth files:1314| Source | Generated Documentation |15| --- | --- |16| `package.json`, `Makefile`, `Cargo.toml`, `pyproject.toml`, task files | commands/scripts reference |17| `.env.example`, `.env.template`, `.env.sample` | environment variable reference |18| `openapi.yaml`, `openapi.json`, route files, controllers | API endpoint reference |19| public exports, CLI entry points, library modules | public API reference |20| `Dockerfile`, `docker-compose.yml`, deployment configs | infrastructure and runbook notes |2122If sources are missing, skip that section and explain why. Do not invent commands, env vars, routes, or deployment procedures.2324## Generated Section Contract2526Only replace content inside generated markers. Support both Codex section markers and legacy ECC markers.2728```markdown29<!-- BEGIN GENERATED: section-name -->30...31<!-- END GENERATED: section-name -->32```3334```markdown35<!-- AUTO-GENERATED -->36...37<!-- /AUTO-GENERATED -->38```3940If a file exists without markers, preserve all prose and ask before rewriting broad sections. If a needed doc file is missing, create it only when the user explicitly requested that new file or doc type. For a generic "update docs" request, update existing docs only and report missing docs as skipped.4142## Workflow43441. Build an inventory.45 - Identify available source files and existing docs.46 - Note stale docs: documentation files older than 90 days that overlap recently changed source areas.47 - Decide target docs based on discovered sources and user scope.482. Generate command reference.49 - Extract scripts/tasks/commands from package and build files.50 - Prefer descriptions from adjacent comments, script names, existing docs, or conventional meanings.51 - Mark unknown descriptions as `Needs description` rather than guessing.523. Generate environment reference.53 - Read env templates, never secret `.env` files.54 - Categorize variables as required vs optional when defaults or comments make that clear.55 - Document expected format, valid values, and safe examples.564. Generate API or public surface reference.57 - Prefer OpenAPI files when present.58 - Otherwise summarize route files/controllers or exported modules.59 - Include method/path, handler, auth requirement when discoverable, and source file.605. Update contributor docs.61 - Prefer the repo's existing contributor guide: `CONTRIBUTING.md`, `docs/CONTRIBUTING.md`, or equivalent.62 - Update generated sections for prerequisites, install, scripts, tests, lint/format, and PR checklist.636. Update runbook docs.64 - Prefer the repo's existing runbook: `RUNBOOK.md`, `docs/RUNBOOK.md`, `docs/operations.md`, or equivalent.65 - Update generated sections for deploy steps, health checks, monitoring, rollback, and escalation only when source files reveal them.667. Show a concise summary:6768 ```text69 Documentation Update70 Updated: docs/CONTRIBUTING.md (scripts table)71 Updated: docs/ENV.md (3 new variables)72 Flagged: docs/DEPLOY.md (142 days stale)73 Skipped: docs/API.md (no route source found)74 ```7576## Safety Rules7778- Never read or copy real secret values from `.env`, local credential files, keychains, or deployment secrets.79- Preserve manual sections outside generated markers.80- Do not create broad new docs unless the user explicitly asks for new docs or names the missing doc type/path.81- Do not document behavior not supported by source files.82- Keep generated docs concise and easy to diff.8384## Verification8586Before finishing:8788- Confirm generated markers are balanced.89- Confirm no secrets or local-only values were copied.90- Run markdown formatting or link checks if the repo already provides them.91- Report updated, created, skipped, and flagged docs.9293## Source Parity9495For conversion notes and ECC parity decisions, read `references/source-parity.md` only when auditing or modifying this skill.