claude-code-workflow 7.2.29 → 7.2.30
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.
- package/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json +2 -2
- package/.ccw/workflows/cli-templates/schemas/task-schema.json +14 -7
- package/.claude/agents/action-planning-agent.md +7 -4
- package/.claude/agents/cli-explore-agent.md +77 -63
- package/.claude/agents/cli-lite-planning-agent.md +11 -10
- package/.claude/agents/issue-plan-agent.md +421 -426
- package/.claude/commands/workflow/spec/setup.md +1 -1
- package/.claude/skills/ccw-chain/SKILL.md +119 -0
- package/.claude/skills/ccw-chain/chains/ccw-cycle.json +21 -0
- package/.claude/skills/ccw-chain/chains/ccw-exploration.json +47 -0
- package/.claude/skills/ccw-chain/chains/ccw-issue.json +33 -0
- package/.claude/skills/ccw-chain/chains/ccw-lightweight.json +57 -0
- package/.claude/skills/ccw-chain/chains/ccw-main.json +52 -0
- package/.claude/skills/ccw-chain/chains/ccw-standard.json +39 -0
- package/.claude/skills/ccw-chain/chains/ccw-team.json +10 -0
- package/.claude/skills/ccw-chain/chains/ccw-with-file.json +31 -0
- package/.claude/skills/ccw-chain/phases/analyze-with-file.md +788 -0
- package/.claude/skills/ccw-chain/phases/brainstorm/SKILL.md +408 -0
- package/.claude/skills/ccw-chain/phases/brainstorm/phases/01-mode-routing.md +207 -0
- package/.claude/skills/ccw-chain/phases/brainstorm/phases/02-artifacts.md +567 -0
- package/.claude/skills/ccw-chain/phases/brainstorm/phases/03-role-analysis.md +748 -0
- package/.claude/skills/ccw-chain/phases/brainstorm/phases/04-synthesis.md +827 -0
- package/.claude/skills/ccw-chain/phases/brainstorm-with-file.md +482 -0
- package/.claude/skills/ccw-chain/phases/collaborative-plan-with-file.md +639 -0
- package/.claude/skills/ccw-chain/phases/debug-with-file.md +656 -0
- package/.claude/skills/ccw-chain/phases/integration-test-cycle.md +936 -0
- package/.claude/skills/ccw-chain/phases/issue-convert-to-plan.md +720 -0
- package/.claude/skills/ccw-chain/phases/issue-discover.md +483 -0
- package/.claude/skills/ccw-chain/phases/issue-execute.md +629 -0
- package/.claude/skills/ccw-chain/phases/issue-from-brainstorm.md +382 -0
- package/.claude/skills/ccw-chain/phases/issue-plan.md +343 -0
- package/.claude/skills/ccw-chain/phases/issue-queue.md +464 -0
- package/.claude/skills/ccw-chain/phases/refactor-cycle.md +852 -0
- package/.claude/skills/ccw-chain/phases/review-cycle/SKILL.md +132 -0
- package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-fix.md +760 -0
- package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-module.md +764 -0
- package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-session.md +775 -0
- package/.claude/skills/ccw-chain/phases/roadmap-with-file.md +544 -0
- package/.claude/skills/ccw-chain/phases/spec-generator/SKILL.md +338 -0
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/01-5-requirement-clarification.md +404 -0
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/01-discovery.md +257 -0
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/02-product-brief.md +274 -0
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/03-requirements.md +184 -0
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/04-architecture.md +248 -0
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/05-epics-stories.md +178 -0
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/06-5-auto-fix.md +144 -0
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/06-readiness-check.md +480 -0
- package/.claude/skills/ccw-chain/phases/team-planex.md +123 -0
- package/.claude/skills/ccw-chain/phases/ui-design-explore-auto.md +678 -0
- package/.claude/skills/ccw-chain/phases/unified-execute-with-file.md +870 -0
- package/.claude/skills/ccw-chain/phases/workflow-execute/SKILL.md +625 -0
- package/.claude/skills/ccw-chain/phases/workflow-execute/phases/06-review.md +215 -0
- package/.claude/skills/ccw-chain/phases/workflow-lite-plan.md +616 -0
- package/.claude/skills/ccw-chain/phases/workflow-multi-cli-plan.md +424 -0
- package/.claude/skills/ccw-chain/phases/workflow-plan/SKILL.md +466 -0
- package/.claude/skills/ccw-chain/phases/workflow-plan/phases/01-session-discovery.md +99 -0
- package/.claude/skills/ccw-chain/phases/workflow-plan/phases/02-context-gathering.md +338 -0
- package/.claude/skills/ccw-chain/phases/workflow-plan/phases/03-conflict-resolution.md +422 -0
- package/.claude/skills/ccw-chain/phases/workflow-plan/phases/04-task-generation.md +440 -0
- package/.claude/skills/ccw-chain/phases/workflow-plan/phases/05-plan-verify.md +395 -0
- package/.claude/skills/ccw-chain/phases/workflow-plan/phases/06-replan.md +594 -0
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/SKILL.md +527 -0
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/01-session-discovery.md +57 -0
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/02-context-gathering.md +407 -0
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/03-test-coverage-analysis.md +172 -0
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/04-conflict-resolution.md +426 -0
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/05-tdd-task-generation.md +473 -0
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/06-tdd-structure-validation.md +189 -0
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/07-tdd-verify.md +635 -0
- package/.claude/skills/ccw-chain/phases/workflow-test-fix/SKILL.md +482 -0
- package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/01-session-start.md +60 -0
- package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/02-test-context-gather.md +493 -0
- package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/03-test-concept-enhanced.md +150 -0
- package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/04-test-task-generate.md +346 -0
- package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/05-test-cycle-execute.md +538 -0
- package/.claude/skills/ccw-chain/specs/auto-mode.md +47 -0
- package/.claude/skills/ccw-chain/specs/intent-patterns.md +60 -0
- package/.claude/skills/chain-loader/SKILL.md +78 -0
- package/.claude/skills/chain-loader/phases/01-analyze-skill.md +53 -0
- package/.claude/skills/chain-loader/phases/02-design-graph.md +73 -0
- package/.claude/skills/chain-loader/phases/03-generate-validate.md +75 -0
- package/.claude/skills/chain-loader/specs/chain-schema.md +99 -0
- package/.claude/skills/chain-loader/specs/design-patterns.md +99 -0
- package/.claude/skills/chain-loader/templates/chain-json.md +63 -0
- package/.claude/skills/review-cycle/phases/review-module.md +764 -764
- package/.claude/skills/review-cycle/phases/review-session.md +775 -775
- package/.claude/skills/workflow-multi-cli-plan/SKILL.md +2 -2
- package/.claude/skills/workflow-plan/phases/03-conflict-resolution.md +422 -422
- package/.claude/skills/workflow-plan/phases/05-plan-verify.md +395 -395
- package/.claude/skills/workflow-tdd-plan/phases/02-context-gathering.md +407 -407
- package/.claude/skills/workflow-tdd-plan/phases/04-conflict-resolution.md +426 -426
- package/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md +493 -493
- package/README.md +14 -0
- package/ccw/dist/core/routes/litellm-api-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/litellm-api-routes.js +0 -23
- package/ccw/dist/core/routes/litellm-api-routes.js.map +1 -1
- package/ccw/dist/tools/chain-loader.d.ts +10 -0
- package/ccw/dist/tools/chain-loader.d.ts.map +1 -0
- package/ccw/dist/tools/chain-loader.js +642 -0
- package/ccw/dist/tools/chain-loader.js.map +1 -0
- package/ccw/dist/tools/index.d.ts.map +1 -1
- package/ccw/dist/tools/index.js +2 -0
- package/ccw/dist/tools/index.js.map +1 -1
- package/ccw/dist/tools/json-builder.js +20 -0
- package/ccw/dist/tools/json-builder.js.map +1 -1
- package/ccw/dist/types/chain-types.d.ts +72 -0
- package/ccw/dist/types/chain-types.d.ts.map +1 -0
- package/ccw/dist/types/chain-types.js +5 -0
- package/ccw/dist/types/chain-types.js.map +1 -0
- package/ccw/scripts/prepublish-clean.mjs +0 -1
- package/package.json +1 -3
- package/ccw-litellm/README.md +0 -180
- package/ccw-litellm/pyproject.toml +0 -35
- package/ccw-litellm/src/ccw_litellm/__init__.py +0 -47
- package/ccw-litellm/src/ccw_litellm/cli.py +0 -108
- package/ccw-litellm/src/ccw_litellm/clients/__init__.py +0 -12
- package/ccw-litellm/src/ccw_litellm/clients/litellm_embedder.py +0 -270
- package/ccw-litellm/src/ccw_litellm/clients/litellm_llm.py +0 -198
- package/ccw-litellm/src/ccw_litellm/config/__init__.py +0 -22
- package/ccw-litellm/src/ccw_litellm/config/loader.py +0 -343
- package/ccw-litellm/src/ccw_litellm/config/models.py +0 -162
- package/ccw-litellm/src/ccw_litellm/interfaces/__init__.py +0 -14
- package/ccw-litellm/src/ccw_litellm/interfaces/embedder.py +0 -52
- package/ccw-litellm/src/ccw_litellm/interfaces/llm.py +0 -45
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
# Phase 6: Readiness Check
|
|
2
|
+
|
|
3
|
+
Validate the complete specification package, generate quality report and executive summary, provide execution handoff options.
|
|
4
|
+
|
|
5
|
+
## Objective
|
|
6
|
+
|
|
7
|
+
- Cross-document validation: completeness, consistency, traceability, depth
|
|
8
|
+
- Generate quality scores per dimension
|
|
9
|
+
- Produce readiness-report.md with issue list and traceability matrix
|
|
10
|
+
- Produce spec-summary.md as one-page executive summary
|
|
11
|
+
- Update all document frontmatter to `status: complete`
|
|
12
|
+
- Present handoff options to execution workflows
|
|
13
|
+
|
|
14
|
+
## Input
|
|
15
|
+
|
|
16
|
+
- All Phase 2-5 outputs: `product-brief.md`, `requirements/_index.md` (+ `REQ-*.md`, `NFR-*.md`), `architecture/_index.md` (+ `ADR-*.md`), `epics/_index.md` (+ `EPIC-*.md`)
|
|
17
|
+
- Config: `{workDir}/spec-config.json`
|
|
18
|
+
- Reference: `specs/quality-gates.md`
|
|
19
|
+
|
|
20
|
+
## Execution Steps
|
|
21
|
+
|
|
22
|
+
### Step 1: Load All Documents
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
25
|
+
const specConfig = JSON.parse(Read(`${workDir}/spec-config.json`));
|
|
26
|
+
const productBrief = Read(`${workDir}/product-brief.md`);
|
|
27
|
+
const requirementsIndex = Read(`${workDir}/requirements/_index.md`);
|
|
28
|
+
const architectureIndex = Read(`${workDir}/architecture/_index.md`);
|
|
29
|
+
const epicsIndex = Read(`${workDir}/epics/_index.md`);
|
|
30
|
+
const qualityGates = Read('specs/quality-gates.md');
|
|
31
|
+
|
|
32
|
+
// Load individual files for deep validation
|
|
33
|
+
const reqFiles = Glob(`${workDir}/requirements/REQ-*.md`);
|
|
34
|
+
const nfrFiles = Glob(`${workDir}/requirements/NFR-*.md`);
|
|
35
|
+
const adrFiles = Glob(`${workDir}/architecture/ADR-*.md`);
|
|
36
|
+
const epicFiles = Glob(`${workDir}/epics/EPIC-*.md`);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Step 2: Cross-Document Validation via Gemini CLI
|
|
40
|
+
|
|
41
|
+
```javascript
|
|
42
|
+
Bash({
|
|
43
|
+
command: `ccw cli -p "PURPOSE: Validate specification package for completeness, consistency, traceability, and depth.
|
|
44
|
+
Success: Comprehensive quality report with scores, issues, and traceability matrix.
|
|
45
|
+
|
|
46
|
+
DOCUMENTS TO VALIDATE:
|
|
47
|
+
|
|
48
|
+
=== PRODUCT BRIEF ===
|
|
49
|
+
${productBrief.slice(0, 3000)}
|
|
50
|
+
|
|
51
|
+
=== REQUIREMENTS INDEX (${reqFiles.length} REQ + ${nfrFiles.length} NFR files) ===
|
|
52
|
+
${requirementsIndex.slice(0, 3000)}
|
|
53
|
+
|
|
54
|
+
=== ARCHITECTURE INDEX (${adrFiles.length} ADR files) ===
|
|
55
|
+
${architectureIndex.slice(0, 2500)}
|
|
56
|
+
|
|
57
|
+
=== EPICS INDEX (${epicFiles.length} EPIC files) ===
|
|
58
|
+
${epicsIndex.slice(0, 2500)}
|
|
59
|
+
|
|
60
|
+
QUALITY CRITERIA (from quality-gates.md):
|
|
61
|
+
${qualityGates.slice(0, 2000)}
|
|
62
|
+
|
|
63
|
+
TASK:
|
|
64
|
+
Perform 4-dimension validation:
|
|
65
|
+
|
|
66
|
+
1. COMPLETENESS (25%):
|
|
67
|
+
- All required sections present in each document?
|
|
68
|
+
- All template fields filled with substantive content?
|
|
69
|
+
- Score 0-100 with specific gaps listed
|
|
70
|
+
|
|
71
|
+
2. CONSISTENCY (25%):
|
|
72
|
+
- Terminology uniform across documents?
|
|
73
|
+
- Terminology glossary compliance: all core terms used consistently per glossary.json definitions?
|
|
74
|
+
- No synonym drift (e.g., "user" vs "client" vs "consumer" for same concept)?
|
|
75
|
+
- User personas consistent?
|
|
76
|
+
- Scope consistent (PRD does not exceed brief)?
|
|
77
|
+
- Scope containment: PRD requirements do not exceed product brief's defined scope?
|
|
78
|
+
- Non-Goals respected: no requirement or story contradicts explicit Non-Goals?
|
|
79
|
+
- Tech stack references match between architecture and epics?
|
|
80
|
+
- Score 0-100 with inconsistencies listed
|
|
81
|
+
|
|
82
|
+
3. TRACEABILITY (25%):
|
|
83
|
+
- Every goal has >= 1 requirement?
|
|
84
|
+
- Every Must requirement has architecture coverage?
|
|
85
|
+
- Every Must requirement appears in >= 1 story?
|
|
86
|
+
- ADR choices reflected in epics?
|
|
87
|
+
- Build traceability matrix: Goal -> Requirement -> Architecture -> Epic/Story
|
|
88
|
+
- Score 0-100 with orphan items listed
|
|
89
|
+
|
|
90
|
+
4. DEPTH (25%):
|
|
91
|
+
- Acceptance criteria specific and testable?
|
|
92
|
+
- Architecture decisions justified with alternatives?
|
|
93
|
+
- Stories estimable by dev team?
|
|
94
|
+
- Score 0-100 with vague areas listed
|
|
95
|
+
|
|
96
|
+
ALSO:
|
|
97
|
+
- List all issues found, classified as Error/Warning/Info
|
|
98
|
+
- Generate overall weighted score
|
|
99
|
+
- Determine gate: Pass (>=80) / Review (60-79) / Fail (<60)
|
|
100
|
+
|
|
101
|
+
MODE: analysis
|
|
102
|
+
EXPECTED: JSON-compatible output with: dimension scores, overall score, gate, issues list (severity + description + location), traceability matrix
|
|
103
|
+
CONSTRAINTS: Be thorough but fair. Focus on actionable issues.
|
|
104
|
+
" --tool gemini --mode analysis`,
|
|
105
|
+
run_in_background: true
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// Wait for CLI result
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Step 3: Generate readiness-report.md
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
const frontmatterReport = `---
|
|
115
|
+
session_id: ${specConfig.session_id}
|
|
116
|
+
phase: 6
|
|
117
|
+
document_type: readiness-report
|
|
118
|
+
status: complete
|
|
119
|
+
generated_at: ${new Date().toISOString()}
|
|
120
|
+
stepsCompleted: ["load-all", "cross-validation", "scoring", "report-generation"]
|
|
121
|
+
version: 1
|
|
122
|
+
dependencies:
|
|
123
|
+
- product-brief.md
|
|
124
|
+
- requirements/_index.md
|
|
125
|
+
- architecture/_index.md
|
|
126
|
+
- epics/_index.md
|
|
127
|
+
---`;
|
|
128
|
+
|
|
129
|
+
// Report content from CLI validation output:
|
|
130
|
+
// - Quality Score Summary (4 dimensions + overall)
|
|
131
|
+
// - Gate Decision (Pass/Review/Fail)
|
|
132
|
+
// - Issue List (grouped by severity: Error, Warning, Info)
|
|
133
|
+
// - Traceability Matrix (Goal -> Req -> Arch -> Epic/Story)
|
|
134
|
+
// - Recommendations for improvement
|
|
135
|
+
|
|
136
|
+
Write(`${workDir}/readiness-report.md`, `${frontmatterReport}\n\n${reportContent}`);
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Step 4: Generate spec-summary.md
|
|
140
|
+
|
|
141
|
+
```javascript
|
|
142
|
+
const frontmatterSummary = `---
|
|
143
|
+
session_id: ${specConfig.session_id}
|
|
144
|
+
phase: 6
|
|
145
|
+
document_type: spec-summary
|
|
146
|
+
status: complete
|
|
147
|
+
generated_at: ${new Date().toISOString()}
|
|
148
|
+
stepsCompleted: ["synthesis"]
|
|
149
|
+
version: 1
|
|
150
|
+
dependencies:
|
|
151
|
+
- product-brief.md
|
|
152
|
+
- requirements/_index.md
|
|
153
|
+
- architecture/_index.md
|
|
154
|
+
- epics/_index.md
|
|
155
|
+
- readiness-report.md
|
|
156
|
+
---`;
|
|
157
|
+
|
|
158
|
+
// One-page executive summary:
|
|
159
|
+
// - Product Name & Vision (from product-brief.md)
|
|
160
|
+
// - Problem & Target Users (from product-brief.md)
|
|
161
|
+
// - Key Requirements count (Must/Should/Could from requirements.md)
|
|
162
|
+
// - Architecture Style & Tech Stack (from architecture.md)
|
|
163
|
+
// - Epic Overview (count, MVP scope from epics.md)
|
|
164
|
+
// - Quality Score (from readiness-report.md)
|
|
165
|
+
// - Recommended Next Step
|
|
166
|
+
// - File manifest with links
|
|
167
|
+
|
|
168
|
+
Write(`${workDir}/spec-summary.md`, `${frontmatterSummary}\n\n${summaryContent}`);
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Step 5: Update All Document Status
|
|
172
|
+
|
|
173
|
+
```javascript
|
|
174
|
+
// Update frontmatter status to 'complete' in all documents (directories + single files)
|
|
175
|
+
// product-brief.md is a single file
|
|
176
|
+
const singleFiles = ['product-brief.md'];
|
|
177
|
+
singleFiles.forEach(doc => {
|
|
178
|
+
const content = Read(`${workDir}/${doc}`);
|
|
179
|
+
Write(`${workDir}/${doc}`, content.replace(/status: draft/, 'status: complete'));
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
// Update all files in directories (index + individual files)
|
|
183
|
+
const dirFiles = [
|
|
184
|
+
...Glob(`${workDir}/requirements/*.md`),
|
|
185
|
+
...Glob(`${workDir}/architecture/*.md`),
|
|
186
|
+
...Glob(`${workDir}/epics/*.md`)
|
|
187
|
+
];
|
|
188
|
+
dirFiles.forEach(filePath => {
|
|
189
|
+
const content = Read(filePath);
|
|
190
|
+
if (content.includes('status: draft')) {
|
|
191
|
+
Write(filePath, content.replace(/status: draft/, 'status: complete'));
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// Update spec-config.json
|
|
196
|
+
specConfig.phasesCompleted.push({
|
|
197
|
+
phase: 6,
|
|
198
|
+
name: "readiness-check",
|
|
199
|
+
output_file: "readiness-report.md",
|
|
200
|
+
completed_at: new Date().toISOString()
|
|
201
|
+
});
|
|
202
|
+
Write(`${workDir}/spec-config.json`, JSON.stringify(specConfig, null, 2));
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Step 6: Handoff Options
|
|
206
|
+
|
|
207
|
+
```javascript
|
|
208
|
+
AskUserQuestion({
|
|
209
|
+
questions: [
|
|
210
|
+
{
|
|
211
|
+
question: "Specification package is complete. What would you like to do next?",
|
|
212
|
+
header: "Next Step",
|
|
213
|
+
multiSelect: false,
|
|
214
|
+
options: [
|
|
215
|
+
{
|
|
216
|
+
label: "Execute via lite-plan",
|
|
217
|
+
description: "Start implementing with /workflow-lite-plan, one Epic at a time"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
label: "Create roadmap",
|
|
221
|
+
description: "Generate execution roadmap with /workflow:req-plan-with-file"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
label: "Full planning",
|
|
225
|
+
description: "Detailed planning with /workflow-plan for the full scope"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
label: "Create Issues",
|
|
229
|
+
description: "Generate issues for each Epic via /issue:new"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
label: "Iterate & improve",
|
|
233
|
+
description: "Re-run failed phases based on readiness report issues (max 2 iterations)"
|
|
234
|
+
}
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
// Based on user selection, execute the corresponding handoff:
|
|
241
|
+
|
|
242
|
+
if (selection === "Execute via lite-plan") {
|
|
243
|
+
// lite-plan accepts a text description directly
|
|
244
|
+
// Read first MVP Epic from individual EPIC-*.md files
|
|
245
|
+
const epicFiles = Glob(`${workDir}/epics/EPIC-*.md`);
|
|
246
|
+
const firstMvpFile = epicFiles.find(f => {
|
|
247
|
+
const content = Read(f);
|
|
248
|
+
return content.includes('mvp: true');
|
|
249
|
+
});
|
|
250
|
+
const epicContent = Read(firstMvpFile);
|
|
251
|
+
const title = extractTitle(epicContent); // First # heading
|
|
252
|
+
const description = extractSection(epicContent, "Description");
|
|
253
|
+
Skill(skill="workflow-lite-plan", args=`"${title}: ${description}"`)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (selection === "Full planning" || selection === "Create roadmap") {
|
|
257
|
+
// === Bridge: Build brainstorm_artifacts compatible structure ===
|
|
258
|
+
// Reads from directory-based outputs (individual files), maps to .brainstorming/ format
|
|
259
|
+
// for context-search-agent auto-discovery → action-planning-agent consumption.
|
|
260
|
+
|
|
261
|
+
// Step A: Read spec documents from directories
|
|
262
|
+
const specSummary = Read(`${workDir}/spec-summary.md`);
|
|
263
|
+
const productBrief = Read(`${workDir}/product-brief.md`);
|
|
264
|
+
const requirementsIndex = Read(`${workDir}/requirements/_index.md`);
|
|
265
|
+
const architectureIndex = Read(`${workDir}/architecture/_index.md`);
|
|
266
|
+
const epicsIndex = Read(`${workDir}/epics/_index.md`);
|
|
267
|
+
|
|
268
|
+
// Read individual EPIC files (already split — direct mapping to feature-specs)
|
|
269
|
+
const epicFiles = Glob(`${workDir}/epics/EPIC-*.md`);
|
|
270
|
+
|
|
271
|
+
// Step B: Build structured description from spec-summary
|
|
272
|
+
const structuredDesc = `GOAL: ${extractGoal(specSummary)}
|
|
273
|
+
SCOPE: ${extractScope(specSummary)}
|
|
274
|
+
CONTEXT: Generated from spec session ${specConfig.session_id}. Source: ${workDir}/`;
|
|
275
|
+
|
|
276
|
+
// Step C: Create WFS session (provides session directory + .brainstorming/)
|
|
277
|
+
Skill(skill="workflow:session:start", args=`--auto "${structuredDesc}"`)
|
|
278
|
+
// → Produces sessionId (WFS-xxx) and session directory at .workflow/active/{sessionId}/
|
|
279
|
+
|
|
280
|
+
// Step D: Create .brainstorming/ bridge files
|
|
281
|
+
const brainstormDir = `.workflow/active/${sessionId}/.brainstorming`;
|
|
282
|
+
Bash(`mkdir -p "${brainstormDir}/feature-specs"`);
|
|
283
|
+
|
|
284
|
+
// D.1: guidance-specification.md (highest priority — action-planning-agent reads first)
|
|
285
|
+
// Synthesized from spec-summary + product-brief + architecture/requirements indexes
|
|
286
|
+
Write(`${brainstormDir}/guidance-specification.md`, `
|
|
287
|
+
# ${specConfig.seed_analysis.problem_statement} - Confirmed Guidance Specification
|
|
288
|
+
|
|
289
|
+
**Source**: spec-generator session ${specConfig.session_id}
|
|
290
|
+
**Generated**: ${new Date().toISOString()}
|
|
291
|
+
**Spec Directory**: ${workDir}
|
|
292
|
+
|
|
293
|
+
## 1. Project Positioning & Goals
|
|
294
|
+
${extractSection(productBrief, "Vision")}
|
|
295
|
+
${extractSection(productBrief, "Goals")}
|
|
296
|
+
|
|
297
|
+
## 2. Requirements Summary
|
|
298
|
+
${extractSection(requirementsIndex, "Functional Requirements")}
|
|
299
|
+
|
|
300
|
+
## 3. Architecture Decisions
|
|
301
|
+
${extractSection(architectureIndex, "Architecture Decision Records")}
|
|
302
|
+
${extractSection(architectureIndex, "Technology Stack")}
|
|
303
|
+
|
|
304
|
+
## 4. Implementation Scope
|
|
305
|
+
${extractSection(epicsIndex, "Epic Overview")}
|
|
306
|
+
${extractSection(epicsIndex, "MVP Scope")}
|
|
307
|
+
|
|
308
|
+
## Feature Decomposition
|
|
309
|
+
${extractSection(epicsIndex, "Traceability Matrix")}
|
|
310
|
+
|
|
311
|
+
## Appendix: Source Documents
|
|
312
|
+
| Document | Path | Description |
|
|
313
|
+
|----------|------|-------------|
|
|
314
|
+
| Product Brief | ${workDir}/product-brief.md | Vision, goals, scope |
|
|
315
|
+
| Requirements | ${workDir}/requirements/ | _index.md + REQ-*.md + NFR-*.md |
|
|
316
|
+
| Architecture | ${workDir}/architecture/ | _index.md + ADR-*.md |
|
|
317
|
+
| Epics | ${workDir}/epics/ | _index.md + EPIC-*.md |
|
|
318
|
+
| Readiness Report | ${workDir}/readiness-report.md | Quality validation |
|
|
319
|
+
`);
|
|
320
|
+
|
|
321
|
+
// D.2: feature-index.json (each EPIC file mapped to a Feature)
|
|
322
|
+
// Path: feature-specs/feature-index.json (matches context-search-agent discovery)
|
|
323
|
+
// Directly read from individual EPIC-*.md files (no monolithic parsing needed)
|
|
324
|
+
const features = epicFiles.map(epicFile => {
|
|
325
|
+
const content = Read(epicFile);
|
|
326
|
+
const fm = parseFrontmatter(content); // Extract YAML frontmatter
|
|
327
|
+
const basename = path.basename(epicFile, '.md'); // EPIC-001-slug
|
|
328
|
+
const epicNum = fm.id.replace('EPIC-', ''); // 001
|
|
329
|
+
const slug = basename.replace(/^EPIC-\d+-/, ''); // slug
|
|
330
|
+
return {
|
|
331
|
+
id: `F-${epicNum}`,
|
|
332
|
+
slug: slug,
|
|
333
|
+
name: extractTitle(content),
|
|
334
|
+
description: extractSection(content, "Description"),
|
|
335
|
+
priority: fm.mvp ? "High" : "Medium",
|
|
336
|
+
spec_path: `${brainstormDir}/feature-specs/F-${epicNum}-${slug}.md`,
|
|
337
|
+
source_epic: fm.id,
|
|
338
|
+
source_file: epicFile
|
|
339
|
+
};
|
|
340
|
+
});
|
|
341
|
+
Write(`${brainstormDir}/feature-specs/feature-index.json`, JSON.stringify({
|
|
342
|
+
version: "1.0",
|
|
343
|
+
source: "spec-generator",
|
|
344
|
+
spec_session: specConfig.session_id,
|
|
345
|
+
features,
|
|
346
|
+
cross_cutting_specs: []
|
|
347
|
+
}, null, 2));
|
|
348
|
+
|
|
349
|
+
// D.3: Feature-spec files — directly adapt from individual EPIC-*.md files
|
|
350
|
+
// Since Epics are already individual documents, transform format directly
|
|
351
|
+
// Filename pattern: F-{num}-{slug}.md (matches context-search-agent glob F-*-*.md)
|
|
352
|
+
features.forEach(feature => {
|
|
353
|
+
const epicContent = Read(feature.source_file);
|
|
354
|
+
Write(feature.spec_path, `
|
|
355
|
+
# Feature Spec: ${feature.source_epic} - ${feature.name}
|
|
356
|
+
|
|
357
|
+
**Source**: ${feature.source_file}
|
|
358
|
+
**Priority**: ${feature.priority === "High" ? "MVP" : "Post-MVP"}
|
|
359
|
+
|
|
360
|
+
## Description
|
|
361
|
+
${extractSection(epicContent, "Description")}
|
|
362
|
+
|
|
363
|
+
## Stories
|
|
364
|
+
${extractSection(epicContent, "Stories")}
|
|
365
|
+
|
|
366
|
+
## Requirements
|
|
367
|
+
${extractSection(epicContent, "Requirements")}
|
|
368
|
+
|
|
369
|
+
## Architecture
|
|
370
|
+
${extractSection(epicContent, "Architecture")}
|
|
371
|
+
`);
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
// Step E: Invoke downstream workflow
|
|
375
|
+
// context-search-agent will auto-discover .brainstorming/ files
|
|
376
|
+
// → context-package.json.brainstorm_artifacts populated
|
|
377
|
+
// → action-planning-agent loads guidance_specification (P1) + feature_index (P2)
|
|
378
|
+
if (selection === "Full planning") {
|
|
379
|
+
Skill(skill="workflow-plan", args=`"${structuredDesc}"`)
|
|
380
|
+
} else {
|
|
381
|
+
Skill(skill="workflow:req-plan-with-file", args=`"${extractGoal(specSummary)}"`)
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
if (selection === "Create Issues") {
|
|
386
|
+
// For each EPIC file, create an issue (read directly from individual files)
|
|
387
|
+
const epicFiles = Glob(`${workDir}/epics/EPIC-*.md`);
|
|
388
|
+
epicFiles.forEach(epicFile => {
|
|
389
|
+
const content = Read(epicFile);
|
|
390
|
+
const title = extractTitle(content);
|
|
391
|
+
const description = extractSection(content, "Description");
|
|
392
|
+
Skill(skill="issue:new", args=`"${title}: ${description}"`)
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// If user selects "Other": Export only or return to specific phase
|
|
397
|
+
|
|
398
|
+
if (selection === "Iterate & improve") {
|
|
399
|
+
// Check iteration count
|
|
400
|
+
if (specConfig.iteration_count >= 2) {
|
|
401
|
+
// Max iterations reached, force handoff
|
|
402
|
+
// Present handoff options again without iterate
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// Update iteration tracking
|
|
407
|
+
specConfig.iteration_count = (specConfig.iteration_count || 0) + 1;
|
|
408
|
+
specConfig.iteration_history.push({
|
|
409
|
+
iteration: specConfig.iteration_count,
|
|
410
|
+
timestamp: new Date().toISOString(),
|
|
411
|
+
readiness_score: overallScore,
|
|
412
|
+
errors_found: errorCount,
|
|
413
|
+
phases_to_fix: affectedPhases
|
|
414
|
+
});
|
|
415
|
+
Write(`${workDir}/spec-config.json`, JSON.stringify(specConfig, null, 2));
|
|
416
|
+
|
|
417
|
+
// Proceed to Phase 6.5: Auto-Fix
|
|
418
|
+
// Read phases/06-5-auto-fix.md and execute
|
|
419
|
+
}
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
#### Helper Functions Reference (pseudocode)
|
|
423
|
+
|
|
424
|
+
The following helper functions are used in the handoff bridge. They operate on markdown content from individual spec files:
|
|
425
|
+
|
|
426
|
+
```javascript
|
|
427
|
+
// Extract title from a markdown document (first # heading)
|
|
428
|
+
function extractTitle(markdown) {
|
|
429
|
+
// Return the text after the first # heading (e.g., "# EPIC-001: Title" → "Title")
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// Parse YAML frontmatter from markdown (between --- markers)
|
|
433
|
+
function parseFrontmatter(markdown) {
|
|
434
|
+
// Return object with: id, priority, mvp, size, requirements, architecture, dependencies
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
// Extract GOAL/SCOPE from spec-summary frontmatter or ## sections
|
|
438
|
+
function extractGoal(specSummary) { /* Return the Vision/Goal line */ }
|
|
439
|
+
function extractScope(specSummary) { /* Return the Scope/MVP boundary */ }
|
|
440
|
+
|
|
441
|
+
// Extract a named ## section from a markdown document
|
|
442
|
+
function extractSection(markdown, sectionName) {
|
|
443
|
+
// Return content between ## {sectionName} and next ## heading
|
|
444
|
+
}
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
## Output
|
|
448
|
+
|
|
449
|
+
- **File**: `readiness-report.md` - Quality validation report
|
|
450
|
+
- **File**: `spec-summary.md` - One-page executive summary
|
|
451
|
+
- **Format**: Markdown with YAML frontmatter
|
|
452
|
+
|
|
453
|
+
## Quality Checklist
|
|
454
|
+
|
|
455
|
+
- [ ] All document directories validated (product-brief, requirements/, architecture/, epics/)
|
|
456
|
+
- [ ] All frontmatter parseable and valid (index + individual files)
|
|
457
|
+
- [ ] Cross-references checked (relative links between directories)
|
|
458
|
+
- [ ] Overall quality score calculated
|
|
459
|
+
- [ ] No unresolved Error-severity issues
|
|
460
|
+
- [ ] Traceability matrix generated
|
|
461
|
+
- [ ] spec-summary.md created
|
|
462
|
+
- [ ] All document statuses updated to 'complete' (all files in all directories)
|
|
463
|
+
- [ ] Handoff options presented
|
|
464
|
+
|
|
465
|
+
## Completion
|
|
466
|
+
|
|
467
|
+
This is the final phase. The specification package is ready for execution handoff.
|
|
468
|
+
|
|
469
|
+
### Output Files Manifest
|
|
470
|
+
|
|
471
|
+
| Path | Phase | Description |
|
|
472
|
+
|------|-------|-------------|
|
|
473
|
+
| `spec-config.json` | 1 | Session configuration and state |
|
|
474
|
+
| `discovery-context.json` | 1 | Codebase exploration (optional) |
|
|
475
|
+
| `product-brief.md` | 2 | Product brief with multi-perspective synthesis |
|
|
476
|
+
| `requirements/` | 3 | Directory: `_index.md` + `REQ-*.md` + `NFR-*.md` |
|
|
477
|
+
| `architecture/` | 4 | Directory: `_index.md` + `ADR-*.md` |
|
|
478
|
+
| `epics/` | 5 | Directory: `_index.md` + `EPIC-*.md` |
|
|
479
|
+
| `readiness-report.md` | 6 | Quality validation report |
|
|
480
|
+
| `spec-summary.md` | 6 | One-page executive summary |
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: team-planex
|
|
3
|
+
description: Unified team skill for plan-and-execute pipeline. Pure router — coordinator always. Beat model is coordinator-only in monitor.md. Triggers on "team planex".
|
|
4
|
+
allowed-tools: Agent(*), TaskCreate(*), TaskList(*), TaskGet(*), TaskUpdate(*), TeamCreate(*), TeamDelete(*), SendMessage(*), AskUserQuestion(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*), mcp__ccw-tools__team_msg(*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Team PlanEx
|
|
8
|
+
|
|
9
|
+
Unified team skill: plan-and-execute pipeline for issue-based development. Built on **team-worker agent architecture** — coordinator orchestrates, workers are team-worker agents loading role-specific instructions from `roles/<role>/role.md`.
|
|
10
|
+
|
|
11
|
+
## Architecture
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
Skill(skill="team-planex", args="task description")
|
|
15
|
+
|
|
|
16
|
+
SKILL.md (this file) = Router
|
|
17
|
+
|
|
|
18
|
+
+--------------+--------------+
|
|
19
|
+
| |
|
|
20
|
+
no --role flag --role <name>
|
|
21
|
+
| |
|
|
22
|
+
Coordinator Worker
|
|
23
|
+
roles/coordinator/role.md roles/<name>/role.md
|
|
24
|
+
|
|
|
25
|
+
+-- analyze -> dispatch -> spawn workers -> STOP
|
|
26
|
+
|
|
|
27
|
+
+---------------+---------------+
|
|
28
|
+
v v
|
|
29
|
+
[planner] [executor]
|
|
30
|
+
(team-worker agent, (team-worker agent,
|
|
31
|
+
loads roles/planner/role.md) loads roles/executor/role.md)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Role Registry
|
|
35
|
+
|
|
36
|
+
| Role | Path | Prefix | Inner Loop |
|
|
37
|
+
|------|------|--------|------------|
|
|
38
|
+
| coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | — | — |
|
|
39
|
+
| planner | [roles/planner/role.md](roles/planner/role.md) | PLAN-* | true |
|
|
40
|
+
| executor | [roles/executor/role.md](roles/executor/role.md) | EXEC-* | true |
|
|
41
|
+
|
|
42
|
+
## Role Router
|
|
43
|
+
|
|
44
|
+
Parse `$ARGUMENTS`:
|
|
45
|
+
- Has `--role <name>` → Read `roles/<name>/role.md`, execute Phase 2-4
|
|
46
|
+
- No `--role` → `@roles/coordinator/role.md`, execute entry router
|
|
47
|
+
|
|
48
|
+
## Shared Constants
|
|
49
|
+
|
|
50
|
+
- **Session prefix**: `PEX`
|
|
51
|
+
- **Session path**: `.workflow/.team/PEX-<slug>-<date>/`
|
|
52
|
+
- **CLI tools**: `ccw cli --mode analysis` (read-only), `ccw cli --mode write` (modifications)
|
|
53
|
+
- **Message bus**: `mcp__ccw-tools__team_msg(session_id=<session-id>, ...)`
|
|
54
|
+
|
|
55
|
+
## Worker Spawn Template
|
|
56
|
+
|
|
57
|
+
Coordinator spawns workers using this template:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
Agent({
|
|
61
|
+
subagent_type: "team-worker",
|
|
62
|
+
description: "Spawn <role> worker",
|
|
63
|
+
team_name: "planex",
|
|
64
|
+
name: "<role>",
|
|
65
|
+
run_in_background: true,
|
|
66
|
+
prompt: `## Role Assignment
|
|
67
|
+
role: <role>
|
|
68
|
+
role_spec: <skill_root>/roles/<role>/role.md
|
|
69
|
+
session: <session-folder>
|
|
70
|
+
session_id: <session-id>
|
|
71
|
+
team_name: planex
|
|
72
|
+
requirement: <task-description>
|
|
73
|
+
inner_loop: <true|false>
|
|
74
|
+
execution_method: <codex|gemini>
|
|
75
|
+
|
|
76
|
+
Read role_spec file (@<skill_root>/roles/<role>/role.md) to load Phase 2-4 domain instructions.
|
|
77
|
+
Execute built-in Phase 1 (task discovery) -> role Phase 2-4 -> built-in Phase 5 (report).`
|
|
78
|
+
})
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## User Commands
|
|
82
|
+
|
|
83
|
+
| Command | Action |
|
|
84
|
+
|---------|--------|
|
|
85
|
+
| `check` / `status` | View execution status graph |
|
|
86
|
+
| `resume` / `continue` | Advance to next step |
|
|
87
|
+
| `add <issue-ids or --text '...' or --plan path>` | Append new tasks to planner queue |
|
|
88
|
+
|
|
89
|
+
## Session Directory
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
.workflow/.team/PEX-<slug>-<YYYY-MM-DD>/
|
|
93
|
+
├── .msg/
|
|
94
|
+
│ ├── messages.jsonl # Message bus log
|
|
95
|
+
│ └── meta.json # Session state
|
|
96
|
+
├── task-analysis.json # Coordinator analyze output
|
|
97
|
+
├── artifacts/
|
|
98
|
+
│ └── solutions/ # Planner solution output per issue
|
|
99
|
+
│ ├── <issueId-1>.json
|
|
100
|
+
│ └── <issueId-N>.json
|
|
101
|
+
└── wisdom/ # Cross-task knowledge
|
|
102
|
+
├── learnings.md
|
|
103
|
+
├── decisions.md
|
|
104
|
+
├── conventions.md
|
|
105
|
+
└── issues.md
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Specs Reference
|
|
109
|
+
|
|
110
|
+
- [specs/pipelines.md](specs/pipelines.md) — Pipeline definitions, task metadata registry, execution method selection
|
|
111
|
+
|
|
112
|
+
## Error Handling
|
|
113
|
+
|
|
114
|
+
| Scenario | Resolution |
|
|
115
|
+
|----------|------------|
|
|
116
|
+
| Unknown command | Error with available command list |
|
|
117
|
+
| Role not found | Error with role registry |
|
|
118
|
+
| Role spec file not found | Error with expected path (roles/<name>/role.md) |
|
|
119
|
+
| team-worker agent unavailable | Error: requires .claude/agents/team-worker.md |
|
|
120
|
+
| Planner issue planning failure | Retry once, then skip to next issue |
|
|
121
|
+
| Executor impl failure | Report to coordinator, continue with next EXEC-* task |
|
|
122
|
+
| Pipeline stall | Coordinator monitors, escalate to user |
|
|
123
|
+
| Worker no response | Report waiting task, suggest user `resume` |
|