@paulduvall/claude-dev-toolkit 0.0.1-alpha.1 → 0.0.1-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/README.md +75 -17
  2. package/bin/claude-commands +250 -64
  3. package/commands/active/xarchitecture.md +393 -0
  4. package/commands/active/xconfig.md +127 -0
  5. package/commands/active/xdebug.md +130 -0
  6. package/commands/active/xdocs.md +178 -0
  7. package/commands/active/xgit.md +149 -0
  8. package/commands/active/xpipeline.md +152 -0
  9. package/commands/active/xquality.md +96 -0
  10. package/commands/active/xrefactor.md +198 -0
  11. package/commands/active/xrelease.md +142 -0
  12. package/commands/active/xsecurity.md +92 -0
  13. package/commands/active/xspec.md +174 -0
  14. package/commands/active/xtdd.md +151 -0
  15. package/commands/active/xtest.md +89 -0
  16. package/commands/experiments/xact.md +742 -0
  17. package/commands/experiments/xanalytics.md +113 -0
  18. package/commands/experiments/xanalyze.md +70 -0
  19. package/commands/experiments/xapi.md +161 -0
  20. package/commands/experiments/xatomic.md +112 -0
  21. package/commands/experiments/xaws.md +85 -0
  22. package/commands/experiments/xcicd.md +337 -0
  23. package/commands/experiments/xcommit.md +122 -0
  24. package/commands/experiments/xcompliance.md +182 -0
  25. package/commands/experiments/xconstraints.md +89 -0
  26. package/commands/experiments/xcoverage.md +90 -0
  27. package/commands/experiments/xdb.md +102 -0
  28. package/commands/experiments/xdesign.md +121 -0
  29. package/commands/experiments/xevaluate.md +111 -0
  30. package/commands/experiments/xfootnote.md +12 -0
  31. package/commands/experiments/xgenerate.md +117 -0
  32. package/commands/experiments/xgovernance.md +149 -0
  33. package/commands/experiments/xgreen.md +66 -0
  34. package/commands/experiments/xiac.md +118 -0
  35. package/commands/experiments/xincident.md +137 -0
  36. package/commands/experiments/xinfra.md +115 -0
  37. package/commands/experiments/xknowledge.md +115 -0
  38. package/commands/experiments/xmaturity.md +120 -0
  39. package/commands/experiments/xmetrics.md +118 -0
  40. package/commands/experiments/xmonitoring.md +128 -0
  41. package/commands/experiments/xnew.md +898 -0
  42. package/commands/experiments/xobservable.md +114 -0
  43. package/commands/experiments/xoidc.md +165 -0
  44. package/commands/experiments/xoptimize.md +115 -0
  45. package/commands/experiments/xperformance.md +112 -0
  46. package/commands/experiments/xplanning.md +131 -0
  47. package/commands/experiments/xpolicy.md +115 -0
  48. package/commands/experiments/xproduct.md +98 -0
  49. package/commands/experiments/xreadiness.md +75 -0
  50. package/commands/experiments/xred.md +55 -0
  51. package/commands/experiments/xrisk.md +128 -0
  52. package/commands/experiments/xrules.md +124 -0
  53. package/commands/experiments/xsandbox.md +120 -0
  54. package/commands/experiments/xscan.md +102 -0
  55. package/commands/experiments/xsetup.md +123 -0
  56. package/commands/experiments/xtemplate.md +116 -0
  57. package/commands/experiments/xtrace.md +212 -0
  58. package/commands/experiments/xux.md +171 -0
  59. package/commands/experiments/xvalidate.md +104 -0
  60. package/commands/experiments/xworkflow.md +113 -0
  61. package/hooks/README.md +231 -0
  62. package/hooks/file-logger.sh +98 -0
  63. package/hooks/lib/argument-parser.sh +422 -0
  64. package/hooks/lib/config-constants.sh +230 -0
  65. package/hooks/lib/context-manager.sh +549 -0
  66. package/hooks/lib/error-handler.sh +412 -0
  67. package/hooks/lib/execution-engine.sh +627 -0
  68. package/hooks/lib/file-utils.sh +375 -0
  69. package/hooks/lib/subagent-discovery.sh +465 -0
  70. package/hooks/lib/subagent-validator.sh +597 -0
  71. package/hooks/on-error-debug.sh +221 -0
  72. package/hooks/pre-commit-quality.sh +204 -0
  73. package/hooks/pre-write-security.sh +107 -0
  74. package/hooks/prevent-credential-exposure.sh +265 -0
  75. package/hooks/subagent-trigger-simple.sh +193 -0
  76. package/hooks/subagent-trigger.sh +253 -0
  77. package/lib/backup-restore-command.js +140 -0
  78. package/lib/base/base-command.js +252 -0
  79. package/lib/base/command-result.js +184 -0
  80. package/lib/config/constants.js +255 -0
  81. package/lib/config.js +228 -3
  82. package/lib/configure-command.js +428 -0
  83. package/lib/dependency-validator.js +64 -5
  84. package/lib/hook-installer-core.js +2 -2
  85. package/lib/installation-instruction-generator-backup.js +579 -0
  86. package/lib/installation-instruction-generator.js +213 -495
  87. package/lib/installer.js +134 -56
  88. package/lib/oidc-command.js +354 -0
  89. package/lib/result.js +138 -0
  90. package/lib/services/backup-list-service.js +226 -0
  91. package/lib/services/backup-service.js +230 -0
  92. package/lib/services/command-installer-service.js +217 -0
  93. package/lib/services/logger-service.js +201 -0
  94. package/lib/services/package-manager-service.js +319 -0
  95. package/lib/services/platform-instruction-service.js +294 -0
  96. package/lib/services/recovery-instruction-service.js +348 -0
  97. package/lib/services/restore-service.js +221 -0
  98. package/lib/setup-command.js +309 -0
  99. package/lib/subagent-formatter.js +278 -0
  100. package/lib/subagents-core.js +237 -0
  101. package/lib/subagents.js +508 -0
  102. package/lib/types.d.ts +183 -0
  103. package/lib/utils/claude-path-config.js +184 -0
  104. package/lib/utils/file-system-utils.js +152 -0
  105. package/lib/utils.js +8 -4
  106. package/lib/verify-command.js +430 -0
  107. package/package.json +17 -4
  108. package/scripts/postinstall.js +28 -10
  109. package/subagents/api-guardian.md +29 -0
  110. package/subagents/audit-trail-verifier.md +24 -0
  111. package/subagents/change-scoper.md +23 -0
  112. package/subagents/ci-pipeline-curator.md +24 -0
  113. package/subagents/code-review-assistant.md +258 -0
  114. package/subagents/continuous-release-orchestrator.md +29 -0
  115. package/subagents/contract-tester.md +24 -0
  116. package/subagents/data-steward.md +29 -0
  117. package/subagents/debug-context.md +197 -0
  118. package/subagents/debug-specialist.md +138 -0
  119. package/subagents/dependency-steward.md +24 -0
  120. package/subagents/deployment-strategist.md +29 -0
  121. package/subagents/documentation-curator.md +29 -0
  122. package/subagents/environment-guardian.md +29 -0
  123. package/subagents/license-compliance-guardian.md +29 -0
  124. package/subagents/observability-engineer.md +25 -0
  125. package/subagents/performance-guardian.md +29 -0
  126. package/subagents/product-owner-proxy.md +28 -0
  127. package/subagents/requirements-reviewer.md +26 -0
  128. package/subagents/rollback-first-responder.md +24 -0
  129. package/subagents/sbom-provenance.md +25 -0
  130. package/subagents/security-auditor.md +29 -0
  131. package/subagents/style-enforcer.md +23 -0
  132. package/subagents/test-writer.md +24 -0
  133. package/subagents/trunk-guardian.md +29 -0
  134. package/subagents/workflow-coordinator.md +26 -0
  135. package/templates/README.md +100 -0
  136. package/templates/basic-settings.json +30 -0
  137. package/templates/comprehensive-settings.json +206 -0
  138. package/templates/hybrid-hook-config.yaml +133 -0
  139. package/templates/security-focused-settings.json +62 -0
  140. package/templates/subagent-hooks.yaml +188 -0
  141. package/tsconfig.json +37 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Claude Dev Toolkit
