claude-cli-advanced-starter-pack 1.1.0 → 1.8.1

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 (56) hide show
  1. package/OVERVIEW.md +5 -1
  2. package/README.md +241 -132
  3. package/bin/gtask.js +53 -0
  4. package/package.json +1 -1
  5. package/src/cli/menu.js +27 -0
  6. package/src/commands/explore-mcp/mcp-registry.js +99 -0
  7. package/src/commands/init.js +339 -351
  8. package/src/commands/install-panel-hook.js +108 -0
  9. package/src/commands/install-scripts.js +232 -0
  10. package/src/commands/install-skill.js +220 -0
  11. package/src/commands/panel.js +297 -0
  12. package/src/commands/setup-wizard.js +4 -3
  13. package/src/commands/test-setup.js +4 -5
  14. package/src/data/releases.json +164 -0
  15. package/src/panel/queue.js +188 -0
  16. package/templates/commands/ask-claude.template.md +118 -0
  17. package/templates/commands/ccasp-panel.template.md +72 -0
  18. package/templates/commands/ccasp-setup.template.md +470 -79
  19. package/templates/commands/create-smoke-test.template.md +186 -0
  20. package/templates/commands/project-impl.template.md +9 -113
  21. package/templates/commands/refactor-check.template.md +112 -0
  22. package/templates/commands/refactor-cleanup.template.md +144 -0
  23. package/templates/commands/refactor-prep.template.md +192 -0
  24. package/templates/docs/AI_ARCHITECTURE_CONSTITUTION.template.md +198 -0
  25. package/templates/docs/DETAILED_GOTCHAS.template.md +347 -0
  26. package/templates/docs/PHASE-DEV-CHECKLIST.template.md +241 -0
  27. package/templates/docs/PROGRESS_JSON_TEMPLATE.json +117 -0
  28. package/templates/docs/background-agent.template.md +264 -0
  29. package/templates/hooks/autonomous-decision-logger.template.js +207 -0
  30. package/templates/hooks/branch-merge-checker.template.js +272 -0
  31. package/templates/hooks/git-commit-tracker.template.js +267 -0
  32. package/templates/hooks/issue-completion-detector.template.js +205 -0
  33. package/templates/hooks/panel-queue-reader.template.js +83 -0
  34. package/templates/hooks/phase-validation-gates.template.js +307 -0
  35. package/templates/hooks/session-id-generator.template.js +236 -0
  36. package/templates/hooks/token-usage-monitor.template.js +193 -0
  37. package/templates/patterns/README.md +129 -0
  38. package/templates/patterns/l1-l2-orchestration.md +189 -0
  39. package/templates/patterns/multi-phase-orchestration.md +258 -0
  40. package/templates/patterns/two-tier-query-pipeline.md +192 -0
  41. package/templates/scripts/README.md +109 -0
  42. package/templates/scripts/analyze-delegation-log.js +299 -0
  43. package/templates/scripts/autonomous-decision-logger.js +277 -0
  44. package/templates/scripts/git-history-analyzer.py +269 -0
  45. package/templates/scripts/phase-validation-gates.js +307 -0
  46. package/templates/scripts/poll-deployment-status.js +260 -0
  47. package/templates/scripts/roadmap-scanner.js +263 -0
  48. package/templates/scripts/validate-deployment.js +293 -0
  49. package/templates/skills/agent-creator/skill.json +18 -0
  50. package/templates/skills/agent-creator/skill.md +335 -0
  51. package/templates/skills/hook-creator/skill.json +18 -0
  52. package/templates/skills/hook-creator/skill.md +318 -0
  53. package/templates/skills/panel/skill.json +18 -0
  54. package/templates/skills/panel/skill.md +90 -0
  55. package/templates/skills/rag-agent-creator/skill.json +18 -0
  56. package/templates/skills/rag-agent-creator/skill.md +307 -0
