update-docs
Update project documentation to match code changes — generate codemaps, refresh READMEs, detect doc/code drift using AST analysis. Use when updating documentation after code changes, generating codemaps, verifying doc accuracy, or detecting stale documentation. Do NOT use for writing API reference docs from scratch (use doc-coauthoring) or for creating new skill files (use making-editing-skills).
- License 许可
- MIT
- 所属仓库
- xiaden/SkyScow
- 最近更新
- 2026-09-30
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- update-docs
- description
- Update project documentation to match code changes — generate codemaps, refresh READMEs, detect doc/code drift using AST analysis. Use when updating documentation after code changes, generating codemaps, verifying doc accuracy, or detecting stale documentation. Do NOT use for writing API reference docs from scratch (use doc-coauthoring) or for creating new skill files (use making-editing-skills).
02 资源文件 4
- 参考文档references/cliche-data.md2.8 KB
- 参考文档references/codemap-template.md2.1 KB
- 参考文档references/drift-report-format.md1.2 KB
- 参考文档references/readme-template.md1.6 KB
03 SKILL.md 正文
Documentation Update
Purpose: Keep documentation synchronized with code changes through systematic analysis, codemap generation, and drift detection. Docs should always reflect the actual codebase state.
When to Use
Trigger conditions:
- Code changes have been merged and docs need updating
- Generating or refreshing codemaps for a codebase area
- User asks to verify documentation accuracy
- Detecting stale or drifted documentation
- Updating README after feature additions or removals
Do NOT use this skill when:
- Writing API reference documentation from scratch (use
doc-coauthoring) - Creating or editing skill files (use
making-editing-skills) - Writing architecture decision records (use ADR tools)
- Generating user-facing tutorials or guides (use
doc-coauthoring) - The codebase hasn't changed and docs are already current
How This Skill Is Structured
This skill uses progressive disclosure to keep context lean:
| Level | What loads | Content |
|---|---|---|
| Body (always loaded) | Core workflow, decision tables, validation checklist | The 5-step doc update process, drift detection checks, when-to-update rules |
| References (loaded on demand) | Templates, format examples, detailed patterns | Codemap template, README template, drift report format |
Core Workflow
1. Identify Changed Code
git diff --name-only HEAD~5..HEAD # recent changes
git log --oneline -20 # what changed and why
For each changed file, gather context using AFT tools:
| Tool | Use for |
|---|---|
aft_outline |
File structure, exported symbols, heading hierarchy |
aft_zoom |
Read specific function/class source with signatures |
aft_search |
Find all references to a changed symbol across the codebase |
aft_inspect |
Check for broken imports, dead code, or diagnostics |
2. Analyze Code with AST
Use AST-aware analysis to extract accurate documentation from code:
- Symbol extraction: Use
aft_outlineto get all exported symbols (functions, classes, types) with their signatures and line ranges - JSDoc/TSDoc parsing: Read doc comments directly from source via
aft_zoom— these are the single source of truth for public API docs - Dependency mapping: Use
aft_zoomwithcallgraph: trueto understand what a function calls and what calls it - Environment variables: Parse
.env.examplefor required configuration
Key principle: Generate documentation from the code, not about the code. Every claim in docs should be traceable to a symbol, signature, or comment in the source.
3. Detect Doc/Code Drift
Compare existing documentation against actual code state:
| Check | Method |
|---|---|
| File paths mentioned in docs | Verify each path exists with glob or read |
| Function signatures in docs | Compare against aft_zoom output |
| Exported symbols listed | Compare against aft_outline output |
| Code examples in docs | Verify they compile/type-check |
| Links to other docs | Verify target files exist |
| Environment variables | Compare against .env.example |
Drift report format: Use the template in [references/drift-report-format.md](file:///home/opencode/.config/opencode/skills/update-docs/references/drift-report-format.md). Every stale/missing item must reference a source-of-truth location in the codebase.
4. Update Documentation
Apply fixes based on drift report, prioritized:
- Remove stale references — delete or update paths, signatures, examples that no longer match
- Add missing docs — document newly exported symbols, new env vars, new features
- Refresh templates — update README setup commands, codemap timestamps
- Verify examples — ensure code snippets compile and run
5. Verify Accuracy
Before committing:
- [ ] All file paths in docs verified to exist
- [ ] Code examples compile/type-check
- [ ] All internal and external links tested
- [ ] Freshness timestamps updated
- [ ] No obsolete references remain
- [ ] Codemaps generated from actual code (not hand-written)
- [ ] Version numbers updated where applicable (package.json, config files)
Codemaps
Codemaps are structured documentation for a codebase area, generated from code. Use the template in [references/codemap-template.md](file:///home/opencode/.config/opencode/skills/update-docs/references/codemap-template.md).
Rules:
- Generate from
aft_outlineandaft_zoomoutput — never hand-write module descriptions - Keep under 500 lines per codemap
- Include freshness timestamp (last updated date)
- Store in
docs/CODEMAPS/with anINDEX.mdlinking all codemaps
README Updates
Use the template in [references/readme-template.md](file:///home/opencode/.config/opencode/skills/update-docs/references/readme-template.md).
Rules:
- Setup commands must actually work — test them
- Link to codemaps for architecture details, don't duplicate
- List features that exist in the code, not features planned
When to Update
Always update docs when:
- New major feature added
- API routes changed (added, removed, signature changed)
- Dependencies added or removed
- Architecture significantly changed
- Setup process modified
- Environment variables added or renamed
- Public API signatures changed (update JSDoc/TSDoc comments)
- TODO/FIXME comments addressed or need resolution
Skip when:
- Minor bug fixes with no API impact
- Cosmetic changes (formatting, comments)
- Internal refactoring without external behavior changes
References
- Codemap template: [
references/codemap-template.md](file:///home/opencode/.config/opencode/skills/update-docs/references/codemap-template.md) - README template: [
references/readme-template.md](file:///home/opencode/.config/opencode/skills/update-docs/references/readme-template.md) - Drift report format: [
references/drift-report-format.md](file:///home/opencode/.config/opencode/skills/update-docs/references/drift-report-format.md) - Cliche data conventions: [
references/cliche-data.md](file:///home/opencode/.config/opencode/skills/update-docs/references/cliche-data.md) — Placeholder data rules for documentation examples - Related skills:
doc-coauthoring(writing docs from scratch),making-editing-skills(skill conventions),capture-subsystem(documenting subsystem mental models)
04 同仓库更多 Skills
unquoted-colon
暂无简介
quoted-description
Use when a plain scalar contains a colon: like this one.
block-description
Use when a plain scalar contains a colon: like this one.
work-routing
Canonical authority for who owns the next unit of work — direct work versus delegation, task tiers, bounded localization, the Change DAG size threshold, R&D evaluation routing, progressive research escalation, researcher scope signals, and QA/support owner selection. Use before choosing execution, investigation, design, or QA ownership; do not use to construct dispatch prompts, handoff schemas, or Change DAG/DD tool operation.
skill-loading-system
Explain or troubleshoot OpenCode skill discovery, loading, permissions, availability, or prompt injection.
security-review
Review code or agent/tool configuration for security vulnerabilities using OWASP and AgentShield checks. Use for auth, data exposure, injection, secrets, XSS, deserialization, or security-sensitive agent, MCP, or plugin changes.