2
2
 
3
- [![npm version](https://badge.fury.io/js/claude-dev-toolkit.svg)](https://www.npmjs.com/package/claude-dev-toolkit)
3
+ [![npm version](https://badge.fury.io/js/%40paulduvall%2Fclaude-dev-toolkit.svg)](https://www.npmjs.com/package/@paulduvall/claude-dev-toolkit)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
5
  ![Test Status](https://img.shields.io/badge/tests-100%25%20passing-brightgreen)
6
6
  ![Active Commands](https://img.shields.io/badge/active%20commands-13-blue)
@@ -13,7 +13,7 @@
13
13
 
14
14
  ```bash
15
15
  # Install globally via NPM
16
- npm install -g claude-dev-toolkit
16
+ npm install -g @paulduvall/claude-dev-toolkit
17
17
 
18
18
  # Commands are immediately available in Claude Code
19
19
  claude
@@ -33,7 +33,7 @@ claude
33
33
 
34
34
  ### Option 1: Automatic Setup (Recommended)
35
35
  ```bash
36
- npm install -g claude-dev-toolkit
36
+ npm install -g @paulduvall/claude-dev-toolkit
37
37
  # Interactive setup wizard runs automatically
38
38
  ```
39
39
 
@@ -41,7 +41,7 @@ npm install -g claude-dev-toolkit
41
41
  ```bash
42
42
  # Install specific command sets
43
43
  claude-commands install --active # Install 13 production commands
44
- claude-commands install --experimental # Install 45 experimental commands
44
+ claude-commands install --experiments # Install 45 experimental commands
45
45
  claude-commands install --all # Install all 58 commands
46
46
  ```
47
47
 
@@ -49,6 +49,7 @@ claude-commands install --all # Install all 58 commands
49
49
  ```bash
50
50
  claude-commands list # See all available commands
51
51
  claude-commands status # Check installation status
52
+ claude-commands oidc --help # Configure GitHub Actions OIDC with AWS
52
53
  ```
53
54
 
54
55
  ## šŸ“‹ Available Commands
@@ -89,9 +90,24 @@ Advanced commands for specialized workflows:
89
90
  claude-commands list # List all available commands
90
91
  claude-commands status # Show installation status
91
92
  claude-commands install --active # Install production commands
92
- claude-commands install --experimental # Install experimental commands
93
+ claude-commands install --experiments # Install experimental commands
93
94
  claude-commands install --all # Install all commands
94
95
 
96
+ # Configuration Management
97
+ claude-commands config --list # List available templates
98
+ claude-commands config --template <name> # Apply configuration template
99
+ claude-commands config --help # Show config command help
100
+
101
+ # OIDC Configuration (NEW)
102
+ claude-commands oidc --help # Show OIDC configuration options
103
+ claude-commands oidc --dry-run # Preview OIDC setup actions
104
+ claude-commands oidc --region us-west-2 --stack-name my-oidc # Configure AWS OIDC
105
+
106
+ # Subagents Management
107
+ claude-commands subagents --list # List available subagents
108
+ claude-commands subagents --install # Install subagents to Claude Code
109
+ claude-commands subagents --help # Show subagents command help
110
+
95
111
  # In Claude Code
96
112
  /xhelp # Show command help
97
113
  /xtest # Run intelligent test suite
@@ -102,19 +118,37 @@ claude-commands install --all # Install all commands
102
118
 
103
119
  ## šŸ”§ Configuration
104
120
 
121
+ ### Configuration Management
122
+
123
+ Use the built-in config command to manage Claude Code settings:
124
+
125
+ ```bash
126
+ # List available configuration templates
127
+ claude-commands config --list
128
+
129
+ # Apply a specific template
130
+ claude-commands config --template basic-settings.json
131
+ claude-commands config --template security-focused-settings.json
132
+ claude-commands config --template comprehensive-settings.json
133
+
134
+ # Show help for config command
135
+ claude-commands config --help
136
+ ```
137
+
105
138
  ### Installation Locations
106
139
  - **Commands**: `~/.claude/commands/active/` and `~/.claude/commands/experiments/`
107
140
  - **Configuration**: `~/.claude/settings.json`
108
141
  - **Security Hooks**: `~/.claude/hooks/`
142
+ - **Templates**: Bundled with package installation
109
143
 
110
144
  ### Configuration Templates
111
145
  The package includes three pre-configured templates:
112
146
 
113
147
  1. **Basic** (`basic-settings.json`): Minimal setup for command functionality
114
- 2. **Security-Focused** (`security-focused-settings.json`): Enhanced security with hooks
148
+ 2. **Security-Focused** (`security-focused-settings.json`): Enhanced security with hooks
115
149
  3. **Comprehensive** (`comprehensive-settings.json`): Full feature set with governance
116
150
 
117
- Templates are automatically applied during interactive setup or can be manually copied to `~/.claude/settings.json`.
151
+ Templates are applied via the config command with automatic backup of existing settings.
118
152
 
119
153
  ## 🧪 Development & Testing
120
154
 
@@ -127,6 +161,8 @@ npm test
127
161
  npm run test:commands # Command validation
128
162
  npm run test:workflow # Core workflow tests
129
163
  npm run test:security # Security command tests
164
+ npm run test:config # Configuration command tests
165
+ npm run test:subagents # Subagents CLI command tests
130
166
  npm run test:req007 # Interactive setup wizard
131
167
  npm run test:req009 # Configuration templates
132
168
  npm run test:req018 # Security hook installation
@@ -144,8 +180,8 @@ npm run lint # Code linting
144
180
  - **Configuration Tests**: Template and setup validation
145
181
 
146
182
  ### Architecture
147
- - **Symlink Consolidation**: Single source of truth with root directory
148
- - **JavaScript-Based**: Migrated from Python for better Node.js integration
183
+ - **Self-Contained Package**: No dependencies on repository cloning
184
+ - **JavaScript-Based**: Native Node.js integration with comprehensive testing
149
185
  - **Modular Design**: Separate installer, config, and validation modules
150
186
  - **Cross-Platform**: Works on macOS, Linux, and Windows
151
187
 
@@ -173,7 +209,7 @@ claude-commands install --active # Reinstall commands
173
209
  chmod 755 ~/.claude/commands/*.md # Fix permissions
174
210
 
175
211
  # Missing experimental commands?
176
- claude-commands install --experimental # Install experimental set
212
+ claude-commands install --experiments # Install experimental set
177
213
 
178
214
  # Test failures?
179
215
  npm test # Run full test suite
@@ -182,13 +218,13 @@ npm run validate # Validate package
182
218
 
183
219
  ### Validation Commands
184
220
  ```bash
185
- # Repository validation (from main repo)
186
- ./validate-commands.sh # JavaScript-based validation
187
- ./verify-setup.sh # Complete setup verification
188
-
189
221
  # Package validation
190
222
  npm run validate # Package structure validation
191
223
  npm test # Comprehensive test suite
224
+
225
+ # CLI validation
226
+ claude-commands verify # Complete setup verification
227
+ claude-commands list # Check installed commands
192
228
  ```
193
229
 
194
230
  ## šŸ“š Documentation
@@ -204,6 +240,7 @@ Every command includes built-in help:
204
240
  /xtest help # Show all testing options
205
241
  /xquality help # Show quality check options
206
242
  /xsecurity help # Show security scanning options
243
+ /xconfig help # Show configuration options
207
244
  ```
208
245
 
209
246
  ## šŸ¤ Contributing
@@ -221,8 +258,8 @@ npm test
221
258
  ```
222
259
 
223
260
  ### Adding Commands
224
- 1. Create command files in root `slash-commands/active/` or `slash-commands/experiments/`
225
- 2. Commands automatically sync to NPM package via symlinks
261
+ 1. Create command files in repository `slash-commands/active/` or `slash-commands/experiments/`
262
+ 2. Commands are included in NPM package through build process
226
263
  3. Validate with `npm run test:commands`
227
264
  4. Follow existing patterns and security guidelines
228
265
 
@@ -233,7 +270,28 @@ npm test
233
270
 
234
271
  ## šŸ”„ Recent Updates
235
272
 
236
- ### Version 0.0.1-alpha.1
273
+ ### Version 0.0.1-alpha.9
274
+ - āœ… **NEW: OIDC Command**: GitHub Actions to AWS OIDC integration (`claude-commands oidc`)
275
+ - āœ… **TDD Implementation**: Phase 1 foundation with comprehensive test coverage (14/14 tests)
276
+ - āœ… **CLI Integration**: Full command-line interface with help, dry-run, and configuration options
277
+ - āœ… **Error Framework**: Enhanced error handling with context-aware recovery suggestions
278
+ - āœ… **Dependency Validation**: AWS CLI, Git, and GitHub CLI availability checking
279
+
280
+ ### Version 0.0.1-alpha.8
281
+ - āœ… **Documentation Consistency**: Fixed command counts (58) and subagent counts (26)
282
+ - āœ… **Test Infrastructure**: Enhanced test-results directory handling
283
+ - āœ… **Repository Cleanup**: Removed outdated documentation and test artifacts
284
+ - āœ… **Validation Logic**: Improved scenario-aware test validation
285
+ - āœ… **Version Alignment**: Synchronized all version references
286
+
287
+ ### Version 0.0.1-alpha.7
288
+ - āœ… **NPM Scoped Package**: Published as `@paulduvall/claude-dev-toolkit`
289
+ - āœ… **Configuration Command**: Built-in `config` command for template management
290
+ - āœ… **Workflow Reporting**: Comprehensive GitHub Actions reporting
291
+ - āœ… **Subagents Support**: Multi-agent coordination capabilities
292
+ - āœ… **Enhanced Documentation**: Updated installation and usage instructions
293
+
294
+ ### Version 0.0.1-alpha.2
237
295
  - āœ… **Symlink Consolidation**: Eliminated duplicate directories
238
296
  - āœ… **JavaScript Migration**: Complete test suite migration from Python
239
297
  - āœ… **Enhanced Templates**: Fixed configuration template issues
@@ -20,64 +20,53 @@ program
20
20
  .command('list')
21
21
  .description('List all available commands')
22
22
  .option('-a, --active', 'Show only active commands')
23
- .option('-e, --experimental', 'Show only experimental commands')
23
+ .option('-e, --experiments', 'Show only experimental commands')
24
24
  .action((options) => {
25
25
  const claudeDir = path.join(os.homedir(), '.claude', 'commands');
26
- const activeDir = path.join(claudeDir, 'active');
27
- const experimentalDir = path.join(claudeDir, 'experiments');
28
26
 
29
27
  console.log('šŸ“¦ Claude Custom Commands\n');
30
28
 
31
- if (!options.experimental) {
32
- console.log('šŸŽÆ Active Commands:');
33
- if (fs.existsSync(activeDir)) {
34
- const activeCommands = fs.readdirSync(activeDir)
35
- .filter(f => f.endsWith('.md'))
36
- .map(f => f.replace('.md', ''))
37
- .sort();
38
-
39
- if (activeCommands.length > 0) {
40
- activeCommands.forEach(cmd => console.log(` /${cmd}`));
41
- } else {
42
- console.log(' No active commands found');
43
- }
29
+ if (fs.existsSync(claudeDir)) {
30
+ const allCommands = fs.readdirSync(claudeDir)
31
+ .filter(f => f.endsWith('.md'))
32
+ .map(f => f.replace('.md', ''))
33
+ .sort();
34
+
35
+ if (allCommands.length > 0) {
36
+ console.log('šŸš€ Available Commands:');
37
+ allCommands.forEach(cmd => console.log(` /${cmd}`));
38
+ console.log(`\nšŸ“Š Total: ${allCommands.length} commands`);
44
39
  } else {
45
- console.log(' Commands directory not found');
40
+ console.log(' No commands found');
46
41
  }
47
- console.log('');
42
+ } else {
43
+ console.log(' Commands directory not found');
48
44
  }
49
45
 
50
- if (!options.active) {
51
- console.log('🧪 Experimental Commands:');
52
- if (fs.existsSync(experimentalDir)) {
53
- const expCommands = fs.readdirSync(experimentalDir)
54
- .filter(f => f.endsWith('.md'))
55
- .map(f => f.replace('.md', ''))
56
- .sort();
57
-
58
- if (expCommands.length > 0) {
59
- expCommands.forEach(cmd => console.log(` /${cmd}`));
60
- } else {
61
- console.log(' No experimental commands found');
62
- }
63
- } else {
64
- console.log(' Commands directory not found');
65
- }
66
- console.log('');
67
- }
68
-
69
- console.log('šŸ’” Usage: Try /xhelp in Claude Code to see all commands');
46
+ console.log('\nšŸ’” Usage: Try /xhelp in Claude Code to see all commands');
70
47
  });
71
48
 
72
49
  program
73
50
  .command('install')
74
- .description('Install command sets')
75
- .option('--active', 'Install active commands only')
76
- .option('--experimental', 'Install experimental commands')
77
- .option('--all', 'Install all commands')
78
- .action((options) => {
51
+ .description('Install command sets to ~/.claude/commands/')
52
+ .option('--active', 'Install production-ready commands (default)')
53
+ .option('--experiments', 'Install experimental commands only')
54
+ .option('--all', 'Install both active and experimental')
55
+ .option('--include <pattern>', 'Include specific commands matching pattern')
56
+ .option('--exclude <pattern>', 'Exclude commands matching pattern')
57
+ .option('--dry-run', 'Show what would be installed without making changes')
58
+ .option('--backup', 'Create backup before installation')
59
+ .action(async (options) => {
79
60
  const installer = require('../lib/installer');
80
- installer.install(options);
61
+ try {
62
+ const result = await installer.install(options);
63
+ if (!result.success && !result.dryRun) {
64
+ process.exit(1);
65
+ }
66
+ } catch (error) {
67
+ console.error(`Installation failed: ${error.message}`);
68
+ process.exit(1);
69
+ }
81
70
  });
82
71
 
83
72
  program
@@ -85,33 +74,22 @@ program
85
74
  .description('Show installation status')
86
75
  .action(() => {
87
76
  const claudeDir = path.join(os.homedir(), '.claude', 'commands');
88
- const activeDir = path.join(claudeDir, 'active');
89
- const experimentalDir = path.join(claudeDir, 'experiments');
90
77
 
91
78
  console.log('šŸ“Š Claude Dev Toolkit Status\n');
92
79
 
93
80
  // Check Claude directory
94
- console.log('šŸ“ Installation Paths:');
95
- console.log(` Claude directory: ${fs.existsSync(claudeDir) ? 'āœ…' : 'āŒ'} ${claudeDir}`);
96
- console.log(` Active commands: ${fs.existsSync(activeDir) ? 'āœ…' : 'āŒ'} ${activeDir}`);
97
- console.log(` Experimental: ${fs.existsSync(experimentalDir) ? 'āœ…' : 'āŒ'} ${experimentalDir}\n`);
81
+ console.log('šŸ“ Installation Path:');
82
+ console.log(` Commands directory: ${fs.existsSync(claudeDir) ? 'āœ…' : 'āŒ'} ${claudeDir}\n`);
98
83
 
99
84
  // Count commands
100
- let activeCount = 0;
101
- let expCount = 0;
102
-
103
- if (fs.existsSync(activeDir)) {
104
- activeCount = fs.readdirSync(activeDir).filter(f => f.endsWith('.md')).length;
105
- }
85
+ let totalCount = 0;
106
86
 
107
- if (fs.existsSync(experimentalDir)) {
108
- expCount = fs.readdirSync(experimentalDir).filter(f => f.endsWith('.md')).length;
87
+ if (fs.existsSync(claudeDir)) {
88
+ totalCount = fs.readdirSync(claudeDir).filter(f => f.endsWith('.md')).length;
109
89
  }
110
90
 
111
91
  console.log('šŸ“¦ Command Inventory:');
112
- console.log(` Active commands: ${activeCount}`);
113
- console.log(` Experimental commands: ${expCount}`);
114
- console.log(` Total commands: ${activeCount + expCount}\n`);
92
+ console.log(` Total commands: ${totalCount}\n`);
115
93
 
116
94
  // Package info
117
95
  console.log('šŸ“‹ Package Information:');
@@ -119,13 +97,221 @@ program
119
97
  console.log(` CLI Location: ${process.argv[1]}\n`);
120
98
 
121
99
  // Quick health check
122
- const isHealthy = fs.existsSync(claudeDir) && (activeCount > 0 || expCount > 0);
100
+ const isHealthy = fs.existsSync(claudeDir) && totalCount > 0;
123
101
  console.log(`šŸ” Overall Status: ${isHealthy ? 'āœ… Healthy' : 'āš ļø Issues detected'}`);
124
102
 
125
103
  if (!isHealthy) {
126
104
  console.log('\nšŸ’” Troubleshooting:');
127
- console.log(' • Try: npm install -g claude-dev-toolkit');
128
- console.log(' • Or reinstall to refresh commands');
105
+ console.log(' • Try: npm install -g @paulduvall/claude-dev-toolkit');
106
+ console.log(' • Or reinstall: claude-commands install --all');
107
+ }
108
+ });
109
+
110
+ program
111
+ .command('subagents')
112
+ .description('Manage AI subagents for Claude Code')
113
+ .option('-l, --list', 'List available subagents')
114
+ .option('-i, --install', 'Install subagents to Claude Code')
115
+ .action((options) => {
116
+ const subagents = require('../lib/subagents');
117
+ subagents.handleCommand(options);
118
+ });
119
+
120
+ program
121
+ .command('config')
122
+ .description('Manage Claude Code configuration templates')
123
+ .option('-l, --list', 'List available configuration templates')
124
+ .option('-t, --template <name>', 'Apply configuration template')
125
+ .action((options) => {
126
+ const config = require('../lib/config');
127
+ config.handleCommand(options);
128
+ });
129
+
130
+ program
131
+ .command('configure')
132
+ .description('Configure Claude Code settings (replaces configure-claude-code.sh)')
133
+ .option('--template <name>', 'Apply named template')
134
+ .option('--interactive', 'Launch interactive configuration wizard')
135
+ .option('--validate', 'Validate current configuration')
136
+ .option('--reset', 'Reset to default configuration')
137
+ .option('--backup', 'Create backup before changes (default: true)')
138
+ .option('--no-backup', 'Skip backup creation')
139
+ .action(async (options) => {
140
+ const ConfigureCommand = require('../lib/configure-command');
141
+ const configureCmd = new ConfigureCommand();
142
+ try {
143
+ const result = await configureCmd.execute(options);
144
+ if (!result.success) {
145
+ process.exit(1);
146
+ }
147
+ } catch (error) {
148
+ console.error(`Configuration failed: ${error.message}`);
149
+ process.exit(1);
150
+ }
151
+ });
152
+
153
+ program
154
+ .command('setup')
155
+ .description('Setup the Claude Dev Toolkit with custom commands and configuration')
156
+ .option('--type <template>', 'Configuration template to apply (basic, comprehensive, security-focused)')
157
+ .option('--commands <set>', 'Command set to install (active, experiments, all, none)')
158
+ .option('--skip-configure', 'Skip configuration step')
159
+ .option('--skip-hooks', 'Skip hooks installation')
160
+ .option('--force', 'Overwrite existing installation')
161
+ .option('--dry-run', 'Preview actions without executing')
162
+ .action(async (options) => {
163
+ const SetupCommand = require('../lib/setup-command');
164
+ const setupCmd = new SetupCommand();
165
+ try {
166
+ const result = await setupCmd.execute(options);
167
+ if (!result.success && !result.dryRun) {
168
+ process.exit(1);
169
+ }
170
+ } catch (error) {
171
+ console.error(`Setup failed: ${error.message}`);
172
+ process.exit(1);
173
+ }
174
+ });
175
+
176
+ program
177
+ .command('verify')
178
+ .description('Verify the Claude Dev Toolkit installation status and health')
179
+ .option('--verbose', 'Show detailed verification information')
180
+ .option('--fix', 'Attempt to fix detected issues automatically')
181
+ .action(async (options) => {
182
+ const VerifyCommand = require('../lib/verify-command');
183
+ const verifyCmd = new VerifyCommand();
184
+ try {
185
+ const result = await verifyCmd.execute(options);
186
+ // Set exit code based on health status
187
+ if (result.overall === 'critical') {
188
+ process.exit(2);
189
+ } else if (result.overall === 'warning') {
190
+ process.exit(1);
191
+ }
192
+ // Exit 0 for healthy
193
+ } catch (error) {
194
+ console.error(`Verification failed: ${error.message}`);
195
+ process.exit(2);
196
+ }
197
+ });
198
+
199
+ program
200
+ .command('backup [name]')
201
+ .description('Create named backup of Claude Code configuration')
202
+ .action(async (name) => {
203
+ const BackupRestoreCommand = require('../lib/backup-restore-command');
204
+ const backupCmd = new BackupRestoreCommand();
205
+ try {
206
+ const result = await backupCmd.backup(name);
207
+ if (!result.success) {
208
+ process.exit(1);
209
+ }
210
+ } catch (error) {
211
+ console.error(`Backup failed: ${error.message}`);
212
+ process.exit(1);
213
+ }
214
+ });
215
+
216
+ program
217
+ .command('restore <name>')
218
+ .description('Restore from a named backup')
219
+ .action(async (name) => {
220
+ const BackupRestoreCommand = require('../lib/backup-restore-command');
221
+ const restoreCmd = new BackupRestoreCommand();
222
+ try {
223
+ const result = await restoreCmd.restore(name);
224
+ if (!result.success) {
225
+ process.exit(1);
226
+ }
227
+ } catch (error) {
228
+ console.error(`Restore failed: ${error.message}`);
229
+ process.exit(1);
230
+ }
231
+ });
232
+
233
+ program
234
+ .command('oidc')
235
+ .description(`Configure GitHub Actions OIDC (OpenID Connect) integration with AWS
236
+
237
+ šŸŽÆ WHAT IT DOES:
238
+ • Creates GitHub OIDC identity provider in AWS
239
+ • Sets up IAM role with trust policy for GitHub Actions
240
+ • Configures repository variables for secure AWS access
241
+ • Enables passwordless authentication from GitHub to AWS
242
+
243
+ šŸ“‹ PREREQUISITES (REQUIRED):
244
+ • AWS CLI installed and configured (aws configure)
245
+ • GitHub CLI authenticated (gh auth login)
246
+ • Git repository with GitHub remote origin
247
+ • AWS account with IAM permissions
248
+
249
+ āš™ļø WHAT IT CREATES:
250
+ • AWS OIDC Identity Provider for GitHub
251
+ • IAM Role for GitHub Actions (with trust policy)
252
+ • IAM policies for AWS resource access
253
+ • GitHub repository variables (AWS_DEPLOYMENT_ROLE, AWS_REGION)
254
+
255
+ šŸš€ BASIC USAGE:
256
+ • claude-commands oidc # Auto-detect settings
257
+ • claude-commands oidc --dry-run # Preview without changes
258
+ • claude-commands oidc --region us-west-2 # Specify AWS region`)
259
+ .option('--region <region>', 'AWS region for OIDC setup', 'us-east-1')
260
+ .option('--role-name <name>', 'IAM role name for GitHub Actions', 'GitHubActionsRole')
261
+ .option('--repository-path <path>', 'Path to repository for OIDC setup (auto-detected)', process.cwd())
262
+ .option('--dry-run', 'Preview actions without making changes (SAFE to run)')
263
+ .option('--verbose', 'Show detailed output during execution')
264
+ .action(async (options) => {
265
+ const OidcCommand = require('../lib/oidc-command');
266
+ const oidcCmd = new OidcCommand();
267
+ try {
268
+ const result = await oidcCmd.execute(options);
269
+ if (!result.success && !result.dryRun) {
270
+ process.exit(1);
271
+ }
272
+ } catch (error) {
273
+ console.error(`OIDC setup failed: ${error.message}`);
274
+ process.exit(1);
275
+ }
276
+ });
277
+
278
+ program
279
+ .command('update')
280
+ .description('Check for package updates')
281
+ .action(async () => {
282
+ const { version } = require('../package.json');
283
+ console.log('šŸ” Checking for updates...\n');
284
+ console.log(`Current version: ${version}`);
285
+
286
+ try {
287
+ const { execSync } = require('child_process');
288
+ const output = execSync('npm view @paulduvall/claude-dev-toolkit version', {
289
+ encoding: 'utf8',
290
+ stdio: 'pipe'
291
+ }).trim();
292
+
293
+ console.log(`Latest version: ${output}`);
294
+
295
+ if (output !== version) {
296
+ console.log('\nšŸ†• Update available!');
297
+ console.log('\nTo update, run:');
298
+ console.log(' npm update -g @paulduvall/claude-dev-toolkit');
299
+
300
+ // Check for breaking changes in major version
301
+ const currentMajor = parseInt(version.split('.')[0]);
302
+ const latestMajor = parseInt(output.split('.')[0]);
303
+
304
+ if (latestMajor > currentMajor) {
305
+ console.log('\nāš ļø Major version update - may contain breaking changes');
306
+ console.log(' Review release notes before updating');
307
+ }
308
+ } else {
309
+ console.log('\nāœ… You are using the latest version');
310
+ }
311
+ } catch (error) {
312
+ console.error('āŒ Could not check for updates');
313
+ console.log(' Please check your internet connection');
314
+ process.exit(1);
129
315
  }
130
316
  });
131
317