@@ -0,0 +1,258 @@
1
+ # Multi-Phase Orchestration Pattern
2
+
3
+ Sequential phase execution with parallel agents within phases.
4
+
5
+ ## Overview
6
+
7
+ Organizes work into distinct phases where:
8
+ - Phases execute sequentially (each depends on previous)
9
+ - Tasks within a phase can run in parallel
10
+ - Validation gates between phases ensure quality
11
+
12
+ ## When to Use
13
+
14
+ - Large projects with natural phase boundaries
15
+ - Work that must be done in a specific order
16
+ - Need for validation between major steps
17
+
18
+ ## Architecture
19
+
20
+ ```
21
+ ┌─────────────────────────────────────────────────────────────┐
22
+ │ L1 Controller │
23
+ └─────────────────────────────────────────────────────────────┘
24
+
25
+ ┌─────────────────────────────────────────────────────────────┐
26
+ │ Phase 1: Discovery │
27
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
28
+ │ │ Agent A │ │ Agent B │ │ Agent C │ (parallel) │
29
+ │ └──────────┘ └──────────┘ └──────────┘ │
30
+ │ ↓ Validation Gate │
31
+ └─────────────────────────────────────────────────────────────┘
32
+
33
+ ┌─────────────────────────────────────────────────────────────┐
34
+ │ Phase 2: Implementation │
35
+ │ ┌──────────┐ ┌──────────┐ │
36
+ │ │ Agent D │ │ Agent E │ (parallel) │
37
+ │ └──────────┘ └──────────┘ │
38
+ │ ↓ Validation Gate │
39
+ └─────────────────────────────────────────────────────────────┘
40
+
41
+ ┌─────────────────────────────────────────────────────────────┐
42
+ │ Phase 3: Testing │
43
+ │ ┌──────────┐ │
44
+ │ │ Agent F │ (sequential - needs all results) │
45
+ │ └──────────┘ │
46
+ └─────────────────────────────────────────────────────────────┘
47
+ ```
48
+
49
+ ## Implementation
50
+
51
+ ### Phase Controller
52
+
53
+ ```typescript
54
+ interface Phase {
55
+ id: string;
56
+ name: string;
57
+ tasks: Task[];
58
+ validation: ValidationGate;
59
+ parallel: boolean;
60
+ }
61
+
62
+ async function executePhases(phases: Phase[]): Promise<PhaseResults> {
63
+ const results: PhaseResult[] = [];
64
+ let context = {}; // Accumulates data across phases
65
+
66
+ for (const phase of phases) {
67
+ console.log(`Starting Phase ${phase.id}: ${phase.name}`);
68
+
69
+ // Execute phase tasks
70
+ const phaseResult = phase.parallel
71
+ ? await executeParallel(phase.tasks, context)
72
+ : await executeSequential(phase.tasks, context);
73
+
74
+ // Run validation gate
75
+ const validation = await phase.validation.check(phaseResult);
76
+
77
+ if (!validation.passed) {
78
+ return {
79
+ completed: results,
80
+ failed: phase,
81
+ reason: validation.reason,
82
+ context
83
+ };
84
+ }
85
+
86
+ // Update context with phase results
87
+ context = { ...context, [phase.id]: phaseResult };
88
+ results.push({ phase, result: phaseResult, validation });
89
+ }
90
+
91
+ return { completed: results, context };
92
+ }
93
+ ```
94
+
95
+ ### Parallel Task Execution
96
+
97
+ ```typescript
98
+ async function executeParallel(tasks: Task[], context: Context) {
99
+ // Prepare prompts with context
100
+ const preparedTasks = tasks.map(task => ({
101
+ ...task,
102
+ prompt: injectContext(task.prompt, context)
103
+ }));
104
+
105
+ // Launch all in parallel
106
+ const agents = preparedTasks.map(task => Task({
107
+ description: task.title,
108
+ prompt: task.prompt,
109
+ subagent_type: task.type,
110
+ run_in_background: true
111
+ }));
112
+
113
+ const handles = await Promise.all(agents);
114
+
115
+ // Wait for all to complete
116
+ return Promise.all(handles.map(waitForCompletion));
117
+ }
118
+ ```
119
+
120
+ ### Validation Gates
121
+
122
+ ```typescript
123
+ const validationGates = {
124
+ discovery: {
125
+ async check(results) {
126
+ // Verify all files were found
127
+ const allFilesFound = results.every(r => r.files?.length > 0);
128
+
129
+ // Verify no critical errors
130
+ const noErrors = results.every(r => !r.error);
131
+
132
+ return {
133
+ passed: allFilesFound && noErrors,
134
+ reason: !allFilesFound ? 'Missing required files' :
135
+ !noErrors ? 'Errors during discovery' : null
136
+ };
137
+ }
138
+ },
139
+
140
+ implementation: {
141
+ async check(results) {
142
+ // Run tests on new code
143
+ const testResult = await runTests();
144
+
145
+ // Check for type errors
146
+ const typeCheck = await runTypeCheck();
147
+
148
+ return {
149
+ passed: testResult.passing && typeCheck.clean,
150
+ reason: !testResult.passing ? `${testResult.failed} tests failed` :
151
+ !typeCheck.clean ? `${typeCheck.errors} type errors` : null
152
+ };
153
+ }
154
+ }
155
+ };
156
+ ```
157
+
158
+ ## Complete Example
159
+
160
+ ```typescript
161
+ // Project: Implement new feature with testing
162
+
163
+ const phases: Phase[] = [
164
+ {
165
+ id: 'discovery',
166
+ name: 'Codebase Discovery',
167
+ parallel: true,
168
+ tasks: [
169
+ { title: 'Find related components', type: 'Explore', ... },
170
+ { title: 'Find API endpoints', type: 'Explore', ... },
171
+ { title: 'Find existing tests', type: 'Explore', ... }
172
+ ],
173
+ validation: validationGates.discovery
174
+ },
175
+ {
176
+ id: 'planning',
177
+ name: 'Implementation Planning',
178
+ parallel: false, // Sequential - needs discovery results
179
+ tasks: [
180
+ { title: 'Design component structure', type: 'Plan', ... },
181
+ { title: 'Design API changes', type: 'Plan', ... }
182
+ ],
183
+ validation: validationGates.planning
184
+ },
185
+ {
186
+ id: 'implementation',
187
+ name: 'Code Implementation',
188
+ parallel: true, // Independent components
189
+ tasks: [
190
+ { title: 'Implement component', type: 'general-purpose', ... },
191
+ { title: 'Implement API', type: 'general-purpose', ... }
192
+ ],
193
+ validation: validationGates.implementation
194
+ },
195
+ {
196
+ id: 'testing',
197
+ name: 'Testing & Validation',
198
+ parallel: false,
199
+ tasks: [
200
+ { title: 'Write unit tests', type: 'general-purpose', ... },
201
+ { title: 'Run E2E tests', type: 'Bash', ... }
202
+ ],
203
+ validation: validationGates.testing
204
+ }
205
+ ];
206
+
207
+ // Execute
208
+ const result = await executePhases(phases);
209
+ ```
210
+
211
+ ## State Management
212
+
213
+ ### PROGRESS.json Integration
214
+
215
+ ```json
216
+ {
217
+ "current_phase": 2,
218
+ "phases": [
219
+ {
220
+ "id": "discovery",
221
+ "status": "complete",
222
+ "tasks": [...],
223
+ "validation": { "passed": true }
224
+ },
225
+ {
226
+ "id": "implementation",
227
+ "status": "in_progress",
228
+ "tasks": [...],
229
+ "validation": null
230
+ }
231
+ ]
232
+ }
233
+ ```
234
+
235
+ ### Checkpoint Recovery
236
+
237
+ ```typescript
238
+ async function resumeFromCheckpoint(progressPath: string) {
239
+ const progress = JSON.parse(await readFile(progressPath));
240
+
241
+ // Find incomplete phase
242
+ const incompleteIndex = progress.phases.findIndex(
243
+ p => p.status !== 'complete'
244
+ );
245
+
246
+ // Resume from that phase
247
+ return executePhases(
248
+ progress.phases.slice(incompleteIndex),
249
+ progress.context
250
+ );
251
+ }
252
+ ```
253
+
254
+ ## Related Patterns
255
+
256
+ - L1→L2 Orchestration
257
+ - Phase Validation Gates
258
+ - Two-Tier Query Pipeline
@@ -0,0 +1,192 @@
1
+ # Two-Tier Query Pipeline Pattern
2
+
3
+ Intent classification followed by specialized execution.
4
+
5
+ ## Overview
6
+
7
+ A two-tier architecture that separates:
8
+ 1. **Tier 1**: Intent classification (what kind of request is this?)
9
+ 2. **Tier 2**: Specialized execution (handle based on intent)
10
+
11
+ ## When to Use
12
+
13
+ - Multiple types of requests need different handling
14
+ - Request routing is complex
15
+ - You want to add new handlers without changing core logic
16
+
17
+ ## Architecture
18
+
19
+ ```
20
+ User Request
21
+
22
+ ┌──────────────────────┐
23
+ │ Tier 1: Classifier │ (Fast, lightweight)
24
+ │ - Parse intent │
25
+ │ - Extract entities │
26
+ │ - Route to handler │
27
+ └──────────────────────┘
28
+
29
+ ┌──────────────────────┐
30
+ │ Tier 2: Handler │ (Specialized, thorough)
31
+ │ - Execute task │
32
+ │ - Return result │
33
+ └──────────────────────┘
34
+ ```
35
+
36
+ ## Implementation
37
+
38
+ ### Tier 1: Classifier
39
+
40
+ ```typescript
41
+ interface ClassificationResult {
42
+ intent: string;
43
+ confidence: number;
44
+ entities: Record<string, string>;
45
+ handler: string;
46
+ }
47
+
48
+ async function classifyIntent(request: string): Promise<ClassificationResult> {
49
+ // Pattern matching for common intents
50
+ const patterns = {
51
+ 'create': /create|add|new|make/i,
52
+ 'read': /get|show|list|find|search/i,
53
+ 'update': /update|edit|modify|change/i,
54
+ 'delete': /delete|remove|destroy/i,
55
+ 'analyze': /analyze|check|review|audit/i
56
+ };
57
+
58
+ for (const [intent, pattern] of Object.entries(patterns)) {
59
+ if (pattern.test(request)) {
60
+ return {
61
+ intent,
62
+ confidence: 0.8,
63
+ entities: extractEntities(request),
64
+ handler: `${intent}Handler`
65
+ };
66
+ }
67
+ }
68
+
69
+ return { intent: 'unknown', confidence: 0.5, entities: {}, handler: 'fallbackHandler' };
70
+ }
71
+ ```
72
+
73
+ ### Tier 2: Handlers
74
+
75
+ ```typescript
76
+ const handlers = {
77
+ createHandler: async (entities) => {
78
+ // Launch specialized creation agent
79
+ return Task({
80
+ description: `Create ${entities.type}`,
81
+ prompt: `Create a new ${entities.type} with: ${JSON.stringify(entities)}`,
82
+ subagent_type: 'general-purpose'
83
+ });
84
+ },
85
+
86
+ readHandler: async (entities) => {
87
+ // Launch exploration agent
88
+ return Task({
89
+ description: `Find ${entities.target}`,
90
+ prompt: `Search for ${entities.target} in the codebase`,
91
+ subagent_type: 'Explore'
92
+ });
93
+ },
94
+
95
+ analyzeHandler: async (entities) => {
96
+ // Launch analysis agent
97
+ return Task({
98
+ description: `Analyze ${entities.scope}`,
99
+ prompt: `Perform analysis on ${entities.scope}`,
100
+ subagent_type: 'Plan'
101
+ });
102
+ },
103
+
104
+ fallbackHandler: async (entities) => {
105
+ // Ask for clarification
106
+ return { needsClarification: true, entities };
107
+ }
108
+ };
109
+ ```
110
+
111
+ ### Pipeline Execution
112
+
113
+ ```typescript
114
+ async function executeQuery(request: string) {
115
+ // Tier 1: Classify
116
+ const classification = await classifyIntent(request);
117
+
118
+ if (classification.confidence < 0.7) {
119
+ // Low confidence - ask for clarification
120
+ return askForClarification(classification);
121
+ }
122
+
123
+ // Tier 2: Execute
124
+ const handler = handlers[classification.handler];
125
+ if (!handler) {
126
+ throw new Error(`Unknown handler: ${classification.handler}`);
127
+ }
128
+
129
+ return handler(classification.entities);
130
+ }
131
+ ```
132
+
133
+ ## Example: Command Router
134
+
135
+ ```typescript
136
+ // User asks: "Create a new hook for validating file writes"
137
+
138
+ // Tier 1 Classification:
139
+ {
140
+ intent: 'create',
141
+ confidence: 0.9,
142
+ entities: {
143
+ type: 'hook',
144
+ target: 'file writes',
145
+ purpose: 'validation'
146
+ },
147
+ handler: 'createHandler'
148
+ }
149
+
150
+ // Tier 2 Execution:
151
+ // Launches create-hook skill with extracted parameters
152
+ ```
153
+
154
+ ## Benefits
155
+
156
+ 1. **Separation of Concerns**: Classification logic is separate from execution
157
+ 2. **Extensibility**: Add new handlers without changing classifier
158
+ 3. **Testability**: Each tier can be tested independently
159
+ 4. **Confidence Handling**: Low-confidence routes can be handled specially
160
+
161
+ ## Variations
162
+
163
+ ### Multi-Intent
164
+
165
+ Handle requests with multiple intents:
166
+
167
+ ```typescript
168
+ // "Create a user and send them a welcome email"
169
+ // Intent 1: create user
170
+ // Intent 2: send email
171
+ ```
172
+
173
+ ### Fallback Chain
174
+
175
+ Multiple classifiers with fallback:
176
+
177
+ ```typescript
178
+ const classifiers = [patternClassifier, mlClassifier, heuristicClassifier];
179
+
180
+ async function classifyWithFallback(request) {
181
+ for (const classifier of classifiers) {
182
+ const result = await classifier(request);
183
+ if (result.confidence > 0.7) return result;
184
+ }
185
+ return { intent: 'unknown', confidence: 0 };
186
+ }
187
+ ```
188
+
189
+ ## Related Patterns
190
+
191
+ - L1→L2 Orchestration
192
+ - Multi-Phase Orchestration
@@ -0,0 +1,109 @@
1
+ # Utility Scripts Library
2
+
3
+ Standalone scripts for deployment validation, logging analysis, and project health monitoring.
4
+
5
+ ## Available Scripts
6
+
7
+ | Script | Purpose | Language |
8
+ |--------|---------|----------|
9
+ | [validate-deployment.js](validate-deployment.js) | Pre-deployment environment validation | Node.js |
10
+ | [poll-deployment-status.js](poll-deployment-status.js) | Poll deployment until complete | Node.js |
11
+ | [roadmap-scanner.js](roadmap-scanner.js) | Multi-roadmap progress dashboard | Node.js |
12
+ | [analyze-delegation-log.js](analyze-delegation-log.js) | Model usage analysis from JSONL logs | Node.js |
13
+ | [autonomous-decision-logger.js](autonomous-decision-logger.js) | JSONL audit trail for agent decisions | Node.js |
14
+ | [phase-validation-gates.js](phase-validation-gates.js) | 5-gate validation before phase transitions | Node.js |
15
+ | [git-history-analyzer.py](git-history-analyzer.py) | Security audit for sensitive data in git | Python |
16
+
17
+ ## Installation
18
+
19
+ Copy scripts to your project:
20
+
21
+ ```bash
22
+ # Copy all scripts
23
+ cp -r templates/scripts/ .claude/scripts/
24
+
25
+ # Or install via ccasp
26
+ ccasp install-scripts
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ ### Pre-Deployment Validation
32
+
33
+ ```bash
34
+ # Validate Railway environment
35
+ node .claude/scripts/validate-deployment.js --platform railway
36
+
37
+ # Validate Cloudflare Pages
38
+ node .claude/scripts/validate-deployment.js --platform cloudflare
39
+ ```
40
+
41
+ ### Deployment Polling
42
+
43
+ ```bash
44
+ # Poll Railway deployment until complete
45
+ node .claude/scripts/poll-deployment-status.js \
46
+ --platform railway \
47
+ --project-id YOUR_PROJECT_ID \
48
+ --timeout 300
49
+
50
+ # Poll Cloudflare Pages deployment
51
+ node .claude/scripts/poll-deployment-status.js \
52
+ --platform cloudflare \
53
+ --project-name your-project
54
+ ```
55
+
56
+ ### Roadmap Scanning
57
+
58
+ ```bash
59
+ # Scan all roadmaps in current directory
60
+ node .claude/scripts/roadmap-scanner.js
61
+
62
+ # Generate JSON report
63
+ node .claude/scripts/roadmap-scanner.js --output json
64
+ ```
65
+
66
+ ### Log Analysis
67
+
68
+ ```bash
69
+ # Analyze delegation log for model usage
70
+ node .claude/scripts/analyze-delegation-log.js \
71
+ ~/.claude/logs/delegation.jsonl
72
+
73
+ # Generate cost estimate
74
+ node .claude/scripts/analyze-delegation-log.js \
75
+ ~/.claude/logs/delegation.jsonl --cost-estimate
76
+ ```
77
+
78
+ ### Git History Audit
79
+
80
+ ```bash
81
+ # Check for sensitive data in git history
82
+ python .claude/scripts/git-history-analyzer.py
83
+
84
+ # Check specific patterns
85
+ python .claude/scripts/git-history-analyzer.py \
86
+ --patterns "password|secret|api.key"
87
+ ```
88
+
89
+ ## Integration with Claude Code
90
+
91
+ These scripts can be invoked via Claude Code commands:
92
+
93
+ ```markdown
94
+ <!-- .claude/commands/validate-deploy.md -->
95
+ Run the deployment validation script:
96
+ \`\`\`bash
97
+ node .claude/scripts/validate-deployment.js --platform {{platform}}
98
+ \`\`\`
99
+ ```
100
+
101
+ ## Environment Variables
102
+
103
+ Some scripts require environment variables:
104
+
105
+ | Variable | Used By | Description |
106
+ |----------|---------|-------------|
107
+ | `RAILWAY_API_TOKEN` | validate-deployment.js | Railway API access |
108
+ | `CLOUDFLARE_API_TOKEN` | validate-deployment.js | Cloudflare API access |
109
+ | `GITHUB_TOKEN` | git-history-analyzer.py | GitHub API (optional) |