claude-cli-advanced-starter-pack 1.0.0

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 (67) hide show
  1. package/LICENSE +21 -0
  2. package/OVERVIEW.md +597 -0
  3. package/README.md +439 -0
  4. package/bin/gtask.js +282 -0
  5. package/bin/postinstall.js +53 -0
  6. package/package.json +69 -0
  7. package/src/agents/phase-dev-templates.js +1011 -0
  8. package/src/agents/templates.js +668 -0
  9. package/src/analysis/checklist-parser.js +414 -0
  10. package/src/analysis/codebase.js +481 -0
  11. package/src/cli/menu.js +958 -0
  12. package/src/commands/claude-audit.js +1482 -0
  13. package/src/commands/claude-settings.js +2243 -0
  14. package/src/commands/create-agent.js +681 -0
  15. package/src/commands/create-command.js +337 -0
  16. package/src/commands/create-hook.js +262 -0
  17. package/src/commands/create-phase-dev/codebase-analyzer.js +813 -0
  18. package/src/commands/create-phase-dev/documentation-generator.js +352 -0
  19. package/src/commands/create-phase-dev/post-completion.js +404 -0
  20. package/src/commands/create-phase-dev/scale-calculator.js +344 -0
  21. package/src/commands/create-phase-dev/wizard.js +492 -0
  22. package/src/commands/create-phase-dev.js +481 -0
  23. package/src/commands/create-skill.js +313 -0
  24. package/src/commands/create.js +446 -0
  25. package/src/commands/decompose.js +392 -0
  26. package/src/commands/detect-tech-stack.js +768 -0
  27. package/src/commands/explore-mcp/claude-md-updater.js +252 -0
  28. package/src/commands/explore-mcp/mcp-installer.js +346 -0
  29. package/src/commands/explore-mcp/mcp-registry.js +438 -0
  30. package/src/commands/explore-mcp.js +638 -0
  31. package/src/commands/gtask-init.js +641 -0
  32. package/src/commands/help.js +128 -0
  33. package/src/commands/init.js +1890 -0
  34. package/src/commands/install.js +250 -0
  35. package/src/commands/list.js +116 -0
  36. package/src/commands/roadmap.js +750 -0
  37. package/src/commands/setup-wizard.js +482 -0
  38. package/src/commands/setup.js +351 -0
  39. package/src/commands/sync.js +534 -0
  40. package/src/commands/test-run.js +456 -0
  41. package/src/commands/test-setup.js +456 -0
  42. package/src/commands/validate.js +67 -0
  43. package/src/config/tech-stack.defaults.json +182 -0
  44. package/src/config/tech-stack.schema.json +502 -0
  45. package/src/github/client.js +359 -0
  46. package/src/index.js +84 -0
  47. package/src/templates/claude-command.js +244 -0
  48. package/src/templates/issue-body.js +284 -0
  49. package/src/testing/config.js +411 -0
  50. package/src/utils/template-engine.js +398 -0
  51. package/src/utils/validate-templates.js +223 -0
  52. package/src/utils.js +396 -0
  53. package/templates/commands/ccasp-setup.template.md +113 -0
  54. package/templates/commands/context-audit.template.md +97 -0
  55. package/templates/commands/create-task-list.template.md +382 -0
  56. package/templates/commands/deploy-full.template.md +261 -0
  57. package/templates/commands/github-task-start.template.md +99 -0
  58. package/templates/commands/github-update.template.md +69 -0
  59. package/templates/commands/happy-start.template.md +117 -0
  60. package/templates/commands/phase-track.template.md +142 -0
  61. package/templates/commands/tunnel-start.template.md +127 -0
  62. package/templates/commands/tunnel-stop.template.md +106 -0
  63. package/templates/hooks/context-guardian.template.js +173 -0
  64. package/templates/hooks/deployment-orchestrator.template.js +219 -0
  65. package/templates/hooks/github-progress-hook.template.js +197 -0
  66. package/templates/hooks/happy-checkpoint-manager.template.js +222 -0
  67. package/templates/hooks/phase-dev-enforcer.template.js +183 -0
