Documentation Maintenance Skill
Comprehensive methodology for keeping project documentation current, consistent, and optimized for AI coding agents.
When to Use
- Synchronizing documentation with recent code changes
- Optimizing CLAUDE.md for AI agent effectiveness
- Updating README to reflect current project state
- Adding CHANGELOG entries for undocumented changes
- Auditing documentation freshness and accuracy
- Ensuring cross-document consistency
Documentation Update Phases
Phase 1: Documentation Inventory
- Find all documentation files in the project:
CLAUDE.md or .claude/CLAUDE.md - AI agent instructions (highest priority)
CLAUDE.local.md - Deprecated. Use ~/.claude/CLAUDE.md or @ imports instead
.claude/rules/*.md - Modular rules (may have paths frontmatter for scoping)
README.md - Project overview
CHANGELOG.md - Version history
/docs/ directory - Extended documentation
- Check for
@path imports in CLAUDE.md that reference additional files
- Record last modified dates for each doc
- Note any missing essential documentation
Phase 2: Git History Analysis
- Get commits since last documentation update:
git log --oneline --since="$(git log -1 --format=%ci -- CLAUDE.md)"
- Identify changes that need documentation:
- New files or directories added
- Configuration changes (package.json, tsconfig.json, etc.)
- New commands, scripts, or entry points
- API changes (new endpoints, modified signatures)
- Dependency updates
- Removed or deprecated features
- Flag commits with keywords: "add", "remove", "breaking", "fix", "feat"
- Check for removed features still documented
Phase 3: CLAUDE.md Optimization
Size Check (Critical)
Target under 200 lines per CLAUDE.md file. Longer files consume more context and reduce adherence. If over 200 lines:
- Split using
@path/to/file imports to reference additional files
- Move path-specific instructions to
.claude/rules/ directory
- Prune: if Claude already does something correctly without the instruction, delete it
File Ecosystem Check
Check for proper use of the CLAUDE.md ecosystem:
- Managed policy -
/Library/Application Support/ClaudeCode/CLAUDE.md (macOS), /etc/claude-code/CLAUDE.md (Linux), C:\Program Files\ClaudeCode\CLAUDE.md (Windows). Cannot be excluded.
~/.claude/CLAUDE.md - user-level personal preferences (all projects)
./CLAUDE.md or ./.claude/CLAUDE.md - project instructions (checked into git)
.claude/rules/*.md - modular, topic-specific rules (can use paths frontmatter for scoping)
@path imports - for referencing additional files without duplicating content
CLAUDE.local.md - deprecated; recommend ~/.claude/CLAUDE.md or @ imports instead
Recommended Sections
Not every project needs all of these. Include only what's relevant, and only content Claude couldn't figure out by reading the code:
Content Quality: Include vs Exclude
Include: Bash commands Claude can't guess, code style rules differing from defaults, testing instructions, repo etiquette, architectural decisions, dev environment quirks, common gotchas.
Exclude: Anything Claude can figure out by reading code, standard language conventions, detailed API docs (link instead), frequently changing info, long tutorials, file-by-file codebase descriptions, self-evident practices.
Writing Patterns
- Use imperative language ("Run
npm test" not "You can run tests")
- Provide exact file paths, not vague references
- Include concrete code examples
- List things NOT to do (anti-patterns)
- Add
IMPORTANT or YOU MUST for critical instructions (use sparingly)
- Keep instructions specific enough to verify
Anti-Patterns to Fix
- Over-specified CLAUDE.md — too long, important rules get lost in noise
- Too many post-task rules — convert must-execute actions to hooks instead
- Vague instructions — "format code nicely" gets ignored; be specific enough to verify
- Contradicting instructions across CLAUDE.md files and
.claude/rules/ (Claude picks arbitrarily)
- Instructions Claude follows without being told — prune these, they waste context
- Frequently-changing information — will become stale; link to authoritative sources
- Inlined documentation — use
@path imports or link to docs instead of pasting
- Using CLAUDE.md for hook-worthy rules — if it must happen 100% of the time, use a hook
- Assumed context or tribal knowledge
Phase 4: README Synchronization
- Verify project description matches current state
- Check installation instructions work
- Validate usage examples are current
- Ensure links and references are valid
- Update badges and status indicators
- Sync feature list with actual capabilities
Phase 5: CHANGELOG Updates
Follow Keep a Changelog format:
Categories:
- Added - New features
- Changed - Changes in existing functionality
- Deprecated - Features to be removed
- Removed - Features removed
- Fixed - Bug fixes
- Security - Vulnerability fixes
Best Practices:
- Write for users, not developers
- Link to relevant issues/PRs
- Use semantic versioning alignment
- Date entries in ISO format (YYYY-MM-DD)
- Most recent changes at top
Phase 6: Cross-Documentation Consistency
- Check for contradictions between documents
- Verify version numbers align across files
- Validate code examples still work
- Ensure terminology is consistent
- Check that paths and references are accurate
- Verify feature claims match implementation
Phase 7: Apply Updates
- Before editing:
- Show proposed changes to user for significant updates
- Use AskUserQuestion for ambiguous decisions
- When editing:
- Preserve existing structure and formatting
- Match the document's existing tone
- Add clear section headers for new content
- Include timestamps where appropriate
- After editing:
- Generate summary of all changes made
- List files modified with brief descriptions
- Note any items requiring manual follow-up
Documentation Freshness Indicators
Stale Documentation Signs:
- Code file newer than related docs
- Referenced files no longer exist
- Commands that fail when run
- Version mismatches
- Features documented but not implemented
- Implemented features not documented
Freshness Commands:
# Last doc update vs last code change
git log -1 --format=%ci -- CLAUDE.md
git log -1 --format=%ci -- "*.ts" "*.js" "*.py"
# Files changed since last CLAUDE.md update
git diff --name-only $(git log -1 --format=%H -- CLAUDE.md)..HEAD
Resources
See the reference documents for detailed guidance:
references/claude-md-guide.md - CLAUDE.md optimization patterns and section templates
references/changelog-patterns.md - Keep a Changelog format and git extraction techniques
references/doc-sync-methodology.md - Git commands, pattern detection, and automation
Quick Reference
Before Starting
During Update
After Update
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: docs-maintenance-23description: This skill should be used when the user asks to "update docs", "sync documentation", "update CLAUDE.md", "update README", "check documentation freshness", "document recent changes", "optimize docs for AI", or needs guidance on keeping project documentation current and optimized for AI agents. Use when this capability is needed.4---56# Documentation Maintenance Skill78Comprehensive methodology for keeping project documentation current, consistent, and optimized for AI coding agents.910## When to Use1112- Synchronizing documentation with recent code changes13- Optimizing CLAUDE.md for AI agent effectiveness14- Updating README to reflect current project state15- Adding CHANGELOG entries for undocumented changes16- Auditing documentation freshness and accuracy17- Ensuring cross-document consistency1819## Documentation Update Phases2021### Phase 1: Documentation Inventory22231. Find all documentation files in the project:24 - `CLAUDE.md` or `.claude/CLAUDE.md` - AI agent instructions (highest priority)25 - `CLAUDE.local.md` - **Deprecated.** Use `~/.claude/CLAUDE.md` or `@` imports instead26 - `.claude/rules/*.md` - Modular rules (may have `paths` frontmatter for scoping)27 - `README.md` - Project overview28 - `CHANGELOG.md` - Version history29 - `/docs/` directory - Extended documentation302. Check for `@path` imports in CLAUDE.md that reference additional files313. Record last modified dates for each doc324. Note any missing essential documentation3334### Phase 2: Git History Analysis35361. Get commits since last documentation update:37 ```bash38 git log --oneline --since="$(git log -1 --format=%ci -- CLAUDE.md)"39 ```402. Identify changes that need documentation:41 - New files or directories added42 - Configuration changes (package.json, tsconfig.json, etc.)43 - New commands, scripts, or entry points44 - API changes (new endpoints, modified signatures)45 - Dependency updates46 - Removed or deprecated features473. Flag commits with keywords: "add", "remove", "breaking", "fix", "feat"484. Check for removed features still documented4950### Phase 3: CLAUDE.md Optimization5152#### Size Check (Critical)5354**Target under 200 lines per CLAUDE.md file.** Longer files consume more context and reduce adherence. If over 200 lines:55- Split using `@path/to/file` imports to reference additional files56- Move path-specific instructions to `.claude/rules/` directory57- Prune: if Claude already does something correctly without the instruction, delete it5859#### File Ecosystem Check6061Check for proper use of the CLAUDE.md ecosystem:62- **Managed policy** - `/Library/Application Support/ClaudeCode/CLAUDE.md` (macOS), `/etc/claude-code/CLAUDE.md` (Linux), `C:\Program Files\ClaudeCode\CLAUDE.md` (Windows). Cannot be excluded.63- `~/.claude/CLAUDE.md` - user-level personal preferences (all projects)64- `./CLAUDE.md` or `./.claude/CLAUDE.md` - project instructions (checked into git)65- `.claude/rules/*.md` - modular, topic-specific rules (can use `paths` frontmatter for scoping)66- `@path` imports - for referencing additional files without duplicating content67- `CLAUDE.local.md` - **deprecated**; recommend `~/.claude/CLAUDE.md` or `@` imports instead6869#### Recommended Sections7071Not every project needs all of these. Include only what's relevant, and only content Claude couldn't figure out by reading the code:7273- [ ] Project Overview - What the project does, key technologies74- [ ] Commands - Exact build/test/run commands75- [ ] Project Structure - Key directories and files (non-obvious ones only)76- [ ] Architecture - How components connect, data flow77- [ ] Conventions - Style preferences that differ from defaults78- [ ] Common Pitfalls - Things Claude often gets wrong in this codebase79- [ ] Dependencies - Required environment, env variables8081#### Content Quality: Include vs Exclude8283**Include:** Bash commands Claude can't guess, code style rules differing from defaults, testing instructions, repo etiquette, architectural decisions, dev environment quirks, common gotchas.8485**Exclude:** Anything Claude can figure out by reading code, standard language conventions, detailed API docs (link instead), frequently changing info, long tutorials, file-by-file codebase descriptions, self-evident practices.8687#### Writing Patterns8889- Use imperative language ("Run `npm test`" not "You can run tests")90- Provide exact file paths, not vague references91- Include concrete code examples92- List things NOT to do (anti-patterns)93- Add `IMPORTANT` or `YOU MUST` for critical instructions (use sparingly)94- Keep instructions specific enough to verify9596#### Anti-Patterns to Fix9798- **Over-specified CLAUDE.md** — too long, important rules get lost in noise99- **Too many post-task rules** — convert must-execute actions to hooks instead100- **Vague instructions** — "format code nicely" gets ignored; be specific enough to verify101- **Contradicting instructions** across CLAUDE.md files and `.claude/rules/` (Claude picks arbitrarily)102- **Instructions Claude follows without being told** — prune these, they waste context103- **Frequently-changing information** — will become stale; link to authoritative sources104- **Inlined documentation** — use `@path` imports or link to docs instead of pasting105- **Using CLAUDE.md for hook-worthy rules** — if it must happen 100% of the time, use a hook106- Assumed context or tribal knowledge107108### Phase 4: README Synchronization1091101. Verify project description matches current state1112. Check installation instructions work1123. Validate usage examples are current1134. Ensure links and references are valid1145. Update badges and status indicators1156. Sync feature list with actual capabilities116117### Phase 5: CHANGELOG Updates118119Follow Keep a Changelog format:120121**Categories:**122- **Added** - New features123- **Changed** - Changes in existing functionality124- **Deprecated** - Features to be removed125- **Removed** - Features removed126- **Fixed** - Bug fixes127- **Security** - Vulnerability fixes128129**Best Practices:**130- Write for users, not developers131- Link to relevant issues/PRs132- Use semantic versioning alignment133- Date entries in ISO format (YYYY-MM-DD)134- Most recent changes at top135136### Phase 6: Cross-Documentation Consistency1371381. Check for contradictions between documents1392. Verify version numbers align across files1403. Validate code examples still work1414. Ensure terminology is consistent1425. Check that paths and references are accurate1436. Verify feature claims match implementation144145### Phase 7: Apply Updates1461471. **Before editing:**148 - Show proposed changes to user for significant updates149 - Use AskUserQuestion for ambiguous decisions1502. **When editing:**151 - Preserve existing structure and formatting152 - Match the document's existing tone153 - Add clear section headers for new content154 - Include timestamps where appropriate1553. **After editing:**156 - Generate summary of all changes made157 - List files modified with brief descriptions158 - Note any items requiring manual follow-up159160## Documentation Freshness Indicators161162**Stale Documentation Signs:**163- Code file newer than related docs164- Referenced files no longer exist165- Commands that fail when run166- Version mismatches167- Features documented but not implemented168- Implemented features not documented169170**Freshness Commands:**171```bash172# Last doc update vs last code change173git log -1 --format=%ci -- CLAUDE.md174git log -1 --format=%ci -- "*.ts" "*.js" "*.py"175176# Files changed since last CLAUDE.md update177git diff --name-only $(git log -1 --format=%H -- CLAUDE.md)..HEAD178```179180## Resources181182See the reference documents for detailed guidance:183184- `references/claude-md-guide.md` - CLAUDE.md optimization patterns and section templates185- `references/changelog-patterns.md` - Keep a Changelog format and git extraction techniques186- `references/doc-sync-methodology.md` - Git commands, pattern detection, and automation187188## Quick Reference189190### Before Starting191- [ ] Find all documentation files192- [ ] Check git history for recent changes193- [ ] Identify documentation gaps194- [ ] Create update tracking list195196### During Update197- [ ] Work through phases systematically198- [ ] Mark items as in-progress199- [ ] Ask user about ambiguous changes200- [ ] Preserve existing formatting and tone201- [ ] Mark items as completed202203### After Update204- [ ] Verify all changes are consistent205- [ ] Test any commands or examples206- [ ] Generate change summary207- [ ] Note items for manual follow-up208209---210> Converted and distributed by [TomeVault](https://tomevault.io/claim/jeffrigby) — claim your Tome and manage your conversions.211<!-- tomevault:4.0:skill_md:2026-04-11 -->