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,344 @@
1
+ /**
2
+ * Scale Calculator
3
+ *
4
+ * Determines project scale (S/M/L) based on scope assessment.
5
+ * Generates appropriate phase structure - works with ANY tech stack.
6
+ */
7
+
8
+ import {
9
+ SCALE_DEFINITIONS,
10
+ SMALL_PHASE_TEMPLATES,
11
+ MEDIUM_PHASE_TEMPLATES,
12
+ LARGE_PHASE_TEMPLATES,
13
+ } from '../../agents/phase-dev-templates.js';
14
+
15
+ /**
16
+ * Score mapping for scope assessment
17
+ */
18
+ const SCORE_MAP = {
19
+ linesOfCode: {
20
+ small: 1,
21
+ medium: 2,
22
+ large: 3,
23
+ xlarge: 4,
24
+ },
25
+ components: {
26
+ few: 1,
27
+ several: 2,
28
+ many: 3,
29
+ extensive: 4,
30
+ },
31
+ integrations: {
32
+ none: 0,
33
+ few: 1,
34
+ several: 2,
35
+ many: 3,
36
+ },
37
+ familiarity: {
38
+ high: 0,
39
+ medium: 1,
40
+ low: 2,
41
+ },
42
+ };
43
+
44
+ /**
45
+ * Calculate project scale from scope assessment
46
+ *
47
+ * @param {Object} scope - Scope assessment answers
48
+ * @returns {Object} Scale result with phases
49
+ */
50
+ export function calculateProjectScale(scope) {
51
+ // Calculate score
52
+ let score = 0;
53
+ score += SCORE_MAP.linesOfCode[scope.linesOfCode] || 2;
54
+ score += SCORE_MAP.components[scope.components] || 2;
55
+ score += SCORE_MAP.integrations[scope.integrations] || 1;
56
+ score += SCORE_MAP.familiarity[scope.familiarity] || 1;
57
+
58
+ // Determine scale
59
+ // 0-4 → S | 5-8 → M | 9+ → L
60
+ let scale, scaleName, phaseTemplates;
61
+
62
+ if (score <= 4) {
63
+ scale = 'S';
64
+ scaleName = 'Small';
65
+ phaseTemplates = SMALL_PHASE_TEMPLATES;
66
+ } else if (score <= 8) {
67
+ scale = 'M';
68
+ scaleName = 'Medium';
69
+ phaseTemplates = MEDIUM_PHASE_TEMPLATES;
70
+ } else {
71
+ scale = 'L';
72
+ scaleName = 'Large';
73
+ phaseTemplates = LARGE_PHASE_TEMPLATES;
74
+ }
75
+
76
+ // Generate phases from templates
77
+ const phases = generatePhases(phaseTemplates, scope);
78
+
79
+ // Calculate task estimate
80
+ const taskEstimate = phases.reduce((sum, p) => sum + p.tasks.length, 0);
81
+
82
+ return {
83
+ scale,
84
+ scaleName,
85
+ score,
86
+ phases,
87
+ taskEstimate,
88
+ scaleDefinition: SCALE_DEFINITIONS[scale],
89
+ };
90
+ }
91
+
92
+ /**
93
+ * Generate phases from templates
94
+ */
95
+ function generatePhases(templates, scope) {
96
+ return templates.map((template, idx) => {
97
+ // Generate tasks from task templates
98
+ const tasks = template.taskTemplates.map((taskTitle) => ({
99
+ title: taskTitle,
100
+ description: `Implement: ${taskTitle.toLowerCase()}`,
101
+ status: 'pending',
102
+ files: [],
103
+ acceptanceCriteria: generateAcceptanceCriteria(taskTitle),
104
+ }));
105
+
106
+ // Add scope-specific tasks
107
+ if (idx === 0 && scope.integrations !== 'none') {
108
+ tasks.push({
109
+ title: 'Set up external integrations',
110
+ description: 'Configure required API connections',
111
+ status: 'pending',
112
+ files: [],
113
+ acceptanceCriteria: ['API connections configured', 'Integration tested'],
114
+ });
115
+ }
116
+
117
+ return {
118
+ name: template.name,
119
+ description: template.description,
120
+ tasks,
121
+ prerequisites: idx > 0 ? [`Phase ${idx} complete`] : [],
122
+ validationCriteria: generateValidationCriteria(template.name, idx),
123
+ tests: [],
124
+ };
125
+ });
126
+ }
127
+
128
+ /**
129
+ * Generate acceptance criteria based on task title (generic)
130
+ */
131
+ function generateAcceptanceCriteria(taskTitle) {
132
+ const titleLower = taskTitle.toLowerCase();
133
+
134
+ if (titleLower.includes('database') || titleLower.includes('schema') || titleLower.includes('data layer')) {
135
+ return [
136
+ 'Database schema created',
137
+ 'Migrations run successfully',
138
+ 'Data access layer implemented',
139
+ ];
140
+ }
141
+
142
+ if (titleLower.includes('api') || titleLower.includes('endpoint')) {
143
+ return [
144
+ 'Endpoints respond correctly',
145
+ 'Error handling implemented',
146
+ 'API documented',
147
+ ];
148
+ }
149
+
150
+ if (titleLower.includes('ui') || titleLower.includes('component')) {
151
+ return [
152
+ 'Component renders correctly',
153
+ 'Responsive design verified',
154
+ 'Accessibility checked',
155
+ ];
156
+ }
157
+
158
+ if (titleLower.includes('test')) {
159
+ return [
160
+ 'Tests pass',
161
+ 'Coverage meets target',
162
+ 'Edge cases handled',
163
+ ];
164
+ }
165
+
166
+ if (titleLower.includes('deploy')) {
167
+ return [
168
+ 'Deployment successful',
169
+ 'Health checks pass',
170
+ 'No regressions',
171
+ ];
172
+ }
173
+
174
+ if (titleLower.includes('integration')) {
175
+ return [
176
+ 'Components connected',
177
+ 'Data flows correctly',
178
+ 'Integration tested',
179
+ ];
180
+ }
181
+
182
+ // Default criteria (generic)
183
+ return [
184
+ 'Implementation complete',
185
+ 'Code reviewed',
186
+ 'No build errors',
187
+ ];
188
+ }
189
+
190
+ /**
191
+ * Generate validation criteria for a phase (generic)
192
+ */
193
+ function generateValidationCriteria(phaseName, phaseIndex) {
194
+ const criteria = ['All tasks complete', 'No blocking issues'];
195
+
196
+ const nameLower = phaseName.toLowerCase();
197
+
198
+ if (nameLower.includes('foundation') || nameLower.includes('architecture')) {
199
+ criteria.push(
200
+ 'Project structure established',
201
+ 'Development environment working',
202
+ 'Core architecture defined'
203
+ );
204
+ }
205
+
206
+ if (nameLower.includes('api') || nameLower.includes('data')) {
207
+ criteria.push(
208
+ 'Endpoints documented',
209
+ 'Data layer tested',
210
+ 'Error handling complete'
211
+ );
212
+ }
213
+
214
+ if (nameLower.includes('ui') || nameLower.includes('feature') || nameLower.includes('core')) {
215
+ criteria.push(
216
+ 'Components render correctly',
217
+ 'No console errors',
218
+ 'User flows complete'
219
+ );
220
+ }
221
+
222
+ if (nameLower.includes('integration')) {
223
+ criteria.push(
224
+ 'E2E tests pass',
225
+ 'Performance acceptable',
226
+ 'No regressions'
227
+ );
228
+ }
229
+
230
+ if (nameLower.includes('deploy') || nameLower.includes('launch')) {
231
+ criteria.push(
232
+ 'Deployment successful',
233
+ 'Monitoring configured',
234
+ 'Documentation updated'
235
+ );
236
+ }
237
+
238
+ if (nameLower.includes('polish')) {
239
+ criteria.push(
240
+ 'UI/UX review complete',
241
+ 'Performance optimized',
242
+ 'Accessibility checked'
243
+ );
244
+ }
245
+
246
+ return criteria;
247
+ }
248
+
249
+ /**
250
+ * Adjust scale based on enhancements
251
+ */
252
+ export function adjustForEnhancements(scaleResult, enhancements) {
253
+ const adjusted = { ...scaleResult };
254
+
255
+ // Add tasks for testing enhancement
256
+ if (enhancements.includes('testing')) {
257
+ adjusted.phases = adjusted.phases.map((phase) => ({
258
+ ...phase,
259
+ tasks: [
260
+ ...phase.tasks,
261
+ {
262
+ title: `Write tests for ${phase.name}`,
263
+ description: 'Create tests for this phase',
264
+ status: 'pending',
265
+ files: [],
266
+ acceptanceCriteria: ['Tests written', 'Coverage acceptable'],
267
+ testType: 'unit',
268
+ },
269
+ ],
270
+ }));
271
+ }
272
+
273
+ // Add E2E phase for large projects with testing
274
+ if (scaleResult.scale === 'L' && enhancements.includes('testing')) {
275
+ const lastPhase = adjusted.phases[adjusted.phases.length - 1];
276
+ if (!lastPhase.name.toLowerCase().includes('e2e')) {
277
+ adjusted.phases.push({
278
+ name: 'E2E Validation',
279
+ description: 'End-to-end testing and validation',
280
+ tasks: [
281
+ {
282
+ title: 'Run full E2E test suite',
283
+ description: 'Execute all end-to-end tests',
284
+ status: 'pending',
285
+ files: [],
286
+ acceptanceCriteria: ['All E2E tests pass', 'No flaky tests'],
287
+ testType: 'e2e',
288
+ },
289
+ {
290
+ title: 'Performance validation',
291
+ description: 'Run performance benchmarks',
292
+ status: 'pending',
293
+ files: [],
294
+ acceptanceCriteria: ['Load times acceptable', 'No memory leaks'],
295
+ },
296
+ ],
297
+ prerequisites: [`Phase ${adjusted.phases.length} complete`],
298
+ validationCriteria: ['E2E tests pass', 'Performance acceptable'],
299
+ tests: [],
300
+ });
301
+ }
302
+ }
303
+
304
+ // Recalculate task estimate
305
+ adjusted.taskEstimate = adjusted.phases.reduce(
306
+ (sum, p) => sum + p.tasks.length,
307
+ 0
308
+ );
309
+
310
+ return adjusted;
311
+ }
312
+
313
+ /**
314
+ * Force a specific scale (bypass calculation)
315
+ */
316
+ export function forceScale(scale, scope = {}) {
317
+ let phaseTemplates;
318
+
319
+ switch (scale.toUpperCase()) {
320
+ case 'S':
321
+ phaseTemplates = SMALL_PHASE_TEMPLATES;
322
+ break;
323
+ case 'M':
324
+ phaseTemplates = MEDIUM_PHASE_TEMPLATES;
325
+ break;
326
+ case 'L':
327
+ phaseTemplates = LARGE_PHASE_TEMPLATES;
328
+ break;
329
+ default:
330
+ throw new Error(`Invalid scale: ${scale}. Use S, M, or L.`);
331
+ }
332
+
333
+ const phases = generatePhases(phaseTemplates, scope);
334
+ const taskEstimate = phases.reduce((sum, p) => sum + p.tasks.length, 0);
335
+
336
+ return {
337
+ scale: scale.toUpperCase(),
338
+ scaleName: SCALE_DEFINITIONS[scale.toUpperCase()].name,
339
+ score: -1, // Indicates forced
340
+ phases,
341
+ taskEstimate,
342
+ scaleDefinition: SCALE_DEFINITIONS[scale.toUpperCase()],
343
+ };
344
+ }