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,492 @@
1
+ /**
2
+ * Phased Development Wizard
3
+ *
4
+ * Interactive flow for gathering project information.
5
+ * Auto-detects tech stack - works with ANY codebase.
6
+ */
7
+
8
+ import chalk from 'chalk';
9
+ import inquirer from 'inquirer';
10
+ import { analyzeCodebase, generateStackSummary, displayAnalysisResults } from './codebase-analyzer.js';
11
+ import { calculateProjectScale } from './scale-calculator.js';
12
+
13
+ /**
14
+ * Run the interactive wizard
15
+ */
16
+ export async function runWizard(options = {}) {
17
+ // Step 1: Project Identification
18
+ const projectInfo = await promptProjectInfo(options);
19
+
20
+ // Step 2: Auto-detect tech stack
21
+ const analysis = await analyzeCodebase(process.cwd());
22
+ displayAnalysisResults(analysis);
23
+
24
+ // Step 3: Confirm or override detected stack
25
+ const architecture = await promptArchitectureConfirmation(analysis);
26
+
27
+ // Step 4: Scope Assessment
28
+ const scope = await promptScopeAssessment();
29
+
30
+ // Step 5: Calculate Scale
31
+ const scaleResult = calculateProjectScale(scope);
32
+
33
+ // Step 6: Review and Confirm
34
+ const confirmed = await reviewAndConfirm({
35
+ ...projectInfo,
36
+ scope,
37
+ architecture,
38
+ analysis,
39
+ ...scaleResult,
40
+ });
41
+
42
+ if (!confirmed) {
43
+ return null;
44
+ }
45
+
46
+ return {
47
+ ...projectInfo,
48
+ scope,
49
+ architecture,
50
+ analysis,
51
+ ...scaleResult,
52
+ };
53
+ }
54
+
55
+ /**
56
+ * Step 1: Project Identification
57
+ */
58
+ async function promptProjectInfo(options) {
59
+ console.log(chalk.cyan.bold('\n📋 Step 1: Project Identification\n'));
60
+
61
+ const answers = await inquirer.prompt([
62
+ {
63
+ type: 'input',
64
+ name: 'projectName',
65
+ message: 'Project name (human-readable):',
66
+ default: options.name || '',
67
+ validate: (input) => input.length > 0 || 'Project name is required',
68
+ },
69
+ {
70
+ type: 'input',
71
+ name: 'projectSlug',
72
+ message: 'Project slug (kebab-case):',
73
+ default: (answers) =>
74
+ answers.projectName
75
+ .toLowerCase()
76
+ .replace(/[^a-z0-9]+/g, '-')
77
+ .replace(/^-|-$/g, ''),
78
+ validate: (input) => {
79
+ if (!/^[a-z][a-z0-9-]*$/.test(input)) {
80
+ return 'Use kebab-case (lowercase letters, numbers, hyphens)';
81
+ }
82
+ return true;
83
+ },
84
+ },
85
+ {
86
+ type: 'editor',
87
+ name: 'description',
88
+ message: 'Project description (opens editor):',
89
+ default: 'Describe your project goals and requirements...',
90
+ },
91
+ ]);
92
+
93
+ return answers;
94
+ }
95
+
96
+ /**
97
+ * Step 2: Confirm or override detected architecture
98
+ */
99
+ async function promptArchitectureConfirmation(analysis) {
100
+ console.log(chalk.cyan.bold('\n🏗️ Step 2: Architecture Confirmation\n'));
101
+
102
+ const { useDetected } = await inquirer.prompt([
103
+ {
104
+ type: 'confirm',
105
+ name: 'useDetected',
106
+ message: 'Use detected tech stack?',
107
+ default: analysis.confidence !== 'low',
108
+ },
109
+ ]);
110
+
111
+ if (useDetected && analysis.confidence !== 'low') {
112
+ return buildArchitectureFromAnalysis(analysis);
113
+ }
114
+
115
+ // Manual override
116
+ return await promptManualArchitecture(analysis);
117
+ }
118
+
119
+ /**
120
+ * Build architecture config from analysis
121
+ */
122
+ function buildArchitectureFromAnalysis(analysis) {
123
+ return {
124
+ frontend: analysis.frontend.detected
125
+ ? {
126
+ framework: analysis.frontend.framework,
127
+ language: analysis.frontend.language,
128
+ bundler: analysis.frontend.bundler,
129
+ styling: analysis.frontend.styling,
130
+ }
131
+ : null,
132
+ backend: analysis.backend.detected
133
+ ? {
134
+ framework: analysis.backend.framework,
135
+ language: analysis.backend.language,
136
+ }
137
+ : null,
138
+ database: analysis.database.detected
139
+ ? {
140
+ type: analysis.database.type,
141
+ orm: analysis.database.orm,
142
+ }
143
+ : null,
144
+ testing: analysis.testing.detected
145
+ ? {
146
+ framework: analysis.testing.framework,
147
+ e2e: analysis.testing.e2e,
148
+ }
149
+ : null,
150
+ deployment: analysis.deployment.detected
151
+ ? {
152
+ platform: analysis.deployment.platform,
153
+ containerized: analysis.deployment.containerized,
154
+ }
155
+ : null,
156
+ needsAuth: true, // Will ask separately
157
+ needsRealtime: false,
158
+ summary: generateStackSummary(analysis),
159
+ autoDetected: true,
160
+ };
161
+ }
162
+
163
+ /**
164
+ * Manual architecture selection (when auto-detect fails or user wants to override)
165
+ */
166
+ async function promptManualArchitecture(analysis) {
167
+ console.log(chalk.dim('\nPlease specify your tech stack:\n'));
168
+
169
+ // Frontend
170
+ const { frontendType } = await inquirer.prompt([
171
+ {
172
+ type: 'list',
173
+ name: 'frontendType',
174
+ message: 'Frontend framework:',
175
+ choices: [
176
+ { name: 'React', value: 'react' },
177
+ { name: 'Vue', value: 'vue' },
178
+ { name: 'Angular', value: 'angular' },
179
+ { name: 'Svelte', value: 'svelte' },
180
+ { name: 'Next.js', value: 'nextjs' },
181
+ { name: 'Nuxt', value: 'nuxt' },
182
+ { name: 'Plain HTML/JS', value: 'vanilla' },
183
+ { name: 'No frontend', value: 'none' },
184
+ { name: 'Other', value: 'other' },
185
+ ],
186
+ default: analysis.frontend.framework || 'react',
187
+ },
188
+ ]);
189
+
190
+ let frontendLang = 'javascript';
191
+ if (frontendType !== 'none' && frontendType !== 'vanilla') {
192
+ const { lang } = await inquirer.prompt([
193
+ {
194
+ type: 'list',
195
+ name: 'lang',
196
+ message: 'Frontend language:',
197
+ choices: [
198
+ { name: 'TypeScript', value: 'typescript' },
199
+ { name: 'JavaScript', value: 'javascript' },
200
+ ],
201
+ default: analysis.frontend.language || 'typescript',
202
+ },
203
+ ]);
204
+ frontendLang = lang;
205
+ }
206
+
207
+ // Backend
208
+ const { backendType } = await inquirer.prompt([
209
+ {
210
+ type: 'list',
211
+ name: 'backendType',
212
+ message: 'Backend framework:',
213
+ choices: [
214
+ { name: 'Express.js (Node)', value: 'express' },
215
+ { name: 'Fastify (Node)', value: 'fastify' },
216
+ { name: 'NestJS (Node)', value: 'nestjs' },
217
+ { name: 'FastAPI (Python)', value: 'fastapi' },
218
+ { name: 'Django (Python)', value: 'django' },
219
+ { name: 'Flask (Python)', value: 'flask' },
220
+ { name: 'Rails (Ruby)', value: 'rails' },
221
+ { name: 'Gin (Go)', value: 'gin' },
222
+ { name: 'Actix (Rust)', value: 'actix' },
223
+ { name: 'No backend', value: 'none' },
224
+ { name: 'Other', value: 'other' },
225
+ ],
226
+ default: analysis.backend.framework || 'express',
227
+ },
228
+ ]);
229
+
230
+ // Database
231
+ const { databaseType } = await inquirer.prompt([
232
+ {
233
+ type: 'list',
234
+ name: 'databaseType',
235
+ message: 'Database:',
236
+ choices: [
237
+ { name: 'PostgreSQL', value: 'postgresql' },
238
+ { name: 'MySQL/MariaDB', value: 'mysql' },
239
+ { name: 'MongoDB', value: 'mongodb' },
240
+ { name: 'SQLite', value: 'sqlite' },
241
+ { name: 'Redis (cache/primary)', value: 'redis' },
242
+ { name: 'No database', value: 'none' },
243
+ { name: 'Other', value: 'other' },
244
+ ],
245
+ default: analysis.database.type || 'postgresql',
246
+ },
247
+ ]);
248
+
249
+ // Deployment
250
+ const { deploymentPlatform } = await inquirer.prompt([
251
+ {
252
+ type: 'list',
253
+ name: 'deploymentPlatform',
254
+ message: 'Deployment platform:',
255
+ choices: [
256
+ { name: 'Vercel', value: 'vercel' },
257
+ { name: 'Netlify', value: 'netlify' },
258
+ { name: 'Railway', value: 'railway' },
259
+ { name: 'Fly.io', value: 'fly' },
260
+ { name: 'Render', value: 'render' },
261
+ { name: 'Heroku', value: 'heroku' },
262
+ { name: 'AWS', value: 'aws' },
263
+ { name: 'Google Cloud', value: 'gcp' },
264
+ { name: 'Azure', value: 'azure' },
265
+ { name: 'Cloudflare', value: 'cloudflare' },
266
+ { name: 'Docker/Kubernetes', value: 'kubernetes' },
267
+ { name: 'Self-hosted', value: 'self' },
268
+ { name: 'Not decided yet', value: 'tbd' },
269
+ ],
270
+ default: analysis.deployment.platform || 'vercel',
271
+ },
272
+ ]);
273
+
274
+ // Additional options
275
+ const additionalOptions = await inquirer.prompt([
276
+ {
277
+ type: 'confirm',
278
+ name: 'needsAuth',
279
+ message: 'Requires authentication?',
280
+ default: true,
281
+ },
282
+ {
283
+ type: 'confirm',
284
+ name: 'needsRealtime',
285
+ message: 'Requires real-time updates (WebSocket/SSE)?',
286
+ default: false,
287
+ },
288
+ ]);
289
+
290
+ // Build summary
291
+ const parts = [];
292
+ if (frontendType !== 'none') {
293
+ parts.push(`${frontendType}${frontendLang === 'typescript' ? ' + TS' : ''}`);
294
+ }
295
+ if (backendType !== 'none') {
296
+ parts.push(backendType);
297
+ }
298
+ if (databaseType !== 'none') {
299
+ parts.push(databaseType);
300
+ }
301
+
302
+ return {
303
+ frontend:
304
+ frontendType !== 'none'
305
+ ? { framework: frontendType, language: frontendLang }
306
+ : null,
307
+ backend:
308
+ backendType !== 'none'
309
+ ? {
310
+ framework: backendType,
311
+ language: getBackendLanguage(backendType),
312
+ }
313
+ : null,
314
+ database: databaseType !== 'none' ? { type: databaseType } : null,
315
+ deployment:
316
+ deploymentPlatform !== 'tbd' ? { platform: deploymentPlatform } : null,
317
+ needsAuth: additionalOptions.needsAuth,
318
+ needsRealtime: additionalOptions.needsRealtime,
319
+ summary: parts.join(' | ') || 'Minimal stack',
320
+ autoDetected: false,
321
+ };
322
+ }
323
+
324
+ /**
325
+ * Get backend language from framework
326
+ */
327
+ function getBackendLanguage(framework) {
328
+ const map = {
329
+ express: 'node',
330
+ fastify: 'node',
331
+ nestjs: 'node',
332
+ fastapi: 'python',
333
+ django: 'python',
334
+ flask: 'python',
335
+ rails: 'ruby',
336
+ gin: 'go',
337
+ actix: 'rust',
338
+ axum: 'rust',
339
+ };
340
+ return map[framework] || 'unknown';
341
+ }
342
+
343
+ /**
344
+ * Step 3: Scope Assessment
345
+ */
346
+ async function promptScopeAssessment() {
347
+ console.log(chalk.cyan.bold('\n📊 Step 3: Scope Assessment\n'));
348
+ console.log(chalk.dim('Answer these to help estimate project scale.\n'));
349
+
350
+ const answers = await inquirer.prompt([
351
+ {
352
+ type: 'list',
353
+ name: 'linesOfCode',
354
+ message: 'Estimated lines of code to write/modify:',
355
+ choices: [
356
+ { name: '< 500 lines (small feature)', value: 'small' },
357
+ { name: '500-2000 lines (medium feature)', value: 'medium' },
358
+ { name: '2000-5000 lines (large feature)', value: 'large' },
359
+ { name: '5000+ lines (major overhaul)', value: 'xlarge' },
360
+ ],
361
+ },
362
+ {
363
+ type: 'list',
364
+ name: 'components',
365
+ message: 'Number of components/modules affected:',
366
+ choices: [
367
+ { name: '1-3 components', value: 'few' },
368
+ { name: '4-8 components', value: 'several' },
369
+ { name: '9-15 components', value: 'many' },
370
+ { name: '15+ components', value: 'extensive' },
371
+ ],
372
+ },
373
+ {
374
+ type: 'list',
375
+ name: 'integrations',
376
+ message: 'External integrations required:',
377
+ choices: [
378
+ { name: 'None', value: 'none' },
379
+ { name: '1-2 APIs/services', value: 'few' },
380
+ { name: '3-5 APIs/services', value: 'several' },
381
+ { name: '5+ APIs/services', value: 'many' },
382
+ ],
383
+ },
384
+ {
385
+ type: 'list',
386
+ name: 'familiarity',
387
+ message: 'Familiarity with the codebase area:',
388
+ choices: [
389
+ { name: 'Very familiar (worked on it recently)', value: 'high' },
390
+ { name: 'Somewhat familiar', value: 'medium' },
391
+ { name: 'New area (need to learn)', value: 'low' },
392
+ ],
393
+ },
394
+ ]);
395
+
396
+ return answers;
397
+ }
398
+
399
+ /**
400
+ * Step 4: Review and Confirm
401
+ */
402
+ async function reviewAndConfirm(config) {
403
+ console.log(chalk.cyan.bold('\n📝 Step 4: Review Plan\n'));
404
+
405
+ // Display summary
406
+ console.log(chalk.white.bold('Project:'));
407
+ console.log(` Name: ${chalk.cyan(config.projectName)}`);
408
+ console.log(` Slug: ${chalk.cyan(config.projectSlug)}`);
409
+ console.log('');
410
+
411
+ console.log(chalk.white.bold('Scale Assessment:'));
412
+ console.log(` Scale: ${chalk.yellow(config.scale)} (${config.scaleName})`);
413
+ console.log(` Phases: ${chalk.yellow(config.phases.length)}`);
414
+ console.log(` Estimated Tasks: ${chalk.yellow(config.taskEstimate)}`);
415
+ console.log('');
416
+
417
+ console.log(chalk.white.bold('Phases:'));
418
+ config.phases.forEach((phase, i) => {
419
+ console.log(` ${i + 1}. ${chalk.green(phase.name)} - ${phase.description}`);
420
+ });
421
+ console.log('');
422
+
423
+ console.log(chalk.white.bold('Architecture:'));
424
+ console.log(` Stack: ${chalk.dim(config.architecture.summary)}`);
425
+ console.log(
426
+ ` Auth: ${config.architecture.needsAuth ? chalk.green('Yes') : chalk.dim('No')}`
427
+ );
428
+ console.log(
429
+ ` Realtime: ${config.architecture.needsRealtime ? chalk.green('Yes') : chalk.dim('No')}`
430
+ );
431
+ if (config.architecture.autoDetected) {
432
+ console.log(` ${chalk.dim('(auto-detected from codebase)')}`);
433
+ }
434
+ console.log('');
435
+
436
+ // Confirmation
437
+ const { confirmed } = await inquirer.prompt([
438
+ {
439
+ type: 'confirm',
440
+ name: 'confirmed',
441
+ message: 'Generate phased development plan with these settings?',
442
+ default: true,
443
+ },
444
+ ]);
445
+
446
+ return confirmed;
447
+ }
448
+
449
+ /**
450
+ * Prompt for enhancements
451
+ */
452
+ export async function promptEnhancements() {
453
+ console.log(chalk.cyan.bold('\n⚡ Enhancement Options\n'));
454
+ console.log(chalk.dim('Select optional enhancements for your plan.\n'));
455
+
456
+ const { enhancements } = await inquirer.prompt([
457
+ {
458
+ type: 'checkbox',
459
+ name: 'enhancements',
460
+ message: 'Enable enhancements:',
461
+ choices: [
462
+ {
463
+ name: 'Parallel Execution - Deploy multiple agents for file generation',
464
+ value: 'parallel',
465
+ checked: true,
466
+ },
467
+ {
468
+ name: 'E2E Testing - Generate test definitions for your framework',
469
+ value: 'testing',
470
+ checked: true,
471
+ },
472
+ {
473
+ name: 'Per-Phase Commits - Auto-commit after each phase',
474
+ value: 'commits',
475
+ checked: false,
476
+ },
477
+ {
478
+ name: 'Enforcement Hooks - Generate pattern enforcers',
479
+ value: 'hooks',
480
+ checked: false,
481
+ },
482
+ {
483
+ name: 'GitHub Integration - Create issues for each phase',
484
+ value: 'github',
485
+ checked: false,
486
+ },
487
+ ],
488
+ },
489
+ ]);
490
+
491
+ return enhancements;
492
+ }