@@ -0,0 +1,1890 @@
1
+ /**
2
+ * Init Command
3
+ *
4
+ * Deploy Claude CLI Advanced Starter Pack to a project's .claude/ folder
5
+ * Creates complete folder structure with commands, skills, agents, hooks
6
+ * Generates a sophisticated /menu command for project navigation
7
+ */
8
+
9
+ import chalk from 'chalk';
10
+ import inquirer from 'inquirer';
11
+ import ora from 'ora';
12
+ import { existsSync, mkdirSync, writeFileSync, readdirSync, readFileSync } from 'fs';
13
+ import { join, dirname, basename } from 'path';
14
+ import { fileURLToPath } from 'url';
15
+ import { showHeader, showSuccess, showError, showWarning, showInfo } from '../cli/menu.js';
16
+ import { getVersion } from '../utils.js';
17
+
18
+ const __filename = fileURLToPath(import.meta.url);
19
+ const __dirname = dirname(__filename);
20
+
21
+ /**
22
+ * Optional features with detailed descriptions
23
+ * These can be selected during init and require post-install configuration via /menu
24
+ */
25
+ const OPTIONAL_FEATURES = [
26
+ {
27
+ name: 'tokenManagement',
28
+ label: 'Token Budget Management',
29
+ description: 'Monitor and manage Claude API token usage with automatic compaction warnings, archive suggestions, and respawn thresholds. Includes hooks that track usage per session.',
30
+ commands: ['context-audit'],
31
+ hooks: ['token-budget-loader', 'context-guardian', 'tool-output-cacher'],
32
+ default: false,
33
+ requiresPostConfig: false,
34
+ },
35
+ {
36
+ name: 'happyMode',
37
+ label: 'Happy Engineering Integration',
38
+ description: 'Integration with Happy Coder mobile app for remote session control, checkpoint management, and mobile-optimized responses. Requires Happy Coder app installed separately.',
39
+ commands: ['happy-start'],
40
+ hooks: ['happy-checkpoint-manager', 'happy-title-generator', 'happy-mode-detector'],
41
+ default: false,
42
+ requiresPostConfig: true,
43
+ },
44
+ {
45
+ name: 'githubIntegration',
46
+ label: 'GitHub Project Board Integration',
47
+ description: 'Connect Claude to your GitHub Project Board for automated issue creation, progress tracking, and PR merge automation. Requires gh CLI authentication.',
48
+ commands: ['github-update', 'github-task-start'],
49
+ hooks: ['github-progress-hook', 'issue-completion-detector'],
50
+ default: true,
51
+ requiresPostConfig: true,
52
+ },
53
+ {
54
+ name: 'phasedDevelopment',
55
+ label: 'Phased Development System',
56
+ description: 'Generate production-ready development plans with 95%+ success criteria, automatic scaling (S/M/L), and progress tracking. Creates PROGRESS.json files for state persistence.',
57
+ commands: ['create-phase-dev', 'phase-track'],
58
+ hooks: ['phase-dev-enforcer'],
59
+ default: true,
60
+ requiresPostConfig: false,
61
+ },
62
+ {
63
+ name: 'deploymentAutomation',
64
+ label: 'Deployment Automation',
65
+ description: 'Automated full-stack deployment workflows. Supports Railway, Heroku, Vercel, Cloudflare Pages, and self-hosted targets. Platform configured after installation via /menu.',
66
+ commands: ['deploy-full'],
67
+ hooks: ['deployment-orchestrator'],
68
+ default: false,
69
+ requiresPostConfig: true,
70
+ },
71
+ {
72
+ name: 'tunnelServices',
73
+ label: 'Tunnel Service Integration',
74
+ description: 'Expose local development server for mobile testing or webhooks. Supports ngrok, localtunnel, cloudflare-tunnel, and serveo. No default service - configured after installation via /menu.',
75
+ commands: ['tunnel-start', 'tunnel-stop'],
76
+ hooks: [],
77
+ default: false,
78
+ requiresPostConfig: true,
79
+ },
80
+ ];
81
+
82
+ /**
83
+ * Available slash commands to deploy
84
+ */
85
+ const AVAILABLE_COMMANDS = [
86
+ {
87
+ name: 'menu',
88
+ description: 'Interactive ASCII menu for project commands and tools',
89
+ category: 'Navigation',
90
+ selected: true,
91
+ required: true,
92
+ },
93
+ {
94
+ name: 'e2e-test',
95
+ description: 'Run E2E tests with Playwright (ralph loop, headed, watch modes)',
96
+ category: 'Testing',
97
+ selected: true,
98
+ },
99
+ {
100
+ name: 'github-task',
101
+ description: 'Create GitHub issues with codebase analysis',
102
+ category: 'GitHub',
103
+ selected: true,
104
+ },
105
+ {
106
+ name: 'phase-dev-plan',
107
+ description: 'Create phased development plans (95%+ success rate)',
108
+ category: 'Planning',
109
+ selected: true,
110
+ },
111
+ {
112
+ name: 'create-agent',
113
+ description: 'Create L1/L2/L3 agents for Claude Code',
114
+ category: 'Claude Code',
115
+ selected: true,
116
+ },
117
+ {
118
+ name: 'create-hook',
119
+ description: 'Create enforcement hooks (PreToolUse, PostToolUse, UserPromptSubmit)',
120
+ category: 'Claude Code',
121
+ selected: true,
122
+ },
123
+ {
124
+ name: 'create-skill',
125
+ description: 'Create RAG-enhanced skill packages',
126
+ category: 'Claude Code',
127
+ selected: true,
128
+ },
129
+ {
130
+ name: 'explore-mcp',
131
+ description: 'Discover and install MCP servers based on tech stack',
132
+ category: 'MCP',
133
+ selected: true,
134
+ },
135
+ {
136
+ name: 'claude-audit',
137
+ description: 'Audit CLAUDE.md and .claude/ against best practices',
138
+ category: 'Claude Code',
139
+ selected: true,
140
+ },
141
+ {
142
+ name: 'roadmap-sync',
143
+ description: 'Sync roadmaps with GitHub Project Board',
144
+ category: 'GitHub',
145
+ selected: false,
146
+ },
147
+ {
148
+ name: 'claude-settings',
149
+ description: 'Configure Claude CLI permissions and modes',
150
+ category: 'Claude Code',
151
+ selected: false,
152
+ },
153
+ {
154
+ name: 'codebase-explorer',
155
+ description: 'Analyze codebase structure and find relevant files',
156
+ category: 'Analysis',
157
+ selected: true,
158
+ },
159
+ {
160
+ name: 'rag-pipeline',
161
+ description: 'Generate RAG pipeline with L1 orchestrator + L2 specialists',
162
+ category: 'Claude Code',
163
+ selected: false,
164
+ },
165
+ {
166
+ name: 'create-task-list',
167
+ description: 'Create intelligent task list with codebase exploration and GitHub integration',
168
+ category: 'Planning',
169
+ selected: true,
170
+ },
171
+ {
172
+ name: 'ccasp-setup',
173
+ description: 'CCASP Setup Wizard - vibe-code friendly project configuration',
174
+ category: 'Claude Code',
175
+ selected: true,
176
+ required: true,
177
+ },
178
+ // Feature-specific commands (deployed based on OPTIONAL_FEATURES selection)
179
+ {
180
+ name: 'context-audit',
181
+ description: 'Audit context usage and token budget (requires tokenManagement feature)',
182
+ category: 'Token Management',
183
+ selected: false,
184
+ feature: 'tokenManagement',
185
+ },
186
+ {
187
+ name: 'happy-start',
188
+ description: 'Start Happy Mode for mobile app integration (requires happyMode feature)',
189
+ category: 'Happy Mode',
190
+ selected: false,
191
+ feature: 'happyMode',
192
+ },
193
+ {
194
+ name: 'github-update',
195
+ description: 'View and sync GitHub Project Board status',
196
+ category: 'GitHub',
197
+ selected: false,
198
+ feature: 'githubIntegration',
199
+ },
200
+ {
201
+ name: 'github-task-start',
202
+ description: 'Start or complete a GitHub Project Board task',
203
+ category: 'GitHub',
204
+ selected: false,
205
+ feature: 'githubIntegration',
206
+ },
207
+ {
208
+ name: 'tunnel-start',
209
+ description: 'Start tunnel service for mobile testing (requires tunnelServices feature)',
210
+ category: 'Development',
211
+ selected: false,
212
+ feature: 'tunnelServices',
213
+ },
214
+ {
215
+ name: 'tunnel-stop',
216
+ description: 'Stop running tunnel service',
217
+ category: 'Development',
218
+ selected: false,
219
+ feature: 'tunnelServices',
220
+ },
221
+ {
222
+ name: 'phase-track',
223
+ description: 'Track progress of phased development plan',
224
+ category: 'Planning',
225
+ selected: false,
226
+ feature: 'phasedDevelopment',
227
+ },
228
+ {
229
+ name: 'deploy-full',
230
+ description: 'Full-stack deployment (requires deploymentAutomation feature)',
231
+ category: 'Deployment',
232
+ selected: false,
233
+ feature: 'deploymentAutomation',
234
+ },
235
+ ];
236
+
237
+ /**
238
+ * Generate the sophisticated /menu command
239
+ */
240
+ function generateMenuCommand(projectName, installedCommands, installedAgents, installedSkills, installedHooks) {
241
+ const date = new Date().toISOString().split('T')[0];
242
+
243
+ // Group commands by category
244
+ const commandsByCategory = {};
245
+ for (const cmdName of installedCommands) {
246
+ const cmd = AVAILABLE_COMMANDS.find((c) => c.name === cmdName);
247
+ if (cmd && cmd.name !== 'menu') {
248
+ if (!commandsByCategory[cmd.category]) {
249
+ commandsByCategory[cmd.category] = [];
250
+ }
251
+ commandsByCategory[cmd.category].push(cmd);
252
+ }
253
+ }
254
+
255
+ // Build category sections for the menu
256
+ let categoryMenuItems = '';
257
+ let categoryInstructions = '';
258
+ let keyIndex = 1;
259
+ const keyMap = {};
260
+
261
+ for (const [category, cmds] of Object.entries(commandsByCategory)) {
262
+ categoryMenuItems += `\n### ${category}\n`;
263
+ for (const cmd of cmds) {
264
+ const key = keyIndex <= 9 ? keyIndex.toString() : String.fromCharCode(65 + keyIndex - 10); // 1-9, then A-Z
265
+ keyMap[key] = cmd.name;
266
+ categoryMenuItems += `- **[${key}]** \`/${cmd.name}\` - ${cmd.description}\n`;
267
+ keyIndex++;
268
+ }
269
+ }
270
+
271
+ // Build agents section
272
+ let agentsSection = '';
273
+ if (installedAgents.length > 0) {
274
+ agentsSection = `\n### Agents\n`;
275
+ for (const agent of installedAgents) {
276
+ agentsSection += `- **${agent}** - Custom agent\n`;
277
+ }
278
+ }
279
+
280
+ // Build skills section
281
+ let skillsSection = '';
282
+ if (installedSkills.length > 0) {
283
+ skillsSection = `\n### Skills\n`;
284
+ for (const skill of installedSkills) {
285
+ skillsSection += `- **${skill}** - Custom skill\n`;
286
+ }
287
+ }
288
+
289
+ // Build hooks section
290
+ let hooksSection = '';
291
+ if (installedHooks.length > 0) {
292
+ hooksSection = `\n### Active Hooks\n`;
293
+ for (const hook of installedHooks) {
294
+ hooksSection += `- **${hook}**\n`;
295
+ }
296
+ }
297
+
298
+ return `---
299
+ description: Interactive project menu - Quick access to all commands, agents, skills, and tools
300
+ ---
301
+
302
+ # ${projectName} - Project Menu
303
+
304
+ \`\`\`
305
+ ╔═══════════════════════════════════════════════════════════════════════════════╗
306
+ ║ ║
307
+ ║ ╔═╗╦ ╔═╗╦ ╦╔╦╗╔═╗ ╔═╗╔╦╗╦ ╦╔═╗╔╗╔╔═╗╔═╗╔╦╗ ╔═╗╔╦╗╔═╗╦═╗╔╦╗╔═╗╦═╗ ║
308
+ ║ ║ ║ ╠═╣║ ║ ║║║╣ ╠═╣ ║║╚╗╔╝╠═╣║║║║ ║╣ ║║ ╚═╗ ║ ╠═╣╠╦╝ ║ ║╣ ╠╦╝ ║
309
+ ║ ╚═╝╩═╝╩ ╩╚═╝═╩╝╚═╝ ╩ ╩═╩╝ ╚╝ ╩ ╩╝╚╝╚═╝╚═╝═╩╝ ╚═╝ ╩ ╩ ╩╩╚═ ╩ ╚═╝╩╚═ ║
310
+ ║ ║
311
+ ║ ${projectName.padEnd(40)} ║
312
+ ║ ║
313
+ ╠═══════════════════════════════════════════════════════════════════════════════╣
314
+ ║ ║
315
+ ║ Quick Actions: ║
316
+ ║ ───────────── ║
317
+ ║ [T] Run Tests [G] GitHub Task [P] Phase Dev Plan ║
318
+ ║ [A] Create Agent [H] Create Hook [S] Create Skill ║
319
+ ║ [M] Explore MCP [C] Claude Audit [E] Explore Codebase ║
320
+ ║ ║
321
+ ║ Project Resources: ║
322
+ ║ ────────────────── ║
323
+ ║ [1] View Agents [2] View Skills [3] View Hooks ║
324
+ ║ [4] View Commands [5] Settings [6] Documentation ║
325
+ ║ ║
326
+ ║ Navigation: ║
327
+ ║ ─────────── ║
328
+ ║ [R] Refresh Menu [?] Help [Q] Exit Menu ║
329
+ ║ ║
330
+ ╚═══════════════════════════════════════════════════════════════════════════════╝
331
+ \`\`\`
332
+
333
+ ## How to Use This Menu
334
+
335
+ When the user invokes \`/menu\`, display the ASCII menu above and wait for their selection.
336
+
337
+ ### Key Bindings
338
+
339
+ | Key | Action | Command |
340
+ |-----|--------|---------|
341
+ | **T** | Run E2E Tests | \`/e2e-test\` |
342
+ | **G** | Create GitHub Task | \`/github-task\` |
343
+ | **P** | Create Phase Dev Plan | \`/phase-dev-plan\` |
344
+ | **A** | Create Agent | \`/create-agent\` |
345
+ | **H** | Create Hook | \`/create-hook\` |
346
+ | **S** | Create Skill | \`/create-skill\` |
347
+ | **M** | Explore MCP Servers | \`/explore-mcp\` |
348
+ | **C** | Claude Audit | \`/claude-audit\` |
349
+ | **E** | Explore Codebase | \`/codebase-explorer\` |
350
+ | **1** | List project agents | Read \`.claude/agents/\` |
351
+ | **2** | List project skills | Read \`.claude/skills/\` |
352
+ | **3** | List active hooks | Read \`.claude/hooks/\` |
353
+ | **4** | List all commands | Read \`.claude/commands/INDEX.md\` |
354
+ | **5** | View/edit settings | Read \`.claude/settings.json\` |
355
+ | **6** | Open documentation | Read \`.claude/docs/\` |
356
+ | **R** | Refresh and redisplay menu | Re-invoke \`/menu\` |
357
+ | **?** | Show help | Display command descriptions |
358
+ | **Q** | Exit menu | End menu interaction |
359
+
360
+ ## Installed Commands
361
+ ${categoryMenuItems}
362
+ ${agentsSection}
363
+ ${skillsSection}
364
+ ${hooksSection}
365
+
366
+ ## Instructions for Claude
367
+
368
+ When this command is invoked:
369
+
370
+ 1. **Display the ASCII menu** exactly as shown above
371
+ 2. **Ask the user** what they would like to do (show the key bindings)
372
+ 3. **Wait for user input** - a single character or command name
373
+ 4. **Execute the corresponding action**:
374
+ - For slash commands: Invoke the command directly
375
+ - For resource views: Read and display the contents
376
+ - For R: Redisplay the menu
377
+ - For Q: End the menu session
378
+
379
+ ### Example Interaction
380
+
381
+ \`\`\`
382
+ User: /menu
383
+ Claude: [Displays ASCII menu]
384
+ Claude: What would you like to do? Enter a key (T/G/P/A/H/S/M/C/E/1-6/R/?/Q):
385
+
386
+ User: T
387
+ Claude: Running E2E tests... [Invokes /e2e-test]
388
+ \`\`\`
389
+
390
+ ### Dynamic Content
391
+
392
+ When displaying resource views (1-6), read the actual contents from:
393
+ - Agents: \`.claude/agents/*.md\` files
394
+ - Skills: \`.claude/skills/*/skill.md\` files
395
+ - Hooks: \`.claude/hooks/*.js\` files
396
+ - Commands: \`.claude/commands/INDEX.md\`
397
+ - Settings: \`.claude/settings.json\` and \`.claude/settings.local.json\`
398
+ - Docs: \`.claude/docs/\` directory listing
399
+
400
+ ---
401
+
402
+ *Generated by Claude CLI Advanced Starter Pack v${getVersion()} on ${date}*
403
+ `;
404
+ }
405
+
406
+ /**
407
+ * Command template generators
408
+ */
409
+ const COMMAND_TEMPLATES = {
410
+ 'e2e-test': () => `---
411
+ description: Run E2E tests with Playwright
412
+ options:
413
+ - label: "Ralph Loop"
414
+ description: "Test-fix cycle until all pass"
415
+ - label: "Watch Mode"
416
+ description: "Interactive Playwright UI"
417
+ - label: "Headed Mode"
418
+ description: "Show browser window"
419
+ ---
420
+
421
+ # E2E Test Runner
422
+
423
+ Run Playwright E2E tests with various modes for comprehensive testing.
424
+
425
+ ## Usage
426
+
427
+ Select a test mode and Claude will execute the appropriate Playwright command.
428
+
429
+ ## Available Modes
430
+
431
+ 1. **Ralph Loop** - Runs tests, analyzes failures, fixes code, repeats until all pass
432
+ 2. **Watch Mode** - Opens Playwright UI for interactive test exploration
433
+ 3. **Headed Mode** - Runs tests with visible browser for debugging
434
+ 4. **Default** - Runs all tests in headless mode
435
+
436
+ ## Commands
437
+
438
+ \`\`\`bash
439
+ # Ralph loop (test-fix cycle)
440
+ npx playwright test --reporter=line 2>&1 | head -100
441
+
442
+ # Watch mode
443
+ npx playwright test --ui
444
+
445
+ # Headed mode
446
+ npx playwright test --headed
447
+
448
+ # Specific test file
449
+ npx playwright test tests/example.spec.ts
450
+ \`\`\`
451
+
452
+ ## Instructions
453
+
454
+ When invoked:
455
+ 1. Check for playwright.config.ts or playwright.config.js
456
+ 2. If not found, offer to set up Playwright
457
+ 3. Run the selected test mode
458
+ 4. For Ralph Loop: analyze failures and suggest fixes
459
+ `,
460
+
461
+ 'github-task': () => `---
462
+ description: Create GitHub issues with codebase analysis
463
+ options:
464
+ - label: "Bug Report"
465
+ description: "Report a bug with context"
466
+ - label: "Feature Request"
467
+ description: "Propose new functionality"
468
+ - label: "Refactor Task"
469
+ description: "Code improvement task"
470
+ ---
471
+
472
+ # GitHub Task Creator
473
+
474
+ Create well-documented GitHub issues with automatic codebase analysis.
475
+
476
+ ## Features
477
+
478
+ - Analyzes codebase to find relevant files
479
+ - Generates rich issue bodies with code snippets
480
+ - Adds to GitHub Project Board
481
+ - Sets appropriate labels and priority
482
+
483
+ ## Usage
484
+
485
+ 1. Describe the task or bug
486
+ 2. Claude analyzes relevant code
487
+ 3. Review generated issue body
488
+ 4. Confirm to create issue
489
+
490
+ ## Commands
491
+
492
+ \`\`\`bash
493
+ # Check gh CLI authentication
494
+ gh auth status
495
+
496
+ # Create issue with body
497
+ gh issue create --title "Title" --body "Body" --label "type:bug"
498
+
499
+ # Add to project board
500
+ gh project item-add <project-number> --owner <owner> --url <issue-url>
501
+ \`\`\`
502
+
503
+ ## Instructions
504
+
505
+ When invoked:
506
+ 1. Ask user for task description
507
+ 2. Search codebase for relevant files using Grep/Glob
508
+ 3. Generate comprehensive issue body with:
509
+ - Problem description
510
+ - Relevant code snippets
511
+ - Suggested implementation approach
512
+ - Acceptance criteria
513
+ 4. Create issue via gh CLI
514
+ 5. Add to project board if configured
515
+ `,
516
+
517
+ 'phase-dev-plan': () => `---
518
+ description: Create phased development plans with 95%+ success probability
519
+ options:
520
+ - label: "Small (1-2 phases)"
521
+ description: "Quick feature or bug fix"
522
+ - label: "Medium (3-4 phases)"
523
+ description: "Standard feature implementation"
524
+ - label: "Large (5+ phases)"
525
+ description: "Complex multi-system changes"
526
+ ---
527
+
528
+ # Phased Development Plan Generator
529
+
530
+ Create comprehensive, executable development plans that maximize success probability.
531
+
532
+ ## Why Phased Development?
533
+
534
+ - Breaks complex tasks into manageable chunks
535
+ - Each phase is independently testable
536
+ - Clear checkpoints for progress tracking
537
+ - Rollback points if issues arise
538
+
539
+ ## Generated Artifacts
540
+
541
+ 1. **PROGRESS.json** - State tracking and phase management
542
+ 2. **EXECUTIVE_SUMMARY.md** - Project overview and phase breakdown
543
+ 3. **Phase Executor Agent** - Autonomous phase execution
544
+ 4. **Slash Command** - Interactive phase navigation
545
+
546
+ ## Instructions
547
+
548
+ When invoked:
549
+ 1. Gather project requirements
550
+ 2. Analyze codebase for affected areas
551
+ 3. Determine appropriate scale (S/M/L)
552
+ 4. Generate phase breakdown with:
553
+ - Clear objectives
554
+ - Success criteria
555
+ - Estimated complexity
556
+ - Dependencies
557
+ 5. Create all artifacts in .claude/docs/<project-slug>/
558
+ 6. Generate executable slash command
559
+ `,
560
+
561
+ 'create-agent': () => `---
562
+ description: Create Claude Code agents (L1 orchestrators, L2 specialists, L3 workers)
563
+ options:
564
+ - label: "L1 Orchestrator"
565
+ description: "High-level task coordinator"
566
+ - label: "L2 Specialist"
567
+ description: "Domain-specific expert"
568
+ - label: "L3 Worker"
569
+ description: "Focused task executor"
570
+ ---
571
+
572
+ # Claude Code Agent Creator
573
+
574
+ Create agents for the Claude Code CLI agent hierarchy.
575
+
576
+ ## Agent Hierarchy
577
+
578
+ - **L1 Orchestrator** - Coordinates complex multi-step tasks, delegates to specialists
579
+ - **L2 Specialist** - Domain expertise (frontend, backend, testing, etc.)
580
+ - **L3 Worker** - Single-purpose task execution
581
+
582
+ ## Agent Structure
583
+
584
+ Agents are created in \`.claude/agents/<agent-name>.md\` with:
585
+ - YAML frontmatter (description, tools, model)
586
+ - System prompt
587
+ - Available tools and capabilities
588
+ - Example invocations
589
+
590
+ ## Instructions
591
+
592
+ When invoked:
593
+ 1. Ask for agent name and purpose
594
+ 2. Determine appropriate level (L1/L2/L3)
595
+ 3. Select relevant tools
596
+ 4. Generate agent file with proper frontmatter
597
+ 5. Register in settings.json allowedTools if needed
598
+ `,
599
+
600
+ 'create-hook': () => `---
601
+ description: Create enforcement hooks for Claude Code
602
+ options:
603
+ - label: "PreToolUse"
604
+ description: "Validate before tool execution"
605
+ - label: "PostToolUse"
606
+ description: "Process after tool completion"
607
+ - label: "UserPromptSubmit"
608
+ description: "Intercept user messages"
609
+ ---
610
+
611
+ # Claude Code Hook Creator
612
+
613
+ Create hooks that enforce patterns, validate inputs, and process outputs.
614
+
615
+ ## Hook Types
616
+
617
+ - **PreToolUse** - Runs before a tool executes (validation, blocking)
618
+ - **PostToolUse** - Runs after tool completes (logging, modification)
619
+ - **UserPromptSubmit** - Intercepts user messages (routing, preprocessing)
620
+
621
+ ## Hook Structure
622
+
623
+ Hooks are created in \`.claude/hooks/\` as JavaScript files:
624
+ - Export async function matching event type
625
+ - Receive context with tool name, input, user message
626
+ - Return continue/block decision
627
+
628
+ ## Instructions
629
+
630
+ When invoked:
631
+ 1. Ask for hook purpose and trigger
632
+ 2. Select event type
633
+ 3. Define target tools (for PreToolUse/PostToolUse)
634
+ 4. Generate hook file with proper exports
635
+ 5. Add to settings.local.json hooks array
636
+ `,
637
+
638
+ 'create-skill': () => `---
639
+ description: Create RAG-enhanced skill packages for Claude Code
640
+ ---
641
+
642
+ # Claude Code Skill Creator
643
+
644
+ Create skill packages that combine prompts, context, and workflows.
645
+
646
+ ## Skill Structure
647
+
648
+ Skills are created in \`.claude/skills/<skill-name>/\` with:
649
+ - \`skill.md\` - Main skill definition with YAML frontmatter
650
+ - \`context/\` - Supporting documentation and examples
651
+ - \`workflows/\` - Step-by-step procedures
652
+
653
+ ## Features
654
+
655
+ - RAG-enhanced context loading
656
+ - Workflow chaining
657
+ - Tool specifications
658
+ - Model preferences
659
+
660
+ ## Instructions
661
+
662
+ When invoked:
663
+ 1. Ask for skill name and purpose
664
+ 2. Define target domain/functionality
665
+ 3. Create skill directory structure
666
+ 4. Generate skill.md with frontmatter
667
+ 5. Add starter context files
668
+ `,
669
+
670
+ 'explore-mcp': () => `---
671
+ description: Discover and install MCP servers based on your tech stack
672
+ options:
673
+ - label: "Auto-Detect"
674
+ description: "Scan codebase and recommend"
675
+ - label: "Browse All"
676
+ description: "Show all available MCPs"
677
+ - label: "Testing MCPs"
678
+ description: "Playwright, Puppeteer"
679
+ ---
680
+
681
+ # MCP Server Explorer
682
+
683
+ Discover Model Context Protocol servers to extend Claude's capabilities.
684
+
685
+ ## Available MCP Categories
686
+
687
+ - **Testing** - Playwright, Puppeteer, Playwright Extended
688
+ - **VCS** - GitHub, Git
689
+ - **Deployment** - Railway, Cloudflare, DigitalOcean, Vercel
690
+ - **Database** - PostgreSQL, SQLite, Supabase
691
+ - **Automation** - n8n workflow automation
692
+ - **Communication** - Slack, Resend (email)
693
+ - **Utilities** - Filesystem, Fetch
694
+
695
+ ## Auto-Detection
696
+
697
+ Scans your codebase for:
698
+ - package.json dependencies
699
+ - Configuration files (supabase/, .env with keys)
700
+ - Import patterns
701
+
702
+ ## Instructions
703
+
704
+ When invoked:
705
+ 1. Scan codebase for tech stack indicators
706
+ 2. Recommend relevant MCPs
707
+ 3. Show installation commands
708
+ 4. Offer to add to claude_desktop_config.json or .mcp.json
709
+ `,
710
+
711
+ 'claude-audit': () => `---
712
+ description: Audit CLAUDE.md and .claude/ folder against Anthropic best practices
713
+ options:
714
+ - label: "Full Audit"
715
+ description: "Check everything"
716
+ - label: "CLAUDE.md Only"
717
+ description: "Check instruction files"
718
+ - label: "Folder Structure"
719
+ description: "Verify .claude/ organization"
720
+ ---
721
+
722
+ # Claude Code Setup Auditor
723
+
724
+ Verify your Claude Code configuration against Anthropic's official best practices.
725
+
726
+ ## Checks Performed
727
+
728
+ ### CLAUDE.md Files
729
+ - Line count (warn >150, error >300)
730
+ - Anti-patterns (long code blocks, vague instructions)
731
+ - Good patterns (IMPORTANT/MUST keywords, bash commands, @imports)
732
+
733
+ ### Folder Structure
734
+ - Required directories (commands/, skills/, agents/, hooks/)
735
+ - settings.json presence and validity
736
+ - Frontmatter validation for skills/agents
737
+
738
+ ## Instructions
739
+
740
+ When invoked:
741
+ 1. Read all CLAUDE.md files (root, .claude/, subdirectories)
742
+ 2. Analyze content against best practices
743
+ 3. Check .claude/ folder structure
744
+ 4. Generate report with:
745
+ - Passed checks
746
+ - Warnings (non-critical issues)
747
+ - Errors (must fix)
748
+ - Recommendations
749
+ `,
750
+
751
+ 'roadmap-sync': () => `---
752
+ description: Sync roadmaps with GitHub Project Board
753
+ options:
754
+ - label: "Import Roadmap"
755
+ description: "Create issues from ROADMAP.json"
756
+ - label: "Sync Progress"
757
+ description: "Update GitHub from local progress"
758
+ - label: "Pull Status"
759
+ description: "Fetch status from GitHub"
760
+ ---
761
+
762
+ # Roadmap Integration
763
+
764
+ Bridge local roadmap files with GitHub Project Board for bidirectional sync.
765
+
766
+ ## Workflow
767
+
768
+ 1. Create roadmap with \`/create-roadmap\` or manually
769
+ 2. Import projects as GitHub issues
770
+ 3. Track progress locally
771
+ 4. Sync changes to GitHub
772
+
773
+ ## File Format
774
+
775
+ Roadmaps are stored as JSON:
776
+ \`\`\`json
777
+ {
778
+ "title": "Project Roadmap",
779
+ "projects": [
780
+ {
781
+ "name": "Feature X",
782
+ "status": "in_progress",
783
+ "github_issue": 123
784
+ }
785
+ ]
786
+ }
787
+ \`\`\`
788
+
789
+ ## Instructions
790
+
791
+ When invoked:
792
+ 1. Check for ROADMAP.json in .claude/docs/
793
+ 2. Verify GitHub authentication and project access
794
+ 3. Perform selected sync operation
795
+ 4. Report changes made
796
+ `,
797
+
798
+ 'claude-settings': () => `---
799
+ description: Configure Claude CLI permissions and modes
800
+ options:
801
+ - label: "Permission Mode"
802
+ description: "Set allow/deny rules"
803
+ - label: "Agent-Only Mode"
804
+ description: "Configure agent launcher"
805
+ - label: "View Current"
806
+ description: "Show active settings"
807
+ ---
808
+
809
+ # Claude Settings Manager
810
+
811
+ Configure permissions, modes, and behaviors for Claude Code CLI.
812
+
813
+ ## Settings Categories
814
+
815
+ ### Permissions
816
+ - Tool allow/deny lists
817
+ - File access patterns
818
+ - Network restrictions
819
+
820
+ ### Modes
821
+ - Agent-only mode (restrict to specific agents)
822
+ - Auto-approve patterns
823
+ - Silent mode
824
+
825
+ ## Settings Files
826
+
827
+ - \`.claude/settings.json\` - Project settings (committed)
828
+ - \`.claude/settings.local.json\` - Local overrides (gitignored)
829
+
830
+ ## Instructions
831
+
832
+ When invoked:
833
+ 1. Read current settings from both files
834
+ 2. Show current configuration
835
+ 3. Allow modifications through interactive prompts
836
+ 4. Write changes to appropriate file
837
+ `,
838
+
839
+ 'codebase-explorer': () => `---
840
+ description: Analyze codebase structure and find relevant files
841
+ options:
842
+ - label: "Structure Overview"
843
+ description: "Show project organization"
844
+ - label: "Find Related Files"
845
+ description: "Search by keyword/pattern"
846
+ - label: "Dependency Analysis"
847
+ description: "Map imports and exports"
848
+ ---
849
+
850
+ # Codebase Explorer
851
+
852
+ Intelligent codebase analysis to understand structure and find relevant code.
853
+
854
+ ## Capabilities
855
+
856
+ - **Structure Overview** - Directory tree with key file identification
857
+ - **Pattern Search** - Find files by name patterns or content
858
+ - **Import Analysis** - Trace dependencies and exports
859
+ - **Tech Stack Detection** - Identify frameworks and libraries
860
+
861
+ ## Instructions
862
+
863
+ When invoked:
864
+ 1. For Structure Overview:
865
+ - Generate directory tree (depth 3)
866
+ - Identify entry points (main, index, app)
867
+ - List key configuration files
868
+ - Detect tech stack
869
+
870
+ 2. For Find Related Files:
871
+ - Ask for keyword/pattern
872
+ - Search with Glob and Grep
873
+ - Rank results by relevance
874
+ - Show code snippets
875
+
876
+ 3. For Dependency Analysis:
877
+ - Select starting file
878
+ - Trace imports recursively
879
+ - Generate dependency graph
880
+ - Identify circular dependencies
881
+ `,
882
+
883
+ 'rag-pipeline': () => `---
884
+ description: Generate RAG pipeline with L1 orchestrator + L2 specialists
885
+ options:
886
+ - label: "Full Pipeline"
887
+ description: "L1 + multiple L2 agents"
888
+ - label: "Single Domain"
889
+ description: "L1 + one L2 specialist"
890
+ ---
891
+
892
+ # RAG Pipeline Generator
893
+
894
+ Create a complete Retrieval-Augmented Generation pipeline with agent hierarchy.
895
+
896
+ ## Pipeline Structure
897
+
898
+ \`\`\`
899
+ L1 Orchestrator
900
+ ├── L2 Research Specialist
901
+ ├── L2 Implementation Specialist
902
+ ├── L2 Testing Specialist
903
+ └── L2 Documentation Specialist
904
+ \`\`\`
905
+
906
+ ## Generated Artifacts
907
+
908
+ - L1 orchestrator agent definition
909
+ - L2 specialist agent definitions
910
+ - Routing logic for task delegation
911
+ - Context management configuration
912
+
913
+ ## Instructions
914
+
915
+ When invoked:
916
+ 1. Ask for pipeline purpose/domain
917
+ 2. Determine needed specialists
918
+ 3. Generate L1 orchestrator with routing rules
919
+ 4. Generate L2 specialists with domain expertise
920
+ 5. Create coordination hooks if needed
921
+ 6. Generate invocation command
922
+ `,
923
+
924
+
925
+ 'create-task-list': () => `---
926
+ description: Create intelligent task list with codebase exploration and GitHub integration
927
+ options:
928
+ - label: "New Task List"
929
+ description: "Create fresh task list with exploration"
930
+ - label: "Quick Task List"
931
+ description: "Create task list without exploration"
932
+ ---
933
+
934
+ # Intelligent Task List Generator
935
+
936
+ Create a comprehensive task list with codebase exploration, clarifying questions, and GitHub integration.
937
+
938
+ ## Features
939
+
940
+ - **Codebase Exploration** - Deploy agents to understand relevant files and patterns
941
+ - **Clarifying Questions** - Ask follow-up questions when context is insufficient
942
+ - **Testing Options** - Ralph Loop, ngrok/production, Playwright modes
943
+ - **GitHub Integration** - Optionally create a tracked GitHub issue for the task
944
+ - **Progress Hook** - Auto-update GitHub issue as tasks complete
945
+
946
+ ## Execution Flow
947
+
948
+ ### Step 1: Capture User Prompt
949
+
950
+ If no arguments provided, ask what the user wants to accomplish.
951
+
952
+ ### Step 2: Context Assessment
953
+
954
+ Evaluate the prompt for specificity, scope, technical depth, and reproducibility.
955
+
956
+ **Score Calculation**:
957
+ - 70-100%: Sufficient context -> Parallel exploration
958
+ - 0-69%: Insufficient context -> Quick scan + clarifying questions
959
+
960
+ ### Step 3: Deploy Exploration Agents
961
+
962
+ Deploy in parallel:
963
+ - **Explore Agent 1**: Find files related to the task
964
+ - **Explore Agent 2**: Search for tests and documentation
965
+ - **Explore Agent 3** (if backend): Find API endpoints and models
966
+
967
+ ### Step 4: Synthesize and Ask Questions
968
+
969
+ Present findings and ask mandatory questions:
970
+
971
+ 1. **Testing Approach**: Ralph Loop vs Manual vs Minimal
972
+ 2. **Playwright Environment**: ngrok vs production vs none
973
+ 3. **GitHub Integration** (NEW): Create tracked GitHub issue?
974
+ 4. **Confirm Plan**: Proceed or adjust?
975
+
976
+ ### Step 5: Create Task List
977
+
978
+ Use TodoWrite to build the task list with:
979
+ - Task 0: Persistent context (never marked complete)
980
+ - Task 1: Login via Playwright (if E2E testing)
981
+ - Tasks 2-N: Implementation tasks
982
+ - Final tasks: Verification and commit
983
+
984
+ ### Step 6: Create GitHub Issue (Optional)
985
+
986
+ If user selected GitHub integration:
987
+ 1. Create comprehensive issue with codebase analysis
988
+ 2. Add to project board
989
+ 3. Install progress hook to auto-update issue
990
+
991
+ ## GitHub Integration Details
992
+
993
+ When enabled, the command:
994
+ 1. Creates a GitHub issue with:
995
+ - Problem statement from user prompt
996
+ - Code analysis from exploration
997
+ - Task checklist (matching TodoWrite tasks)
998
+ - Reference documentation links
999
+
1000
+ 2. Installs a PostToolUse hook that:
1001
+ - Watches for TodoWrite calls
1002
+ - Updates GitHub issue progress when tasks complete
1003
+ - Adds comments for significant milestones
1004
+
1005
+ ## Instructions
1006
+
1007
+ When invoked:
1008
+ 1. Gather task description (from args or by asking)
1009
+ 2. Assess context quality
1010
+ 3. Deploy exploration agents (parallel if sufficient context)
1011
+ 4. Present findings and ask questions
1012
+ 5. Create task list with TodoWrite
1013
+ 6. Optionally create GitHub issue and install progress hook
1014
+ 7. Begin Task 1
1015
+ `,
1016
+
1017
+ 'ccasp-setup': () => `---
1018
+ description: CCASP Setup Wizard - vibe-code friendly project configuration
1019
+ model: haiku
1020
+ options:
1021
+ - label: "Quick Start"
1022
+ description: "Auto-detect + init"
1023
+ - label: "Full Setup"
1024
+ description: "All features"
1025
+ - label: "Audit"
1026
+ description: "Check CLAUDE.md"
1027
+ - label: "Enhance"
1028
+ description: "Generate CLAUDE.md"
1029
+ ---
1030
+
1031
+ # CCASP Setup Wizard
1032
+
1033
+ Interactive setup wizard for Claude Code CLI enhancement.
1034
+
1035
+ ## Quick Options
1036
+
1037
+ Reply with a **number** or **letter** to select:
1038
+
1039
+ | # | Action | Description |
1040
+ |---|--------|-------------|
1041
+ | **1** | Quick Start | Auto-detect stack + init .claude |
1042
+ | **2** | Full Setup | All features with customization |
1043
+ | **3** | GitHub | Connect project board |
1044
+ | **4** | Audit | Check existing CLAUDE.md |
1045
+ | **5** | Enhance | Generate/improve CLAUDE.md |
1046
+ | **6** | Detect | Show detected tech stack |
1047
+ | **7** | Templates | Browse available items |
1048
+
1049
+ ## Feature Presets
1050
+
1051
+ | Letter | Preset | Features |
1052
+ |--------|--------|----------|
1053
+ | **A** | Minimal | Menu + help only |
1054
+ | **B** | Standard | Essential + GitHub + testing |
1055
+ | **C** | Full | Everything including agents |
1056
+ | **D** | Custom | Pick individual features |
1057
+
1058
+ ## Instructions for Claude
1059
+
1060
+ When this command is invoked:
1061
+
1062
+ 1. **Show welcome message** with current project status:
1063
+ - Does \`.claude/\` exist? (check with Bash: ls -la .claude 2>/dev/null)
1064
+ - Does \`CLAUDE.md\` exist? (check with Bash: ls -la CLAUDE.md 2>/dev/null)
1065
+ - Is tech stack detected? (check for package.json, pyproject.toml, etc.)
1066
+
1067
+ 2. **Present the quick options menu** and wait for user selection
1068
+
1069
+ 3. **Handle user selection**:
1070
+ - If user types a number (1-7), execute that action
1071
+ - If user types a letter (A-D), apply that preset
1072
+ - For "1" (Quick Start): run tech detection, show results, apply Standard preset
1073
+ - For "4" (Audit): check CLAUDE.md against best practices
1074
+ - For "5" (Enhance): offer to generate missing sections
1075
+
1076
+ 4. **For Quick Start**:
1077
+ - Detect tech stack from package.json, config files
1078
+ - Show summary of detected stack
1079
+ - Create .claude/ folder with commands, settings
1080
+ - Generate CLAUDE.md with detected stack info
1081
+
1082
+ 5. **CRITICAL - Session Restart Reminder**:
1083
+ After ANY action that modifies \`.claude/\` or \`CLAUDE.md\`, display:
1084
+
1085
+ ⚠️ RESTART REQUIRED
1086
+
1087
+ Changes to .claude/ require a new Claude Code session.
1088
+
1089
+ To apply changes:
1090
+ 1. Exit this session (Ctrl+C or /exit)
1091
+ 2. Restart: claude or claude .
1092
+ 3. New commands will be available
1093
+
1094
+ Actions requiring restart: 1, 2, 3, 5
1095
+ Actions NOT requiring restart: 4 (audit), 6 (detect), 7 (templates)
1096
+
1097
+ ## Vibe-Code Design
1098
+
1099
+ This wizard is designed for mobile/remote use:
1100
+ - Single character inputs only
1101
+ - No long text entry required
1102
+ - Progressive disclosure
1103
+ - Sensible defaults
1104
+
1105
+ ## Terminal Alternative
1106
+
1107
+ \`\`\`bash
1108
+ npx ccasp wizard # Interactive setup
1109
+ npx ccasp init # Initialize .claude folder
1110
+ npx ccasp detect-stack # Detect tech stack
1111
+ \`\`\`
1112
+ `,};
1113
+
1114
+ /**
1115
+ * Generate starter agent file
1116
+ */
1117
+ function generateStarterAgent(agentName) {
1118
+ return `---
1119
+ description: ${agentName} agent - Add your description here
1120
+ tools:
1121
+ - Read
1122
+ - Grep
1123
+ - Glob
1124
+ - Bash
1125
+ model: sonnet
1126
+ ---
1127
+
1128
+ # ${agentName} Agent
1129
+
1130
+ ## Purpose
1131
+
1132
+ Describe what this agent does and when to use it.
1133
+
1134
+ ## Capabilities
1135
+
1136
+ - List the agent's primary capabilities
1137
+ - What tasks it can handle
1138
+ - What domains it specializes in
1139
+
1140
+ ## Usage
1141
+
1142
+ Invoke this agent with the Task tool:
1143
+
1144
+ \`\`\`
1145
+ Task: "${agentName}"
1146
+ Prompt: "Your task description here"
1147
+ \`\`\`
1148
+
1149
+ ## Instructions
1150
+
1151
+ When this agent is invoked:
1152
+
1153
+ 1. Understand the task context
1154
+ 2. Use available tools to gather information
1155
+ 3. Execute the required actions
1156
+ 4. Report results clearly
1157
+ `;
1158
+ }
1159
+
1160
+ /**
1161
+ * Generate starter skill file
1162
+ */
1163
+ function generateStarterSkill(skillName) {
1164
+ return `---
1165
+ description: ${skillName} skill - Add your description here
1166
+ ---
1167
+
1168
+ # ${skillName} Skill
1169
+
1170
+ ## Overview
1171
+
1172
+ Describe what this skill provides and when to use it.
1173
+
1174
+ ## Context
1175
+
1176
+ This skill has access to supporting documentation in the \`context/\` folder.
1177
+
1178
+ ## Workflows
1179
+
1180
+ Step-by-step procedures are available in the \`workflows/\` folder.
1181
+
1182
+ ## Usage
1183
+
1184
+ Invoke this skill by typing \`/${skillName}\` or referencing it with the Skill tool.
1185
+
1186
+ ## Instructions
1187
+
1188
+ When this skill is invoked:
1189
+
1190
+ 1. Load relevant context from the context folder
1191
+ 2. Follow applicable workflows
1192
+ 3. Apply domain expertise
1193
+ 4. Provide clear, actionable guidance
1194
+ `;
1195
+ }
1196
+
1197
+ /**
1198
+ * Generate starter hook file
1199
+ */
1200
+ function generateStarterHook(hookName, eventType = 'PreToolUse') {
1201
+ return `/**
1202
+ * ${hookName} Hook
1203
+ *
1204
+ * Event: ${eventType}
1205
+ * Description: Add your description here
1206
+ */
1207
+
1208
+ export default async function ${hookName.replace(/-/g, '_')}(context) {
1209
+ const { tool, input, session } = context;
1210
+
1211
+ // Example: Log all tool usage
1212
+ console.log(\`[${hookName}] Tool: \${tool}, Input: \${JSON.stringify(input).slice(0, 100)}\`);
1213
+
1214
+ // Return decision
1215
+ return {
1216
+ continue: true, // Set to false to block the action
1217
+ // message: 'Optional message to show user',
1218
+ // modifiedInput: input, // Optional: modify the input
1219
+ };
1220
+ }
1221
+ `;
1222
+ }
1223
+
1224
+ /**
1225
+ * Generate settings.json
1226
+ */
1227
+ function generateSettingsJson(projectName) {
1228
+ return JSON.stringify({
1229
+ "$schema": "https://raw.githubusercontent.com/anthropics/claude-code/main/.claude/settings.schema.json",
1230
+ "project": {
1231
+ "name": projectName,
1232
+ "description": "Project configured with Claude CLI Advanced Starter Pack"
1233
+ },
1234
+ "permissions": {
1235
+ "allowedTools": ["Read", "Write", "Edit", "Glob", "Grep", "Bash", "Task"],
1236
+ "deniedTools": []
1237
+ },
1238
+ "agents": [],
1239
+ "hooks": []
1240
+ }, null, 2);
1241
+ }
1242
+
1243
+ /**
1244
+ * Generate settings.local.json
1245
+ */
1246
+ function generateSettingsLocalJson() {
1247
+ return JSON.stringify({
1248
+ "$schema": "https://raw.githubusercontent.com/anthropics/claude-code/main/.claude/settings.schema.json",
1249
+ "permissions": {
1250
+ "allowedTools": [],
1251
+ "deniedTools": []
1252
+ },
1253
+ "hooks": []
1254
+ }, null, 2);
1255
+ }
1256
+
1257
+ /**
1258
+ * Run the init wizard
1259
+ */
1260
+ export async function runInit(options = {}) {
1261
+ showHeader('Claude CLI Advanced Starter Pack - Project Setup');
1262
+
1263
+ const cwd = process.cwd();
1264
+ const projectName = basename(cwd);
1265
+ const claudeDir = join(cwd, '.claude');
1266
+ const commandsDir = join(claudeDir, 'commands');
1267
+ const skillsDir = join(claudeDir, 'skills');
1268
+ const agentsDir = join(claudeDir, 'agents');
1269
+ const hooksDir = join(claudeDir, 'hooks');
1270
+ const docsDir = join(claudeDir, 'docs');
1271
+
1272
+ console.log(chalk.cyan(` Project: ${chalk.bold(projectName)}`));
1273
+ console.log(chalk.cyan(` Location: ${cwd}`));
1274
+ console.log('');
1275
+
1276
+ // Check for existing .claude folder
1277
+ const hasExistingClaudeDir = existsSync(claudeDir);
1278
+
1279
+ if (hasExistingClaudeDir) {
1280
+ // Count existing content
1281
+ const existingCommands = existsSync(commandsDir) ? readdirSync(commandsDir).filter(f => f.endsWith('.md')).length : 0;
1282
+ const existingAgents = existsSync(agentsDir) ? readdirSync(agentsDir).filter(f => f.endsWith('.md')).length : 0;
1283
+ const existingSkills = existsSync(skillsDir) ? readdirSync(skillsDir).filter(f => !f.startsWith('.')).length : 0;
1284
+ const existingHooks = existsSync(hooksDir) ? readdirSync(hooksDir).filter(f => f.endsWith('.js')).length : 0;
1285
+ const hasSettings = existsSync(join(claudeDir, 'settings.json'));
1286
+
1287
+ console.log(chalk.cyan('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
1288
+ console.log(chalk.green.bold(' ✓ Existing .claude/ folder detected'));
1289
+ console.log(chalk.cyan('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
1290
+ console.log('');
1291
+ console.log(chalk.dim(' Current contents:'));
1292
+ if (existingCommands > 0) console.log(chalk.dim(` • ${existingCommands} command(s) in commands/`));
1293
+ if (existingAgents > 0) console.log(chalk.dim(` • ${existingAgents} agent(s) in agents/`));
1294
+ if (existingSkills > 0) console.log(chalk.dim(` • ${existingSkills} skill(s) in skills/`));
1295
+ if (existingHooks > 0) console.log(chalk.dim(` • ${existingHooks} hook(s) in hooks/`));
1296
+ if (hasSettings) console.log(chalk.dim(` • settings.json configured`));
1297
+ console.log('');
1298
+ console.log(chalk.yellow.bold(' ⚠ Your existing files will NOT be overwritten'));
1299
+ console.log(chalk.dim(' New commands will be added alongside your existing setup.'));
1300
+ console.log(chalk.dim(' Use --force flag to overwrite specific commands if needed.'));
1301
+ console.log('');
1302
+
1303
+ const { confirmProceed } = await inquirer.prompt([
1304
+ {
1305
+ type: 'confirm',
1306
+ name: 'confirmProceed',
1307
+ message: 'Continue with installation? (existing files are safe)',
1308
+ default: true,
1309
+ },
1310
+ ]);
1311
+
1312
+ if (!confirmProceed) {
1313
+ console.log(chalk.dim('\nCancelled. No changes made.'));
1314
+ return;
1315
+ }
1316
+ console.log('');
1317
+ }
1318
+
1319
+ // Step 1: Check and create folder structure
1320
+ console.log(chalk.bold('Step 1: Setting up .claude/ folder structure\n'));
1321
+ console.log(chalk.dim(' (Only creates missing folders - existing content preserved)\n'));
1322
+
1323
+ const foldersToCreate = [
1324
+ { path: claudeDir, name: '.claude' },
1325
+ { path: commandsDir, name: '.claude/commands' },
1326
+ { path: skillsDir, name: '.claude/skills' },
1327
+ { path: agentsDir, name: '.claude/agents' },
1328
+ { path: hooksDir, name: '.claude/hooks' },
1329
+ { path: docsDir, name: '.claude/docs' },
1330
+ ];
1331
+
1332
+ for (const folder of foldersToCreate) {
1333
+ if (!existsSync(folder.path)) {
1334
+ mkdirSync(folder.path, { recursive: true });
1335
+ console.log(chalk.green(` ✓ Created ${folder.name}/`));
1336
+ } else {
1337
+ console.log(chalk.dim(` ○ ${folder.name}/ exists`));
1338
+ }
1339
+ }
1340
+
1341
+ console.log('');
1342
+
1343
+ // Step 2: Create settings files if they don't exist
1344
+ console.log(chalk.bold('Step 2: Configuring settings\n'));
1345
+ console.log(chalk.dim(' (Skips existing files - your settings are preserved)\n'));
1346
+
1347
+ const settingsPath = join(claudeDir, 'settings.json');
1348
+ const settingsLocalPath = join(claudeDir, 'settings.local.json');
1349
+
1350
+ if (!existsSync(settingsPath)) {
1351
+ writeFileSync(settingsPath, generateSettingsJson(projectName), 'utf8');
1352
+ console.log(chalk.green(' ✓ Created settings.json'));
1353
+ } else {
1354
+ console.log(chalk.blue(' ○ settings.json exists (preserved)'));
1355
+ }
1356
+
1357
+ if (!existsSync(settingsLocalPath)) {
1358
+ writeFileSync(settingsLocalPath, generateSettingsLocalJson(), 'utf8');
1359
+ console.log(chalk.green(' ✓ Created settings.local.json'));
1360
+ } else {
1361
+ console.log(chalk.blue(' ○ settings.local.json exists (preserved)'));
1362
+ }
1363
+
1364
+ console.log('');
1365
+
1366
+ // Step 3: Create starter files for each folder (only if folder is empty)
1367
+ console.log(chalk.bold('Step 3: Creating starter files\n'));
1368
+ console.log(chalk.dim(' (Only creates examples in empty folders)\n'));
1369
+
1370
+ // Check if agents folder has any files before adding example
1371
+ const agentFiles = existsSync(agentsDir) ? readdirSync(agentsDir).filter(f => f.endsWith('.md')) : [];
1372
+ if (agentFiles.length === 0) {
1373
+ const starterAgentPath = join(agentsDir, 'example-agent.md');
1374
+ writeFileSync(starterAgentPath, generateStarterAgent('example-agent'), 'utf8');
1375
+ console.log(chalk.green(' ✓ Created agents/example-agent.md (starter template)'));
1376
+ } else {
1377
+ console.log(chalk.blue(` ○ agents/ has ${agentFiles.length} existing agent(s) (preserved)`));
1378
+ }
1379
+
1380
+ // Check if skills folder has any skills before adding example
1381
+ const skillDirs = existsSync(skillsDir) ? readdirSync(skillsDir).filter(f => !f.startsWith('.')) : [];
1382
+ if (skillDirs.length === 0) {
1383
+ const starterSkillDir = join(skillsDir, 'example-skill');
1384
+ mkdirSync(starterSkillDir, { recursive: true });
1385
+ mkdirSync(join(starterSkillDir, 'context'), { recursive: true });
1386
+ mkdirSync(join(starterSkillDir, 'workflows'), { recursive: true });
1387
+ writeFileSync(join(starterSkillDir, 'skill.md'), generateStarterSkill('example-skill'), 'utf8');
1388
+ writeFileSync(join(starterSkillDir, 'context', 'README.md'), '# Context\n\nAdd supporting documentation here.\n', 'utf8');
1389
+ writeFileSync(join(starterSkillDir, 'workflows', 'README.md'), '# Workflows\n\nAdd step-by-step procedures here.\n', 'utf8');
1390
+ console.log(chalk.green(' ✓ Created skills/example-skill/ (starter template)'));
1391
+ } else {
1392
+ console.log(chalk.blue(` ○ skills/ has ${skillDirs.length} existing skill(s) (preserved)`));
1393
+ }
1394
+
1395
+ // Check if hooks folder has any files before adding example
1396
+ const hookFiles = existsSync(hooksDir) ? readdirSync(hooksDir).filter(f => f.endsWith('.js')) : [];
1397
+ if (hookFiles.length === 0) {
1398
+ const starterHookPath = join(hooksDir, 'example-hook.js');
1399
+ writeFileSync(starterHookPath, generateStarterHook('example-hook', 'PreToolUse'), 'utf8');
1400
+ console.log(chalk.green(' ✓ Created hooks/example-hook.js (starter template)'));
1401
+ } else {
1402
+ console.log(chalk.blue(` ○ hooks/ has ${hookFiles.length} existing hook(s) (preserved)`));
1403
+ }
1404
+
1405
+ console.log('');
1406
+
1407
+ // Step 4: Select optional features
1408
+ console.log(chalk.bold('Step 4: Select optional features\n'));
1409
+ console.log(chalk.dim(' Each feature adds commands and hooks to your project.'));
1410
+ console.log(chalk.dim(' Features marked with (*) require additional configuration via /menu after installation.\n'));
1411
+
1412
+ // Display feature descriptions in a nice format
1413
+ for (const feature of OPTIONAL_FEATURES) {
1414
+ const marker = feature.default ? chalk.green('●') : chalk.dim('○');
1415
+ const postConfig = feature.requiresPostConfig ? chalk.yellow(' (*)') : '';
1416
+ console.log(` ${marker} ${chalk.bold(feature.label)}${postConfig}`);
1417
+ console.log(chalk.dim(` ${feature.description}`));
1418
+ if (feature.commands.length > 0) {
1419
+ console.log(chalk.dim(` Adds: ${feature.commands.map(c => '/' + c).join(', ')}`));
1420
+ }
1421
+ console.log('');
1422
+ }
1423
+
1424
+ const { selectedFeatures } = await inquirer.prompt([
1425
+ {
1426
+ type: 'checkbox',
1427
+ name: 'selectedFeatures',
1428
+ message: 'Select features to enable:',
1429
+ choices: OPTIONAL_FEATURES.map((feature) => ({
1430
+ name: `${feature.label}${feature.requiresPostConfig ? ' (*)' : ''} - ${feature.commands.length} commands, ${feature.hooks.length} hooks`,
1431
+ value: feature.name,
1432
+ checked: feature.default,
1433
+ })),
1434
+ pageSize: 10,
1435
+ },
1436
+ ]);
1437
+
1438
+ // Store selected features for later use
1439
+ const enabledFeatures = OPTIONAL_FEATURES.filter((f) => selectedFeatures.includes(f.name));
1440
+ const featuresRequiringConfig = enabledFeatures.filter((f) => f.requiresPostConfig);
1441
+
1442
+ if (featuresRequiringConfig.length > 0) {
1443
+ console.log('');
1444
+ console.log(chalk.yellow(' ℹ The following features require configuration after installation:'));
1445
+ for (const feature of featuresRequiringConfig) {
1446
+ console.log(chalk.yellow(` • ${feature.label}`));
1447
+ }
1448
+ console.log(chalk.dim(' Run /menu → Project Settings after installation to complete setup.'));
1449
+ }
1450
+
1451
+ console.log('');
1452
+
1453
+ // Step 5: Select slash commands to install
1454
+ console.log(chalk.bold('Step 5: Select slash commands to install\n'));
1455
+
1456
+ // Check for existing commands first
1457
+ const existingCmdFiles = existsSync(commandsDir)
1458
+ ? readdirSync(commandsDir).filter(f => f.endsWith('.md') && f !== 'INDEX.md' && f !== 'README.md')
1459
+ : [];
1460
+ const existingCmdNames = existingCmdFiles.map(f => f.replace('.md', ''));
1461
+
1462
+ if (existingCmdNames.length > 0) {
1463
+ console.log(chalk.blue(` ℹ Found ${existingCmdNames.length} existing command(s) in your project:`));
1464
+ console.log(chalk.dim(` ${existingCmdNames.map(c => '/' + c).join(', ')}`));
1465
+ console.log(chalk.dim(' These will be preserved unless you choose to overwrite.\n'));
1466
+ }
1467
+
1468
+ const categories = [...new Set(AVAILABLE_COMMANDS.map((c) => c.category))];
1469
+
1470
+ for (const category of categories) {
1471
+ console.log(chalk.cyan(` ${category}:`));
1472
+ const cmds = AVAILABLE_COMMANDS.filter((c) => c.category === category);
1473
+ for (const cmd of cmds) {
1474
+ const isExisting = existingCmdNames.includes(cmd.name);
1475
+ const marker = cmd.selected ? chalk.green('●') : chalk.dim('○');
1476
+ const required = cmd.required ? chalk.yellow(' (required)') : '';
1477
+ const existing = isExisting ? chalk.blue(' [exists]') : '';
1478
+ console.log(` ${marker} /${cmd.name}${required}${existing} - ${chalk.dim(cmd.description)}`);
1479
+ }
1480
+ console.log('');
1481
+ }
1482
+
1483
+ // Ask which commands to install
1484
+ const { selectedCommands } = await inquirer.prompt([
1485
+ {
1486
+ type: 'checkbox',
1487
+ name: 'selectedCommands',
1488
+ message: 'Select commands to install (existing commands marked with [exists]):',
1489
+ choices: AVAILABLE_COMMANDS.map((cmd) => {
1490
+ const isExisting = existingCmdNames.includes(cmd.name);
1491
+ return {
1492
+ name: `/${cmd.name}${isExisting ? ' [exists]' : ''} - ${cmd.description}`,
1493
+ value: cmd.name,
1494
+ checked: cmd.selected,
1495
+ disabled: cmd.required ? 'Required' : false,
1496
+ };
1497
+ }),
1498
+ pageSize: 15,
1499
+ },
1500
+ ]);
1501
+
1502
+ // Always include required commands
1503
+ const requiredCommands = AVAILABLE_COMMANDS.filter(c => c.required).map(c => c.name);
1504
+ const finalCommands = [...new Set([...requiredCommands, ...selectedCommands])];
1505
+
1506
+ if (finalCommands.length === 0) {
1507
+ showWarning('No commands selected. Nothing to install.');
1508
+ return;
1509
+ }
1510
+
1511
+ console.log('');
1512
+
1513
+ // Step 6: Check for existing commands that would be overwritten
1514
+ const commandsToOverwrite = finalCommands.filter(cmd => existingCmdNames.includes(cmd));
1515
+
1516
+ let overwrite = options.force || false;
1517
+ if (commandsToOverwrite.length > 0 && !overwrite) {
1518
+ console.log(chalk.yellow.bold(' ⚠ The following commands already exist:'));
1519
+ for (const cmd of commandsToOverwrite) {
1520
+ console.log(chalk.yellow(` • /${cmd}`));
1521
+ }
1522
+ console.log('');
1523
+
1524
+ const { overwriteChoice } = await inquirer.prompt([
1525
+ {
1526
+ type: 'list',
1527
+ name: 'overwriteChoice',
1528
+ message: 'How would you like to handle existing commands?',
1529
+ choices: [
1530
+ { name: 'Skip existing - only install new commands (recommended)', value: 'skip' },
1531
+ { name: 'Overwrite all - replace existing with starter pack versions', value: 'overwrite' },
1532
+ { name: 'Cancel installation', value: 'cancel' },
1533
+ ],
1534
+ },
1535
+ ]);
1536
+
1537
+ if (overwriteChoice === 'cancel') {
1538
+ console.log(chalk.dim('\nCancelled. No changes made.'));
1539
+ return;
1540
+ }
1541
+
1542
+ overwrite = overwriteChoice === 'overwrite';
1543
+
1544
+ if (!overwrite) {
1545
+ // Filter out existing commands (keep only new ones + required)
1546
+ const filtered = finalCommands.filter((c) => !existingCmdNames.includes(c) || requiredCommands.includes(c));
1547
+ finalCommands.length = 0;
1548
+ finalCommands.push(...filtered);
1549
+ console.log(chalk.green(`\n ✓ Will install ${finalCommands.length} new command(s), preserving ${commandsToOverwrite.length} existing`));
1550
+ } else {
1551
+ console.log(chalk.yellow(`\n ⚠ Will overwrite ${commandsToOverwrite.length} existing command(s)`));
1552
+ }
1553
+ }
1554
+
1555
+ // Step 7: Install commands
1556
+ console.log(chalk.bold('Step 6: Installing slash commands\n'));
1557
+
1558
+ const spinner = ora('Installing commands...').start();
1559
+ const installed = [];
1560
+ const failed = [];
1561
+
1562
+ // Get installed agents, skills, hooks for menu
1563
+ const installedAgents = existsSync(agentsDir)
1564
+ ? readdirSync(agentsDir).filter(f => f.endsWith('.md')).map(f => f.replace('.md', ''))
1565
+ : [];
1566
+ const installedSkills = existsSync(skillsDir)
1567
+ ? readdirSync(skillsDir).filter(f => !f.startsWith('.'))
1568
+ : [];
1569
+ const installedHooks = existsSync(hooksDir)
1570
+ ? readdirSync(hooksDir).filter(f => f.endsWith('.js')).map(f => f.replace('.js', ''))
1571
+ : [];
1572
+
1573
+ for (const cmdName of finalCommands) {
1574
+ try {
1575
+ const cmdPath = join(commandsDir, `${cmdName}.md`);
1576
+
1577
+ let content;
1578
+ if (cmdName === 'menu') {
1579
+ // Generate dynamic menu command
1580
+ content = generateMenuCommand(projectName, finalCommands, installedAgents, installedSkills, installedHooks);
1581
+ } else {
1582
+ const template = COMMAND_TEMPLATES[cmdName];
1583
+ if (template) {
1584
+ content = template();
1585
+ } else {
1586
+ failed.push({ name: cmdName, error: 'No template found' });
1587
+ continue;
1588
+ }
1589
+ }
1590
+
1591
+ writeFileSync(cmdPath, content, 'utf8');
1592
+ installed.push(cmdName);
1593
+ } catch (error) {
1594
+ failed.push({ name: cmdName, error: error.message });
1595
+ }
1596
+ }
1597
+
1598
+ spinner.stop();
1599
+
1600
+ // Step 7: Generate INDEX.md
1601
+ const indexPath = join(commandsDir, 'INDEX.md');
1602
+ const indexContent = generateIndexFile(installed, projectName);
1603
+ writeFileSync(indexPath, indexContent, 'utf8');
1604
+
1605
+ // Step 8: Generate README.md
1606
+ const readmePath = join(commandsDir, 'README.md');
1607
+ const readmeContent = generateReadmeFile(installed, projectName);
1608
+ writeFileSync(readmePath, readmeContent, 'utf8');
1609
+
1610
+ // Summary
1611
+ console.log('');
1612
+
1613
+ // Count what was preserved
1614
+ const preservedCommands = existingCmdNames.filter(c => !installed.includes(c) || !overwrite);
1615
+ const newCommands = installed.filter(c => !existingCmdNames.includes(c));
1616
+ const updatedCommands = installed.filter(c => existingCmdNames.includes(c) && overwrite);
1617
+
1618
+ if (installed.length > 0) {
1619
+ const summaryLines = [
1620
+ '',
1621
+ `Project: ${projectName}`,
1622
+ '',
1623
+ ];
1624
+
1625
+ // Show what happened
1626
+ if (hasExistingClaudeDir) {
1627
+ summaryLines.push('Integration Summary:');
1628
+ if (newCommands.length > 0) {
1629
+ summaryLines.push(` ✓ ${newCommands.length} new command(s) added`);
1630
+ }
1631
+ if (updatedCommands.length > 0) {
1632
+ summaryLines.push(` ↻ ${updatedCommands.length} command(s) updated`);
1633
+ }
1634
+ if (preservedCommands.length > 0) {
1635
+ summaryLines.push(` ○ ${preservedCommands.length} existing command(s) preserved`);
1636
+ }
1637
+ summaryLines.push('');
1638
+ }
1639
+
1640
+ summaryLines.push('Folder Structure:');
1641
+ summaryLines.push(' .claude/');
1642
+ summaryLines.push(' ├── commands/ (slash commands)');
1643
+ summaryLines.push(' ├── agents/ (custom agents)');
1644
+ summaryLines.push(' ├── skills/ (skill packages)');
1645
+ summaryLines.push(' ├── hooks/ (enforcement hooks)');
1646
+ summaryLines.push(' ├── docs/ (documentation)');
1647
+ summaryLines.push(' ├── settings.json');
1648
+ summaryLines.push(' └── settings.local.json');
1649
+ summaryLines.push('');
1650
+ summaryLines.push(`Commands Available: ${installed.length + preservedCommands.length}`);
1651
+ summaryLines.push(...installed.slice(0, 6).map((c) => ` /${c}${newCommands.includes(c) ? ' (new)' : ''}`));
1652
+ if (installed.length > 6) {
1653
+ summaryLines.push(` ... and ${installed.length - 6} more`);
1654
+ }
1655
+
1656
+ showSuccess('Claude CLI Advanced Starter Pack Deployed!', summaryLines);
1657
+ }
1658
+
1659
+ if (failed.length > 0) {
1660
+ showError('Some commands failed to install:');
1661
+ for (const f of failed) {
1662
+ console.log(chalk.red(` /${f.name}: ${f.error}`));
1663
+ }
1664
+ }
1665
+
1666
+ // Generate tech-stack.json with enabled features
1667
+ const techStackPath = join(claudeDir, 'config', 'tech-stack.json');
1668
+ const configDir = join(claudeDir, 'config');
1669
+ if (!existsSync(configDir)) {
1670
+ mkdirSync(configDir, { recursive: true });
1671
+ }
1672
+
1673
+ // Build tech-stack.json with enabled features
1674
+ const techStack = {
1675
+ version: '2.0.0',
1676
+ project: {
1677
+ name: projectName,
1678
+ description: '',
1679
+ rootPath: '.',
1680
+ },
1681
+ // Enable features based on user selection
1682
+ tokenManagement: {
1683
+ enabled: selectedFeatures.includes('tokenManagement'),
1684
+ dailyBudget: 200000,
1685
+ thresholds: { compact: 0.75, archive: 0.85, respawn: 0.90 },
1686
+ },
1687
+ happyMode: {
1688
+ enabled: selectedFeatures.includes('happyMode'),
1689
+ dashboardUrl: null,
1690
+ checkpointInterval: 10,
1691
+ verbosity: 'condensed',
1692
+ },
1693
+ agents: {
1694
+ enabled: true,
1695
+ l1: { model: 'sonnet', tools: ['Task', 'Read', 'Grep', 'Glob', 'WebSearch'], maxTokens: 16000 },
1696
+ l2: { model: 'sonnet', tools: ['Read', 'Edit', 'Write', 'Bash', 'Grep', 'Glob'], maxTokens: 8000 },
1697
+ l3: { model: 'haiku', tools: ['Read', 'Grep'], maxTokens: 500 },
1698
+ maxConcurrent: 4,
1699
+ },
1700
+ phasedDevelopment: {
1701
+ enabled: selectedFeatures.includes('phasedDevelopment'),
1702
+ defaultScale: 'M',
1703
+ successTarget: 0.95,
1704
+ },
1705
+ hooks: {
1706
+ enabled: true,
1707
+ priorities: { lifecycle: 100, tools: 1000, automation: 2000 },
1708
+ errorBehavior: 'approve',
1709
+ },
1710
+ devEnvironment: {
1711
+ tunnel: {
1712
+ service: 'none', // No default - configured via /menu
1713
+ url: null,
1714
+ subdomain: null,
1715
+ },
1716
+ },
1717
+ deployment: {
1718
+ frontend: { platform: 'none' },
1719
+ backend: { platform: 'none' },
1720
+ },
1721
+ versionControl: {
1722
+ provider: 'github',
1723
+ projectBoard: { type: 'none' },
1724
+ },
1725
+ // Track which features need post-install configuration
1726
+ _pendingConfiguration: featuresRequiringConfig.map((f) => f.name),
1727
+ };
1728
+
1729
+ if (!existsSync(techStackPath)) {
1730
+ writeFileSync(techStackPath, JSON.stringify(techStack, null, 2), 'utf8');
1731
+ console.log(chalk.green(' ✓ Created config/tech-stack.json'));
1732
+ } else {
1733
+ console.log(chalk.blue(' ○ config/tech-stack.json exists (preserved)'));
1734
+ }
1735
+
1736
+ // Show next steps
1737
+ console.log(chalk.bold('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
1738
+ console.log(chalk.bold('Next Steps:\n'));
1739
+ console.log(chalk.cyan(' 1.') + ' Launch Claude Code CLI in this project');
1740
+ console.log(chalk.cyan(' 2.') + ` Type ${chalk.bold('/menu')} to see the interactive project menu`);
1741
+
1742
+ // Show post-config reminder if features need it
1743
+ if (featuresRequiringConfig.length > 0) {
1744
+ console.log(chalk.cyan(' 3.') + chalk.yellow(' Configure enabled features via /menu → Project Settings'));
1745
+ console.log(chalk.dim(` Features pending configuration: ${featuresRequiringConfig.map((f) => f.label).join(', ')}`));
1746
+ console.log(chalk.cyan(' 4.') + ' Use any installed command by typing its name (e.g., /e2e-test)');
1747
+ } else {
1748
+ console.log(chalk.cyan(' 3.') + ' Use any installed command by typing its name (e.g., /e2e-test)');
1749
+ }
1750
+
1751
+ console.log('');
1752
+ console.log(chalk.dim(' Customize your setup:'));
1753
+ console.log(chalk.dim(' • Edit agents in .claude/agents/'));
1754
+ console.log(chalk.dim(' • Create skills in .claude/skills/'));
1755
+ console.log(chalk.dim(' • Add hooks in .claude/hooks/'));
1756
+ console.log(chalk.dim(' • Configure tech stack in .claude/config/tech-stack.json'));
1757
+ console.log('');
1758
+ console.log(chalk.dim(` To update: ${chalk.bold('npx claude-cli-advanced-starter-pack init --force')}`));
1759
+ console.log('');
1760
+ }
1761
+
1762
+ /**
1763
+ * Generate INDEX.md file
1764
+ */
1765
+ function generateIndexFile(commands, projectName) {
1766
+ const date = new Date().toISOString().split('T')[0];
1767
+
1768
+ let content = `# ${projectName} - Slash Commands
1769
+
1770
+ > Installed by Claude CLI Advanced Starter Pack v${getVersion()} on ${date}
1771
+
1772
+ ## Quick Start
1773
+
1774
+ Type \`/menu\` to open the interactive project menu.
1775
+
1776
+ ## Available Commands
1777
+
1778
+ | Command | Description |
1779
+ |---------|-------------|
1780
+ `;
1781
+
1782
+ for (const cmdName of commands) {
1783
+ const cmd = AVAILABLE_COMMANDS.find((c) => c.name === cmdName);
1784
+ if (cmd) {
1785
+ content += `| \`/${cmdName}\` | ${cmd.description} |\n`;
1786
+ }
1787
+ }
1788
+
1789
+ content += `
1790
+ ## Project Structure
1791
+
1792
+ \`\`\`
1793
+ .claude/
1794
+ ├── commands/ # Slash commands (you are here)
1795
+ ├── agents/ # Custom agents
1796
+ ├── skills/ # Skill packages
1797
+ ├── hooks/ # Enforcement hooks
1798
+ ├── docs/ # Documentation
1799
+ ├── settings.json
1800
+ └── settings.local.json
1801
+ \`\`\`
1802
+
1803
+ ## Reinstall/Update
1804
+
1805
+ \`\`\`bash
1806
+ npx claude-cli-advanced-starter-pack init --force
1807
+ \`\`\`
1808
+
1809
+ ## Learn More
1810
+
1811
+ - [Claude CLI Advanced Starter Pack on npm](https://www.npmjs.com/package/claude-cli-advanced-starter-pack)
1812
+ - [GitHub Repository](https://github.com/evan043/claude-cli-advanced-starter-pack)
1813
+ `;
1814
+
1815
+ return content;
1816
+ }
1817
+
1818
+ /**
1819
+ * Generate README.md file
1820
+ */
1821
+ function generateReadmeFile(commands, projectName) {
1822
+ const categories = {};
1823
+
1824
+ for (const cmdName of commands) {
1825
+ const cmd = AVAILABLE_COMMANDS.find((c) => c.name === cmdName);
1826
+ if (cmd) {
1827
+ if (!categories[cmd.category]) {
1828
+ categories[cmd.category] = [];
1829
+ }
1830
+ categories[cmd.category].push(cmd);
1831
+ }
1832
+ }
1833
+
1834
+ let content = `# ${projectName} - Slash Commands
1835
+
1836
+ This folder contains Claude Code CLI slash commands installed by Claude CLI Advanced Starter Pack.
1837
+
1838
+ ## Interactive Menu
1839
+
1840
+ Type \`/menu\` to access the interactive ASCII menu with quick access to all commands.
1841
+
1842
+ ## Commands by Category
1843
+
1844
+ `;
1845
+
1846
+ for (const [category, cmds] of Object.entries(categories)) {
1847
+ content += `### ${category}\n\n`;
1848
+ for (const cmd of cmds) {
1849
+ content += `- **/${cmd.name}** - ${cmd.description}\n`;
1850
+ }
1851
+ content += '\n';
1852
+ }
1853
+
1854
+ content += `## How Commands Work
1855
+
1856
+ Each \`.md\` file in this directory is a slash command. When you type \`/command-name\` in Claude Code CLI, Claude reads the corresponding \`.md\` file and follows the instructions.
1857
+
1858
+ ### Command Structure
1859
+
1860
+ \`\`\`markdown
1861
+ ---
1862
+ description: Brief description shown in command list
1863
+ options:
1864
+ - label: "Option 1"
1865
+ description: "What this option does"
1866
+ ---
1867
+
1868
+ # Command Title
1869
+
1870
+ Instructions for Claude to follow when this command is invoked.
1871
+ \`\`\`
1872
+
1873
+ ## Creating Custom Commands
1874
+
1875
+ 1. Create a new \`.md\` file in this directory
1876
+ 2. Add YAML frontmatter with description
1877
+ 3. Write instructions for Claude to follow
1878
+ 4. The command name is the filename (without .md)
1879
+
1880
+ ## Reinstalling
1881
+
1882
+ To reinstall or update commands:
1883
+
1884
+ \`\`\`bash
1885
+ npx claude-cli-advanced-starter-pack init --force
1886
+ \`\`\`
1887
+ `;
1888
+
1889
+ return content;
1890
+ }