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,404 @@
1
+ /**
2
+ * Post-Completion Handler
3
+ *
4
+ * Displays completion summary and "What's Next?" menu.
5
+ * MANDATORY: Never end without showing next steps.
6
+ */
7
+
8
+ import chalk from 'chalk';
9
+ import inquirer from 'inquirer';
10
+ import { readFileSync, existsSync } from 'fs';
11
+ import { join } from 'path';
12
+
13
+ /**
14
+ * Show post-completion handler
15
+ *
16
+ * @param {Object} config - Project configuration
17
+ * @param {Object} results - Generation results
18
+ */
19
+ export async function showPostCompletionHandler(config, results) {
20
+ displayCompletionSummary(config, results);
21
+
22
+ // Loop until user exits
23
+ let continueMenu = true;
24
+ while (continueMenu) {
25
+ continueMenu = await showWhatsNextMenu(config);
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Display completion summary
31
+ */
32
+ function displayCompletionSummary(config, results) {
33
+ const { projectName, projectSlug, scale, phases, taskEstimate } = config;
34
+
35
+ console.log('');
36
+ console.log(chalk.green('═'.repeat(65)));
37
+ console.log(
38
+ chalk.green('ā•‘') +
39
+ chalk.green.bold(' āœ… PLAN GENERATION COMPLETE').padEnd(64) +
40
+ chalk.green('ā•‘')
41
+ );
42
+ console.log(chalk.green('═'.repeat(65)));
43
+ console.log('');
44
+
45
+ console.log(chalk.white.bold('Project Summary:'));
46
+ console.log(` Name: ${chalk.cyan(projectName)}`);
47
+ console.log(` Slug: ${chalk.cyan(projectSlug)}`);
48
+ console.log(` Scale: ${chalk.yellow(scale)} (${config.scaleName})`);
49
+ console.log(` Phases: ${chalk.yellow(phases.length)}`);
50
+ console.log(` Tasks: ${chalk.yellow(taskEstimate)}`);
51
+ console.log(` Success: ${chalk.green('95%+')}`);
52
+ console.log('');
53
+
54
+ console.log(chalk.white.bold('Generated Files:'));
55
+ results.files.slice(0, 5).forEach((file) => {
56
+ console.log(` ${chalk.green('āœ“')} ${file.name}`);
57
+ });
58
+ if (results.files.length > 5) {
59
+ console.log(chalk.dim(` ... and ${results.files.length - 5} more`));
60
+ }
61
+ console.log('');
62
+
63
+ console.log(chalk.white.bold('Key Locations:'));
64
+ console.log(
65
+ ` Docs: ${chalk.dim(`.claude/docs/${projectSlug}/`)}`
66
+ );
67
+ console.log(
68
+ ` Agent: ${chalk.dim(`.claude/agents/${projectSlug}-phase-executor-agent.md`)}`
69
+ );
70
+ console.log(
71
+ ` Command: ${chalk.dim(`.claude/commands/phase-dev-${projectSlug}.md`)}`
72
+ );
73
+ console.log('');
74
+ }
75
+
76
+ /**
77
+ * Show "What's Next?" menu
78
+ *
79
+ * @param {Object} config - Project configuration
80
+ * @returns {boolean} - Whether to continue showing menu
81
+ */
82
+ async function showWhatsNextMenu(config) {
83
+ const { projectSlug, phases } = config;
84
+
85
+ console.log(chalk.cyan.bold('─'.repeat(40)));
86
+ console.log(chalk.cyan.bold(' What\'s Next?'));
87
+ console.log(chalk.cyan.bold('─'.repeat(40)));
88
+ console.log('');
89
+
90
+ const choices = [
91
+ {
92
+ name: `${chalk.green('1)')} Start Phase 1: ${phases[0].name}`,
93
+ value: 'start-phase-1',
94
+ short: 'Start Phase 1',
95
+ },
96
+ {
97
+ name: `${chalk.cyan('2)')} View PROGRESS.json`,
98
+ value: 'view-progress',
99
+ short: 'View Progress',
100
+ },
101
+ {
102
+ name: `${chalk.magenta('3)')} View Executive Summary`,
103
+ value: 'view-summary',
104
+ short: 'View Summary',
105
+ },
106
+ new inquirer.Separator(),
107
+ {
108
+ name: `${chalk.yellow('G)')} Create GitHub Issues (one per phase)`,
109
+ value: 'github-issues',
110
+ short: 'GitHub Issues',
111
+ },
112
+ {
113
+ name: `${chalk.blue('C)')} Run Slash Command: /phase-dev-${projectSlug}`,
114
+ value: 'run-command',
115
+ short: 'Run Command',
116
+ },
117
+ new inquirer.Separator(),
118
+ {
119
+ name: `${chalk.dim('X)')} Exit (show instructions)`,
120
+ value: 'exit',
121
+ short: 'Exit',
122
+ },
123
+ ];
124
+
125
+ const { action } = await inquirer.prompt([
126
+ {
127
+ type: 'list',
128
+ name: 'action',
129
+ message: 'Select an option:',
130
+ choices,
131
+ pageSize: 10,
132
+ },
133
+ ]);
134
+
135
+ console.log('');
136
+
137
+ switch (action) {
138
+ case 'start-phase-1':
139
+ await showPhaseStartInstructions(config, 1);
140
+ return true;
141
+
142
+ case 'view-progress':
143
+ await viewProgressJson(config);
144
+ return true;
145
+
146
+ case 'view-summary':
147
+ await viewExecutiveSummary(config);
148
+ return true;
149
+
150
+ case 'github-issues':
151
+ await showGitHubIssueInstructions(config);
152
+ return true;
153
+
154
+ case 'run-command':
155
+ showCommandInstructions(config);
156
+ return true;
157
+
158
+ case 'exit':
159
+ showExitInstructions(config);
160
+ return false;
161
+
162
+ default:
163
+ return false;
164
+ }
165
+ }
166
+
167
+ /**
168
+ * Show phase start instructions
169
+ */
170
+ async function showPhaseStartInstructions(config, phaseNum) {
171
+ const { projectSlug, phases } = config;
172
+ const phase = phases[phaseNum - 1];
173
+
174
+ console.log(chalk.cyan.bold(`\nšŸš€ Starting Phase ${phaseNum}: ${phase.name}\n`));
175
+
176
+ console.log(chalk.white.bold('Tasks in this phase:'));
177
+ phase.tasks.forEach((task, i) => {
178
+ console.log(` ${i + 1}. ${task.title}`);
179
+ });
180
+ console.log('');
181
+
182
+ console.log(chalk.white.bold('To begin:'));
183
+ console.log(chalk.yellow(`\n /phase-dev-${projectSlug} ${phaseNum}\n`));
184
+ console.log(
185
+ chalk.dim('Or tell Claude: "Start Phase 1 of ' + config.projectName + '"')
186
+ );
187
+ console.log('');
188
+
189
+ await inquirer.prompt([
190
+ {
191
+ type: 'input',
192
+ name: 'continue',
193
+ message: chalk.dim('Press Enter to continue...'),
194
+ },
195
+ ]);
196
+ }
197
+
198
+ /**
199
+ * View PROGRESS.json
200
+ */
201
+ async function viewProgressJson(config) {
202
+ const { projectSlug } = config;
203
+ const progressPath = join(
204
+ process.cwd(),
205
+ '.claude',
206
+ 'docs',
207
+ projectSlug,
208
+ 'PROGRESS.json'
209
+ );
210
+
211
+ if (existsSync(progressPath)) {
212
+ const content = readFileSync(progressPath, 'utf8');
213
+ const progress = JSON.parse(content);
214
+
215
+ console.log(chalk.cyan.bold('\nšŸ“Š PROGRESS.json Overview\n'));
216
+
217
+ console.log(chalk.white.bold('Project:'), progress.project.name);
218
+ console.log(chalk.white.bold('Scale:'), progress.project.scale);
219
+ console.log('');
220
+
221
+ console.log(chalk.white.bold('Phases:'));
222
+ progress.phases.forEach((phase) => {
223
+ const statusColor =
224
+ phase.status === 'completed'
225
+ ? chalk.green
226
+ : phase.status === 'in_progress'
227
+ ? chalk.yellow
228
+ : chalk.dim;
229
+ const tasksDone = phase.tasks.filter(
230
+ (t) => t.status === 'completed'
231
+ ).length;
232
+ console.log(
233
+ ` ${statusColor('ā—')} Phase ${phase.id}: ${phase.name} ` +
234
+ chalk.dim(`(${tasksDone}/${phase.tasks.length} tasks)`)
235
+ );
236
+ });
237
+ console.log('');
238
+
239
+ console.log(chalk.dim(`Full file: ${progressPath}`));
240
+ } else {
241
+ console.log(chalk.yellow('PROGRESS.json not found'));
242
+ }
243
+
244
+ console.log('');
245
+ await inquirer.prompt([
246
+ {
247
+ type: 'input',
248
+ name: 'continue',
249
+ message: chalk.dim('Press Enter to continue...'),
250
+ },
251
+ ]);
252
+ }
253
+
254
+ /**
255
+ * View Executive Summary
256
+ */
257
+ async function viewExecutiveSummary(config) {
258
+ const { projectSlug } = config;
259
+ const summaryPath = join(
260
+ process.cwd(),
261
+ '.claude',
262
+ 'docs',
263
+ projectSlug,
264
+ 'EXECUTIVE_SUMMARY.md'
265
+ );
266
+
267
+ if (existsSync(summaryPath)) {
268
+ const content = readFileSync(summaryPath, 'utf8');
269
+
270
+ console.log(chalk.cyan.bold('\nšŸ“„ Executive Summary (preview)\n'));
271
+
272
+ // Show first 30 lines
273
+ const lines = content.split('\n').slice(0, 30);
274
+ lines.forEach((line) => {
275
+ if (line.startsWith('#')) {
276
+ console.log(chalk.cyan.bold(line));
277
+ } else if (line.startsWith('|')) {
278
+ console.log(chalk.dim(line));
279
+ } else {
280
+ console.log(line);
281
+ }
282
+ });
283
+
284
+ if (content.split('\n').length > 30) {
285
+ console.log(chalk.dim('\n... (truncated)'));
286
+ }
287
+
288
+ console.log('');
289
+ console.log(chalk.dim(`Full file: ${summaryPath}`));
290
+ } else {
291
+ console.log(chalk.yellow('EXECUTIVE_SUMMARY.md not found'));
292
+ }
293
+
294
+ console.log('');
295
+ await inquirer.prompt([
296
+ {
297
+ type: 'input',
298
+ name: 'continue',
299
+ message: chalk.dim('Press Enter to continue...'),
300
+ },
301
+ ]);
302
+ }
303
+
304
+ /**
305
+ * Show GitHub issue creation instructions
306
+ */
307
+ async function showGitHubIssueInstructions(config) {
308
+ const { projectName, projectSlug, phases } = config;
309
+
310
+ console.log(chalk.cyan.bold('\nšŸ“‹ GitHub Issue Creation\n'));
311
+
312
+ console.log(chalk.white.bold('To create issues for each phase:'));
313
+ console.log('');
314
+
315
+ console.log(chalk.yellow('Option 1: Use gtask create'));
316
+ console.log(chalk.dim(' For each phase, run:'));
317
+ phases.forEach((phase, i) => {
318
+ console.log(
319
+ chalk.dim(` gtask create -t "${projectName}: Phase ${i + 1} - ${phase.name}"`)
320
+ );
321
+ });
322
+ console.log('');
323
+
324
+ console.log(chalk.yellow('Option 2: Use gh CLI directly'));
325
+ phases.forEach((phase, i) => {
326
+ console.log(
327
+ chalk.dim(
328
+ ` gh issue create --title "${projectName}: Phase ${i + 1} - ${phase.name}" --body "See .claude/docs/${projectSlug}/PROGRESS.json"`
329
+ )
330
+ );
331
+ });
332
+ console.log('');
333
+
334
+ console.log(chalk.yellow('Option 3: Tell Claude'));
335
+ console.log(
336
+ chalk.dim(
337
+ ` "Create GitHub issues for each phase of ${projectName}"`
338
+ )
339
+ );
340
+
341
+ console.log('');
342
+ await inquirer.prompt([
343
+ {
344
+ type: 'input',
345
+ name: 'continue',
346
+ message: chalk.dim('Press Enter to continue...'),
347
+ },
348
+ ]);
349
+ }
350
+
351
+ /**
352
+ * Show command instructions
353
+ */
354
+ function showCommandInstructions(config) {
355
+ const { projectSlug } = config;
356
+
357
+ console.log(chalk.cyan.bold('\nšŸ’» Slash Command Usage\n'));
358
+
359
+ console.log(chalk.white.bold('In Claude Code, run:'));
360
+ console.log(chalk.yellow(`\n /phase-dev-${projectSlug}\n`));
361
+
362
+ console.log(chalk.white.bold('Or with phase number:'));
363
+ console.log(chalk.yellow(` /phase-dev-${projectSlug} 1`));
364
+ console.log(chalk.yellow(` /phase-dev-${projectSlug} status`));
365
+ console.log('');
366
+
367
+ console.log(
368
+ chalk.dim(`Command file: .claude/commands/phase-dev-${projectSlug}.md`)
369
+ );
370
+ console.log('');
371
+ }
372
+
373
+ /**
374
+ * Show exit instructions
375
+ */
376
+ function showExitInstructions(config) {
377
+ const { projectName, projectSlug } = config;
378
+
379
+ console.log(chalk.cyan.bold('\nšŸ“ Quick Reference\n'));
380
+
381
+ console.log(chalk.white.bold('Start development:'));
382
+ console.log(chalk.yellow(` /phase-dev-${projectSlug}`));
383
+ console.log('');
384
+
385
+ console.log(chalk.white.bold('Check progress:'));
386
+ console.log(
387
+ chalk.dim(` cat .claude/docs/${projectSlug}/PROGRESS.json | jq '.phases[] | {name, status}'`)
388
+ );
389
+ console.log('');
390
+
391
+ console.log(chalk.white.bold('View documentation:'));
392
+ console.log(chalk.dim(` .claude/docs/${projectSlug}/EXECUTIVE_SUMMARY.md`));
393
+ console.log(chalk.dim(` .claude/docs/${projectSlug}/PROGRESS.json`));
394
+ console.log('');
395
+
396
+ console.log(chalk.white.bold('Agent executor:'));
397
+ console.log(chalk.dim(` .claude/agents/${projectSlug}-phase-executor-agent.md`));
398
+ console.log('');
399
+
400
+ console.log(chalk.green.bold('─'.repeat(40)));
401
+ console.log(chalk.green(` Good luck with ${projectName}!`));
402
+ console.log(chalk.green.bold('─'.repeat(40)));
403
+ console.log('');
404
+ }