一键导入
maintaining-documentation-after-code-changes
Two-phase workflow to keep project documentation synchronized with code changes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Two-phase workflow to keep project documentation synchronized with code changes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use boolean decision trees instead of imperatives for 100% compliance under pressure
Use when creating or developing, before writing code or implementation plans - refines rough ideas into fully-formed designs through collaborative questioning, alternative exploration, and incremental validation. Don't use during clear 'mechanical' processes
Use when completing tasks, implementing major features, or before merging to verify work meets requirements - dispatches cipherpowers:code-review-agent subagent to review implementation against plan or requirements before proceeding
Establish workflow boundary checklists with clear pass/fail criteria and escalation procedures
Use when you've developed a broadly useful skill and want to contribute it upstream via pull request - guides process of branching, committing, pushing, and creating PR to contribute skills back to upstream repository
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
| name | Maintaining Documentation After Code Changes |
| description | Two-phase workflow to keep project documentation synchronized with code changes |
| when_to_use | when completing features or bugfixes, before merging branches, when git diff shows significant changes, or when documentation feels stale or out of sync with code |
| version | 1.0.0 |
| languages | all |
Documentation drift is inevitable without systematic maintenance. Code evolves rapidly while documentation becomes stale. This skill provides a two-phase workflow to keep project docs synchronized with code: analyze recent changes, then update and restructure documentation accordingly.
Use this skill when:
When NOT to use:
Maintaining existing documentation after code changes is NOT "proactively creating docs" - it's keeping current docs accurate.
CLAUDE.md instructions about "don't proactively create documentation" apply to NEW documentation files for undocumented features. They do NOT apply to maintaining existing documentation after you change the code it documents.
If you changed the code, you must update the corresponding documentation. No exceptions.
| Rationalization | Reality |
|---|---|
| "I'll update docs in a follow-up PR" | Later rarely happens. Context is freshest now. Capture it. |
| "Commit messages are documentation enough" | Commit messages explain code changes, not user workflows. Both are needed. |
| "Code is self-documenting if well-written" | Code shows HOW. Docs explain WHY and usage patterns. Different purposes. |
| "Time pressure means ship now, document later" | Shipping undocumented changes creates support burden > time saved. |
| "Don't know if user wants docs updated" | If code changed, docs MUST update. Not optional. Ask about scope, not whether. |
| "Documentation is maintenance overhead" | Outdated docs are overhead. Current docs save time for everyone. |
| "Minimal accurate > comprehensive outdated" | False choice. This skill gives you accurate AND complete in 15-30 min. |
| "Different teams handle docs differently" | This skill IS the standard for this project. Follow it. |
| "Risk of making commit scope too large" | Documentation changes belong with code changes. Same PR = atomic change. |
| "Best practices docs only change for patterns" | If you discovered lessons during implementation, they belong in CLAUDE.md. |
None of these are valid reasons to skip documentation maintenance.
| Phase | Focus | Key Activities |
|---|---|---|
| Analyze | What changed? | git diff → review docs → identify gaps |
| Update | Sync docs | Update content → restructure → summarize changes |
Goal: Understand what changed and what documentation needs updating
Review recent changes:
git diff [base-branch]...HEAD
Examine the full diff to understand scope of changes
Check existing documentation:
cipherpowers:maintaining-instruction-files for size/qualitycipherpowers:maintaining-instruction-files for size/qualityIdentify documentation gaps:
Output of analysis phase: List of specific documentation updates needed
Goal: Bring documentation into sync with current code
Update content to reflect changes:
Restructure for clarity:
Document updates: Provide summary of changes:
Follow project documentation standards defined in:
Key standards to verify:
| Mistake | Fix |
|---|---|
| Updating only README, missing other docs | Check CLAUDE.md, README_*.md, docs/ systematically |
| Not reviewing git diff | Always start with full diff to understand scope |
| Describing "what" without "why" | Explain rationale, not just functionality |
| Forgetting to update examples | Changed APIs must update all examples |
| Batch updating at project end | Update at natural checkpoints (feature complete, before merge) |
| Restructuring separately from updates | Restructure while updating to prevent redundant passes |
| Missing troubleshooting updates | Document edge cases and solutions discovered during work |
These are consistently skipped under pressure. Check explicitly:
✅ MUST check every time:
Common blind spots:
Situations:
Rationalizations (means you're about to skip docs):
All of these mean: Stop and run this workflow before proceeding.
Without systematic maintenance:
With this workflow:
This skill can be invoked by:
Commands should provide context about documentation practices and reference this skill for methodology.