AgentSkillsCN

doc-maintenance

当代码变更可能影响文档时,或在新增功能需同步更新文档时,亦或是审核文档的新鲜度时,此功能尤为适用。

SKILL.md
--- frontmatter
name: doc-maintenance
description: Use when code changes may affect documentation, when adding new features that need docs, or when reviewing documentation freshness

Documentation Maintenance

Announce at start: "Following the doc-maintenance skill to keep docs in sync."

Core Rule

Every code change has a documentation blast radius. Map it before committing.

Process

1. Map — Identify Affected Docs

After any code change, check:

  • README mentions this feature?
  • API docs cover this endpoint/function?
  • Inline comments reference this behavior?
  • Configuration docs list this setting?
  • Architecture docs describe this component?
  • CHANGELOG needs an entry?

2. Update — Same PR, Same Commit

Change TypeDocs to Update
New API endpointAPI docs, README (if public), CHANGELOG
Changed behaviorInline comments, user-facing docs, CHANGELOG
New configurationREADME, environment docs, config reference
Removed featureAll references, migration guide, CHANGELOG
Renamed entityAll references (grep for old name)

3. Scaffold — New Features Need New Docs

If a feature doesn't have documentation yet:

  1. Create a minimal doc (title + one-paragraph overview + basic usage)
  2. Add to navigation (README, AGENTS.md, or equivalent index)
  3. Mark TODOs for sections to expand later

4. Verify — Docs Match Code

  • Code examples in docs actually work
  • Links to source files are correct
  • Version numbers are current
  • Screenshots/diagrams reflect current UI

Red Flags — STOP

SignalAction
PR has code changes but no doc updatesCheck the blast radius map
"I'll update docs later"Update now — later never comes
Docs describe behavior that no longer existsDelete or update immediately
New feature merged without any documentationCreate minimum viable doc before next task

Related Skills

WhenInvoke
Writing the code that needs docsplanning
Ready to submit docs with codepr-writing
Reviewing existing doc qualitycode-review

Deep Reference

For principles, rationale, anti-patterns, and examples:

  • guides/doc-maintenance/doc-maintenance.md
  • guides/documentation-guidelines/documentation-guidelines.md