/docs:sync [OPTIONS]
When to Use This Skill
| Use this skill when... |
Use docs-generate instead when... |
| Skill / command / agent counts in README or CLAUDE.md drift from what the directories actually contain |
Producing fresh API reference, README rewrites, or CHANGELOG content from code |
| New skills were added but not yet listed in the catalog tables |
The catalog itself is fine and you need to author new documentation |
| Removed items still appear as stale entries in documentation |
Drafting a service teardown checklist (use docs-decommission) |
| Cross-references and category groupings need reconciliation after a refactor |
Converting an existing Markdown document to a print-ready PDF (use docs-latex) |
Scan the codebase for skills, commands, and agents, then update all documentation to reflect the current state. Fixes count mismatches, adds missing entries, and removes stale references.
Usage
/docs:sync # Sync all documentation
/docs:sync --scope skills # Only sync skill documentation
/docs:sync --scope commands # Only sync command documentation
/docs:sync --scope agents # Only sync agent documentation
/docs:sync --dry-run # Show what would change without modifying
/docs:sync --verbose # Show detailed scanning output
Parameters
--scope <type> - Limit sync to specific type: skills, commands, agents, or all (default)
--dry-run - Preview changes without modifying files
--verbose - Show detailed progress during scanning
Execution
Execute this documentation sync workflow:
Step 1: Discover codebase items
Scan source directories:
# Skills
find .claude/skills -name "SKILL.md" -type f
# Commands
find .claude/commands -name "*.md" -type f ! -name "CLAUDE.md"
# Agents
find .claude/agents -name "*.md" -type f
Extract metadata from each item:
- Skills: Parse YAML frontmatter for
name and description
- Commands: Parse
description from frontmatter, infer namespace from path
- Agents: Parse frontmatter for
name, description, tools
Parse existing documentation:
.claude/skills/CLAUDE.md - Current skill catalog with categories
.claude/skills/CLAUDE.md - Command reference with namespaces
- Root
CLAUDE.md - Summary counts and highlights
Step 2: Analyze differences
Compare actual vs documented:
- Find items in directories but not in documentation (NEW)
- Find items in documentation but not in directories (STALE)
- Check if counts match
Categorize new items:
For skills, determine category by:
- Name patterns:
ux-*, git-*, python-* → matching category
- Description keywords: "accessibility", "testing", "infrastructure"
- Similar existing skills in same domain
- If uncertain, suggest "Uncategorized" for manual review
For user-invocable skills, determine namespace from directory name:
skills/git-commit/SKILL.md → git: namespace
skills/handoffs/SKILL.md → Root level
For agents, determine domain from description keywords
Identify documentation sections to update:
- Count patterns:
**N skills**, N total, (N skills)
- List sections by category/namespace
- Summary tables
Step 3: Apply updates
Update counts throughout documentation:
- Search for patterns like
**63 skills** or 63 specialized skills
- Replace with accurate count
- Update category counts like
### Core Development (9 skills)
Add new items to appropriate sections:
Skills catalog format:
### Category Name (N skills)
- **skill-name** - Description from SKILL.md frontmatter
Command table format:
| Namespace | Commands | Purpose |
| `/command` | Description | Usage context |
Agent inventory format:
| Agent | Purpose | Key Tools |
| **agent-name** | Description | Tool1, Tool2 |
Remove stale entries that no longer exist in codebase
Update cross-references:
- "See also" sections
- Related skills/commands lists
Step 4: Report results
Generate summary of changes:
## Documentation Sync Report
### Skills
- ✅ Added N new skills to catalog
- skill-name → Category Name
- ✅ Removed N stale skills
- ✅ Updated skill count: OLD → NEW
### Commands
- ✅ Added N new commands
- /namespace:command → Description
- ✅ Updated command counts
### Agents
- ✅ Added N new agents
- agent-name → Domain
- ✅ Updated agent inventory
### Files Modified
- path/to/file.md (N changes)
### Manual Review Needed
- item-name: Could not determine category
Documentation Files to Update
Primary targets (always check):
.claude/skills/CLAUDE.md - Skills catalog
.claude/skills/CLAUDE.md - Commands reference
CLAUDE.md (root) - Repository overview
Secondary targets (if they exist):
README.md - Project README
docs/ directory content
- Any file containing skill/command/agent counts
Categorization Rules
Skill Categories
| Pattern |
Category |
ux-*, accessibility-*, design-* |
UX & Accessibility |
git-*, github-* |
Version Control & GitHub |
python-*, uv-*, ruff-* |
Python Development |
typescript-*, nodejs-*, vitest-* |
TypeScript/JavaScript |
rust-*, cpp-*, embedded-* |
Systems Languages |
container-*, kubernetes-*, helm-*, terraform-* |
Infrastructure & DevOps |
test-*, playwright-*, mutation-* |
Testing & Quality |
agent-*, multi-agent-* |
Meta & Coordination |
Skill Namespaces
Determined by skill directory name prefix:
skills/git-*/SKILL.md → git: namespace
skills/docs-*/SKILL.md → docs: namespace
skills/*/SKILL.md (no prefix) → Root level skills
Error Handling
- Missing documentation file: Create from template with discovered content
- Malformed YAML frontmatter: Warn and skip item, report in summary
- Ambiguous categorization: Add to "Uncategorized" section, flag for review
- Duplicate entries: Warn and keep first occurrence
Best Practices
- Run after adding features - Keep docs in sync with implementation
- Review dry-run first - Verify categorization before applying
- Commit docs separately - Use
docs: conventional commit prefix
- Check cross-references - Ensure "See also" sections are updated
Example Session
# After adding new skills
/docs:sync --dry-run
# Review output, then apply
/docs:sync
# Commit the documentation updates
git add .claude/
git commit -m "docs: sync documentation with new UX implementation features"
See Also
- Commands:
/docs:generate for generating new documentation
- Skills:
release-please-protection for automated versioning
- Workflow: Run after
/project:new or major feature additions
1---
2description: Sync docs with actual skills, commands, and agents. Use when docs are out of sync, updating the skill catalog, or regenerating command reference to fix mismatches.
3args: "[--scope <type>] [--dry-run] [--verbose]"
4argument-hint: "--scope skills|commands|agents, --dry-run to preview, --verbose for details"
5allowed-tools: Bash, Grep, Glob, Read, Edit, Write, TodoWrite
6created: 2025-12-16
7modified: 2026-05-09
8reviewed: 2026-04-25
9name: docs-sync
10---
11
12# /docs:sync [OPTIONS]
13
14## When to Use This Skill
15
16| Use this skill when... | Use docs-generate instead when... |
17|---|---|
18| Skill / command / agent counts in README or CLAUDE.md drift from what the directories actually contain | Producing fresh API reference, README rewrites, or CHANGELOG content from code |
19| New skills were added but not yet listed in the catalog tables | The catalog itself is fine and you need to author new documentation |
20| Removed items still appear as stale entries in documentation | Drafting a service teardown checklist (use docs-decommission) |
21| Cross-references and category groupings need reconciliation after a refactor | Converting an existing Markdown document to a print-ready PDF (use docs-latex) |
22
23Scan the codebase for skills, commands, and agents, then update all documentation to reflect the current state. Fixes count mismatches, adds missing entries, and removes stale references.
24
25## Usage
26
27```bash
28/docs:sync # Sync all documentation
29/docs:sync --scope skills # Only sync skill documentation
30/docs:sync --scope commands # Only sync command documentation
31/docs:sync --scope agents # Only sync agent documentation
32/docs:sync --dry-run # Show what would change without modifying
33/docs:sync --verbose # Show detailed scanning output
34```
35
36## Parameters
37
38- `--scope <type>` - Limit sync to specific type: `skills`, `commands`, `agents`, or `all` (default)
39- `--dry-run` - Preview changes without modifying files
40- `--verbose` - Show detailed progress during scanning
41
42## Execution
43
44Execute this documentation sync workflow:
45
46### Step 1: Discover codebase items
47
481. **Scan source directories**:
49 ```bash
50 # Skills
51 find .claude/skills -name "SKILL.md" -type f
52
53 # Commands
54 find .claude/commands -name "*.md" -type f ! -name "CLAUDE.md"
55
56 # Agents
57 find .claude/agents -name "*.md" -type f
58 ```
59
602. **Extract metadata from each item**:
61 - **Skills**: Parse YAML frontmatter for `name` and `description`
62 - **Commands**: Parse `description` from frontmatter, infer namespace from path
63 - **Agents**: Parse frontmatter for `name`, `description`, `tools`
64
653. **Parse existing documentation**:
66 - `.claude/skills/CLAUDE.md` - Current skill catalog with categories
67 - `.claude/skills/CLAUDE.md` - Command reference with namespaces
68 - Root `CLAUDE.md` - Summary counts and highlights
69
70### Step 2: Analyze differences
71
721. **Compare actual vs documented**:
73 - Find items in directories but not in documentation (NEW)
74 - Find items in documentation but not in directories (STALE)
75 - Check if counts match
76
772. **Categorize new items**:
78
79 **For skills**, determine category by:
80 - Name patterns: `ux-*`, `git-*`, `python-*` → matching category
81 - Description keywords: "accessibility", "testing", "infrastructure"
82 - Similar existing skills in same domain
83 - If uncertain, suggest "Uncategorized" for manual review
84
85 **For user-invocable skills**, determine namespace from directory name:
86 - `skills/git-commit/SKILL.md` → `git:` namespace
87 - `skills/handoffs/SKILL.md` → Root level
88
89 **For agents**, determine domain from description keywords
90
913. **Identify documentation sections to update**:
92 - Count patterns: `**N skills**`, `N total`, `(N skills)`
93 - List sections by category/namespace
94 - Summary tables
95
96### Step 3: Apply updates
97
981. **Update counts** throughout documentation:
99 - Search for patterns like `**63 skills**` or `63 specialized skills`
100 - Replace with accurate count
101 - Update category counts like `### Core Development (9 skills)`
102
1032. **Add new items** to appropriate sections:
104
105 **Skills catalog format**:
106 ```markdown
107 ### Category Name (N skills)
108 - **skill-name** - Description from SKILL.md frontmatter
109 ```
110
111 **Command table format**:
112 ```markdown
113 | Namespace | Commands | Purpose |
114 | `/command` | Description | Usage context |
115 ```
116
117 **Agent inventory format**:
118 ```markdown
119 | Agent | Purpose | Key Tools |
120 | **agent-name** | Description | Tool1, Tool2 |
121 ```
122
1233. **Remove stale entries** that no longer exist in codebase
124
1254. **Update cross-references**:
126 - "See also" sections
127 - Related skills/commands lists
128
129### Step 4: Report results
130
131Generate summary of changes:
132
133```markdown
134## Documentation Sync Report
135
136### Skills
137- ✅ Added N new skills to catalog
138 - skill-name → Category Name
139- ✅ Removed N stale skills
140- ✅ Updated skill count: OLD → NEW
141
142### Commands
143- ✅ Added N new commands
144 - /namespace:command → Description
145- ✅ Updated command counts
146
147### Agents
148- ✅ Added N new agents
149 - agent-name → Domain
150- ✅ Updated agent inventory
151
152### Files Modified
153- path/to/file.md (N changes)
154
155### Manual Review Needed
156- item-name: Could not determine category
157```
158
159## Documentation Files to Update
160
161### Primary targets (always check):
162- `.claude/skills/CLAUDE.md` - Skills catalog
163- `.claude/skills/CLAUDE.md` - Commands reference
164- `CLAUDE.md` (root) - Repository overview
165
166### Secondary targets (if they exist):
167- `README.md` - Project README
168- `docs/` directory content
169- Any file containing skill/command/agent counts
170
171## Categorization Rules
172
173### Skill Categories
174
175| Pattern | Category |
176|---------|----------|
177| `ux-*`, `accessibility-*`, `design-*` | UX & Accessibility |
178| `git-*`, `github-*` | Version Control & GitHub |
179| `python-*`, `uv-*`, `ruff-*` | Python Development |
180| `typescript-*`, `nodejs-*`, `vitest-*` | TypeScript/JavaScript |
181| `rust-*`, `cpp-*`, `embedded-*` | Systems Languages |
182| `container-*`, `kubernetes-*`, `helm-*`, `terraform-*` | Infrastructure & DevOps |
183| `test-*`, `playwright-*`, `mutation-*` | Testing & Quality |
184| `agent-*`, `multi-agent-*` | Meta & Coordination |
185
186### Skill Namespaces
187
188Determined by skill directory name prefix:
189- `skills/git-*/SKILL.md` → `git:` namespace
190- `skills/docs-*/SKILL.md` → `docs:` namespace
191- `skills/*/SKILL.md` (no prefix) → Root level skills
192
193## Error Handling
194
195- **Missing documentation file**: Create from template with discovered content
196- **Malformed YAML frontmatter**: Warn and skip item, report in summary
197- **Ambiguous categorization**: Add to "Uncategorized" section, flag for review
198- **Duplicate entries**: Warn and keep first occurrence
199
200## Best Practices
201
2021. **Run after adding features** - Keep docs in sync with implementation
2032. **Review dry-run first** - Verify categorization before applying
2043. **Commit docs separately** - Use `docs:` conventional commit prefix
2054. **Check cross-references** - Ensure "See also" sections are updated
206
207## Example Session
208
209```bash
210# After adding new skills
211/docs:sync --dry-run
212
213# Review output, then apply
214/docs:sync
215
216# Commit the documentation updates
217git add .claude/
218git commit -m "docs: sync documentation with new UX implementation features"
219```
220
221## See Also
222
223- **Commands**: `/docs:generate` for generating new documentation
224- **Skills**: `release-please-protection` for automated versioning
225- **Workflow**: Run after `/project:new` or major feature additions