Skip to content
This repository was archived by the owner on Jan 11, 2026. It is now read-only.

Commit 30f57e8

Browse files
rmurpheyclaude
andcommitted
fix: update docs script to count all commands recursively
- Modified countCommands() to recursively scan subdirectories - Updated updateCommandCatalog() to properly categorize commands - Fixed command count from 14 to 22 (includes subdirectories) - Regenerated COMMAND_CATALOG.md with proper categorization 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 087df25 commit 30f57e8

File tree

3 files changed

+149
-125
lines changed

3 files changed

+149
-125
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**A living reference implementation of professional Claude Code commands and workflows**
44

55
[![Version](https://img.shields.io/badge/version-2.0.0-blue)](https://github.com/rmurphey/claude-setup)
6-
[![Commands](https://img.shields.io/badge/commands-37-green)](.claude/commands/)
6+
[![Commands](https://img.shields.io/badge/commands-22-green)](.claude/commands/)
77
[![License](https://img.shields.io/badge/license-MIT-purple)](LICENSE)
88
[![Token Efficiency](https://img.shields.io/badge/token%20savings-87%25-orange)](docs/TOKEN_EFFICIENCY.md)
99

@@ -469,17 +469,17 @@ MIT License - see [LICENSE](LICENSE) file for details.
469469
- [🔴 test: add failing tests for learn.js functions (TDD RED)](../../commit/8b90d58)
470470
- [🔴 test: add failing tests for formatBytes and estimateTokens (TDD RED)](../../commit/1fdac58)
471471
- [🔴 test: add failing tests for findBrokenLinks (TDD RED phase)](../../commit/8ec6319)
472-
- [feat: add specification keyword recognition to tone agent](../../commit/ee8b0a1)
473-
- [feat: add tone agent invocation to /docs command](../../commit/914540a)
474-
- [feat: add documentation-tone agent for friendly docs](../../commit/5ee6ca4)
475-
- [feat: add TDD templates and README section](../../commit/5bd9acb)
476-
- [feat: add automatic commit example updates to docs (TDD)](../../commit/aa00002)
477-
- [fix: remove broken links from README to fix CI](../../commit/dec5953)
478-
- [fix: add package-lock.json to fix GitHub Actions npm cache error](../../commit/63283a3)
479-
- [🟢 fix: use process.cwd() instead of __dirname for paths (TDD GREEN)](../../commit/e2e81e6)
480-
- [docs: capture learnings from test watch simplification](../../commit/4668363)
481-
- [docs: improve documentation tone and specification keyword consistency](../../commit/9a0d86b)
482-
- [docs: add persuasive TDD guides for skeptics](../../commit/5dfc663)
472+
- [feat: remove 3 more complex maintenance commands](../../commit/993dd82)
473+
- [feat: remove all detailed command variants for token efficiency](../../commit/0e46070)
474+
- [feat: remove all recovery commands per quality audit](../../commit/50be84f)
475+
- [feat: add repo-quality-auditor agent for comprehensive quality analysis](../../commit/e498add)
476+
- [feat: implement test coverage using Node's built-in test runner](../../commit/fca9905)
477+
- [fix: remove duplicate /planning/reflect command](../../commit/d00bd7c)
478+
- [fix: add missing frontmatter to 5 commands](../../commit/73f0e62)
479+
- [fix: update COMMAND_CATALOG with all 37 commands and improve auditor](../../commit/6c3351a)
480+
- [docs: update COMMAND_CATALOG to reflect consolidation complete](../../commit/15815ad)
481+
- [docs: update COMMAND_CATALOG after recovery removal](../../commit/838bdcd)
482+
- [docs: tone down TDD cheerleading to be more realistic](../../commit/4466c42)
483+
- [refactor: remove edit-not-create command](../../commit/087df25)
483484
- [refactor: switch test watching from Vite to Node.js --watch](../../commit/09c904e)
484485
- [refactor: simplify tests to smoke tests only](../../commit/f84cac6)
485-
- [refactor: optimize docs command for token efficiency](../../commit/3ad4b0d)

docs/COMMAND_CATALOG.md

Lines changed: 54 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -2,76 +2,46 @@
22

33
Complete list of all available Claude Code commands organized by category.
44

5-
Last updated: 2025-08-16
6-
Total Commands: 26
5+
Last updated: 2025-08-17
6+
Total Commands: 22
77

8-
## Core Workflow Commands (6)
8+
## Core Workflow Commands (13)
9+
10+
### /atomic-commit
11+
Enforce atomic commit discipline for 1-3 file changes
12+
Location: `.claude/commands/atomic-commit.md`
913

1014
### /commit
1115
Quality-checked commit workflow with automatic pre-commit validation
1216
Location: `.claude/commands/commit.md`
1317

14-
### /push
15-
Push commits to remote repository
16-
Location: `.claude/commands/push.md`
17-
18-
### /hygiene
19-
Project health check - code quality, tests, dependencies, and git status
20-
Location: `.claude/commands/hygiene.md`
21-
22-
### /todo
23-
Task management and tracking system with ACTIVE_WORK.md integration
24-
Location: `.claude/commands/todo.md`
25-
26-
### /monitor
27-
Monitor GitHub repository for test failures and pull requests
28-
Location: `.claude/commands/monitor.md`
29-
30-
### /tdd
31-
Your new best friend - TDD workflow that makes Claude amazing
32-
Location: `.claude/commands/tdd.md`
33-
34-
## Documentation Commands (3)
18+
### /context-manage
19+
Optimize Claude Code context window usage
20+
Location: `.claude/commands/context-manage.md`
3521

3622
### /docs
3723
Documentation maintenance and validation
3824
Location: `.claude/commands/docs.md`
3925

26+
### /hygiene
27+
Project health check - code quality, tests, dependencies, and git status
28+
Location: `.claude/commands/hygiene.md`
29+
4030
### /learn
4131
Capture insights and learnings from development work
4232
Location: `.claude/commands/learn.md`
4333

44-
### /update-docs
45-
Update README with current command count and descriptions
46-
Location: `.claude/commands/maintenance/update-docs.md`
47-
48-
## Planning Commands (6)
49-
50-
### /design
51-
Feature planning and design documentation system
52-
Location: `.claude/commands/planning/design.md`
53-
54-
### /estimate
55-
Get intelligent Claude usage estimates for development tasks
56-
Location: `.claude/commands/planning/estimate.md`
57-
58-
### /idea
59-
Quick capture of ideas for future consideration
60-
Location: `.claude/commands/planning/idea.md`
61-
62-
### /ideation
63-
AI-powered development ideation and brainstorming
64-
Location: `.claude/commands/planning/ideation.md`
65-
66-
### /defer
67-
Task deferral and backlog management system
68-
Location: `.claude/commands/planning/defer.md`
34+
### /monitor
35+
Monitor GitHub repository for test failures and pull requests
36+
Location: `.claude/commands/monitor.md`
6937

7038
### /next
7139
Get AI-recommended next steps and development priorities
7240
Location: `.claude/commands/next.md`
7341

74-
## Reflection Commands (2)
42+
### /push
43+
Push commits to remote repository
44+
Location: `.claude/commands/push.md`
7545

7646
### /reflect
7747
Pause and reflect on current work
@@ -81,64 +51,60 @@ Location: `.claude/commands/reflect.md`
8151
Capture current session with metadata for future analysis
8252
Location: `.claude/commands/retrospective.md`
8353

84-
## Maintenance Commands (7)
54+
### /tdd
55+
Your new best friend - TDD workflow that makes Claude amazing
56+
Location: `.claude/commands/tdd.md`
57+
58+
### /todo
59+
Task management and tracking system with ACTIVE_WORK.md integration
60+
Location: `.claude/commands/todo.md`
61+
62+
## Maintenance Commands (4)
8563

8664
### /archive
87-
Archive old files and directories
65+
Archive completed work and capture lessons learned
8866
Location: `.claude/commands/maintenance/archive.md`
8967

90-
### /issue
91-
Create and manage GitHub issues
92-
Location: `.claude/commands/maintenance/issue.md`
93-
9468
### /maintainability
9569
Code maintainability analysis and improvement recommendations
9670
Location: `.claude/commands/maintenance/maintainability.md`
9771

9872
### /session-history
99-
Manage and analyze session history
73+
Save and manage Claude Code conversation transcripts for analysis
10074
Location: `.claude/commands/maintenance/session-history.md`
10175

102-
### /sync-issues
103-
Sync open GitHub issues into ACTIVE_WORK.md for unified task tracking
104-
Location: `.claude/commands/maintenance/sync-issues.md`
76+
### /update-docs
77+
Update README with current command count and descriptions
78+
Location: `.claude/commands/maintenance/update-docs.md`
79+
80+
## Planning Commands (5)
10581

106-
### /version-tag
107-
Version tagging and release management workflow
108-
Location: `.claude/commands/maintenance/version-tag.md`
82+
### /defer
83+
Task deferral and backlog management system
84+
Location: `.claude/commands/planning/defer.md`
10985

110-
### /context-manage
111-
Optimize Claude Code context window usage
112-
Location: `.claude/commands/context-manage.md`
86+
### /design
87+
Feature planning and design documentation system
88+
Location: `.claude/commands/planning/design.md`
11389

114-
## Special Purpose Commands (2)
90+
### /estimate
91+
Get intelligent Claude usage estimates for development tasks
92+
Location: `.claude/commands/planning/estimate.md`
11593

116-
### /atomic-commit
117-
Enforce atomic commit discipline for 1-3 file changes
118-
Location: `.claude/commands/atomic-commit.md`
94+
### /idea
95+
Quick capture of ideas for future consideration
96+
Location: `.claude/commands/planning/idea.md`
11997

120-
### /edit-not-create
121-
Smart file decision process - prefer editing existing files over creating new ones
122-
Location: `.claude/commands/edit-not-create.md`
98+
### /ideation
99+
AI-powered development ideation and brainstorming based on code analysis
100+
Location: `.claude/commands/planning/ideation.md`
123101

124102
---
125103

126104
## Command Categories Summary
127105

128106
| Category | Count | Purpose |
129107
|----------|-------|---------|
130-
| Core Workflow | 6 | Daily development tasks |
131-
| Documentation | 3 | Docs and learning capture |
132-
| Planning | 6 | Planning and ideation |
133-
| Reflection | 2 | Session analysis |
134-
| Maintenance | 7 | Repository maintenance |
135-
| Special Purpose | 2 | Specific workflows |
136-
137-
## Notes
138-
139-
- **Completed Consolidation**: Reduced from 37 to 26 commands
140-
- Removed: 4 recovery commands (overly complex)
141-
- Removed: 6 detailed variants (saved 1919 lines!)
142-
- Removed: 1 duplicate reflect command
143-
- **Token Efficiency**: Commands now delegate to npm scripts
144-
- Some large commands remain (issue, version-tag, design) for future simplification
108+
| Core Workflow | 13 | Daily development tasks |
109+
| Maintenance | 4 | Repository maintenance |
110+
| Planning | 5 | Planning and ideation |

scripts/docs.js

Lines changed: 82 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,23 @@ const command = process.argv[2] || 'all';
1414
function countCommands() {
1515
try {
1616
const commandsDir = path.join(process.cwd(), '.claude', 'commands');
17-
const files = fs.readdirSync(commandsDir).filter(f => f.endsWith('.md'));
18-
return files.length;
17+
let count = 0;
18+
19+
function countInDir(dir) {
20+
const items = fs.readdirSync(dir);
21+
for (const item of items) {
22+
const fullPath = path.join(dir, item);
23+
const stat = fs.statSync(fullPath);
24+
if (stat.isDirectory()) {
25+
countInDir(fullPath);
26+
} else if (item.endsWith('.md') && item !== 'README.md') {
27+
count++;
28+
}
29+
}
30+
}
31+
32+
countInDir(commandsDir);
33+
return count;
1934
} catch {
2035
return 0;
2136
}
@@ -152,37 +167,80 @@ function updateCommandCatalog() {
152167

153168
const catalogPath = path.join(process.cwd(), 'docs', 'COMMAND_CATALOG.md');
154169
const commandsDir = path.join(process.cwd(), '.claude', 'commands');
155-
const files = fs.readdirSync(commandsDir).filter(f => f.endsWith('.md'));
170+
171+
// Recursively find all command files
172+
const commands = [];
173+
174+
function scanDir(dir, prefix = '') {
175+
const items = fs.readdirSync(dir);
176+
for (const item of items) {
177+
const fullPath = path.join(dir, item);
178+
const stat = fs.statSync(fullPath);
179+
if (stat.isDirectory()) {
180+
scanDir(fullPath, prefix ? `${prefix}/${item}` : item);
181+
} else if (item.endsWith('.md') && item !== 'README.md') {
182+
const content = fs.readFileSync(fullPath, 'utf8');
183+
const descMatch = content.match(/^description:\s*(.+)$/m);
184+
const name = item.replace('.md', '');
185+
const desc = descMatch ? descMatch[1] : 'No description';
186+
const location = prefix ? `${prefix}/${name}` : name;
187+
commands.push({
188+
name,
189+
desc,
190+
location,
191+
category: prefix || 'Core'
192+
});
193+
}
194+
}
195+
}
196+
197+
scanDir(commandsDir);
198+
199+
// Group by category
200+
const categories = {};
201+
commands.forEach(cmd => {
202+
if (!categories[cmd.category]) {
203+
categories[cmd.category] = [];
204+
}
205+
categories[cmd.category].push(cmd);
206+
});
207+
208+
// Sort categories and commands
209+
const categoryOrder = ['Core', 'maintenance', 'planning'];
210+
const sortedCategories = categoryOrder.filter(cat => categories[cat]);
211+
212+
// Format categories nicely
213+
const categoryNames = {
214+
'Core': 'Core Workflow Commands',
215+
'maintenance': 'Maintenance Commands',
216+
'planning': 'Planning Commands'
217+
};
156218

157219
let catalogContent = `# Command Catalog
158220
159-
Complete list of available Claude Code commands.
221+
Complete list of all available Claude Code commands organized by category.
160222
161-
Last updated: ${new Date().toISOString().split('T')[0]}
162-
163-
## Available Commands
223+
Last updated: ${new Date().toISOString().split('T')[0]}
224+
Total Commands: ${commands.length}
164225
165226
`;
166227

167-
// Group commands by category (could be enhanced)
168-
const commands = [];
169-
for (const file of files) {
170-
const content = fs.readFileSync(path.join(commandsDir, file), 'utf8');
171-
const descMatch = content.match(/^description:\s*(.+)$/m);
172-
const name = file.replace('.md', '');
173-
const desc = descMatch ? descMatch[1] : 'No description';
174-
commands.push({ name, desc });
228+
for (const cat of sortedCategories) {
229+
const cmds = categories[cat];
230+
catalogContent += `## ${categoryNames[cat] || cat} (${cmds.length})\n\n`;
231+
cmds.sort((a, b) => a.name.localeCompare(b.name));
232+
cmds.forEach(cmd => {
233+
catalogContent += `### /${cmd.name}\n${cmd.desc} \nLocation: \`.claude/commands/${cmd.location}.md\`\n\n`;
234+
});
175235
}
176236

177-
// Sort alphabetically
178-
commands.sort((a, b) => a.name.localeCompare(b.name));
179-
180-
// Add to catalog
181-
commands.forEach(cmd => {
182-
catalogContent += `### /${cmd.name}\n\n${cmd.desc}\n\nLocation: \`.claude/commands/${cmd.name}.md\`\n\n---\n\n`;
183-
});
184-
185-
catalogContent += `\n## Total Commands: ${commands.length}\n`;
237+
// Add summary table
238+
catalogContent += `---\n\n## Command Categories Summary\n\n`;
239+
catalogContent += `| Category | Count | Purpose |\n`;
240+
catalogContent += `|----------|-------|---------|\n`;
241+
catalogContent += `| Core Workflow | ${categories['Core']?.length || 0} | Daily development tasks |\n`;
242+
catalogContent += `| Maintenance | ${categories['maintenance']?.length || 0} | Repository maintenance |\n`;
243+
catalogContent += `| Planning | ${categories['planning']?.length || 0} | Planning and ideation |\n`;
186244

187245
// Write catalog file
188246
fs.writeFileSync(catalogPath, catalogContent);

0 commit comments

Comments
 (0)