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