claude-code-workflow 7.2.30 → 7.3.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.
- package/.claude/commands/workflow-skill.md +130 -0
- package/.claude/skills/ccw-chain/SKILL.md +44 -71
- package/.claude/skills/ccw-chain/chains/ccw-cycle.json +13 -3
- package/.claude/skills/ccw-chain/chains/ccw-exploration.json +33 -22
- package/.claude/skills/ccw-chain/chains/ccw-issue.json +23 -12
- package/.claude/skills/ccw-chain/chains/ccw-lightweight.json +23 -9
- package/.claude/skills/ccw-chain/chains/ccw-main.json +15 -2
- package/.claude/skills/ccw-chain/chains/ccw-standard.json +28 -16
- package/.claude/skills/ccw-chain/chains/ccw-team.json +7 -2
- package/.claude/skills/ccw-chain/chains/ccw-with-file.json +25 -9
- package/.claude/skills/chain-loader/phases/01-analyze-skill.md +53 -53
- package/.claude/skills/chain-loader/specs/chain-schema.md +30 -3
- package/.claude/skills/chain-loader/templates/chain-json.md +63 -63
- package/.claude/skills/workflow-plan/SKILL.md +1 -0
- package/.claude/skills/workflow-plan/phases/01-session-discovery.md +19 -2
- package/.claude/skills/workflow-plan/phases/02-context-gathering.md +2 -2
- package/.claude/skills/workflow-plan/phases/04-task-generation.md +9 -1
- package/.codex/skills/analyze-with-file/SKILL.md +383 -134
- package/.codex/skills/brainstorm/SKILL.md +3 -3
- package/.codex/skills/brainstorm-with-file/SKILL.md +208 -88
- package/.codex/skills/clean/SKILL.md +1 -1
- package/.codex/skills/csv-wave-pipeline/SKILL.md +2 -2
- package/.codex/skills/investigate/orchestrator.md +24 -0
- package/.codex/skills/issue-discover/SKILL.md +374 -361
- package/.codex/skills/issue-discover/phases/01-issue-new.md +1 -1
- package/.codex/skills/issue-discover/phases/02-discover.md +2 -2
- package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +1 -1
- package/.codex/skills/issue-discover/phases/04-quick-execute.md +2 -2
- package/.codex/skills/parallel-dev-cycle/SKILL.md +44 -37
- package/.codex/skills/project-documentation-workflow/SKILL.md +1 -1
- package/.codex/skills/review-cycle/SKILL.md +31 -12
- package/.codex/skills/roadmap-with-file/SKILL.md +141 -133
- package/.codex/skills/security-audit/orchestrator.md +29 -0
- package/.codex/skills/session-sync/SKILL.md +1 -1
- package/.codex/skills/ship/orchestrator.md +24 -0
- package/.codex/skills/spec-add/SKILL.md +5 -5
- package/.codex/skills/spec-generator/SKILL.md +33 -2
- package/.codex/skills/spec-generator/phases/01-5-requirement-clarification.md +3 -3
- package/.codex/skills/spec-generator/phases/01-discovery.md +1 -1
- package/.codex/skills/spec-generator/phases/02-product-brief.md +1 -1
- package/.codex/skills/spec-generator/phases/03-requirements.md +1 -1
- package/.codex/skills/spec-generator/phases/04-architecture.md +1 -1
- package/.codex/skills/spec-generator/phases/05-epics-stories.md +1 -1
- package/.codex/skills/spec-generator/phases/06-readiness-check.md +1 -1
- package/.codex/skills/spec-generator/phases/07-issue-export.md +1 -1
- package/.codex/skills/spec-setup/SKILL.md +669 -669
- package/.codex/skills/team-arch-opt/specs/team-config.json +1 -1
- package/.codex/skills/team-brainstorm/SKILL.md +259 -259
- package/.codex/skills/team-coordinate/SKILL.md +359 -359
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-designer/SKILL.md +27 -1
- package/.codex/skills/team-designer/phases/01-requirements-analysis.md +2 -2
- package/.codex/skills/team-designer/phases/02-scaffold-generation.md +1 -1
- package/.codex/skills/team-designer/phases/04-validation.md +1 -1
- package/.codex/skills/team-executor/SKILL.md +218 -218
- package/.codex/skills/team-frontend/SKILL.md +227 -227
- package/.codex/skills/team-frontend-debug/SKILL.md +278 -278
- package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +2 -2
- package/.codex/skills/team-interactive-craft/SKILL.md +220 -220
- package/.codex/skills/team-interactive-craft/roles/coordinator/role.md +209 -209
- package/.codex/skills/team-issue/SKILL.md +269 -269
- package/.codex/skills/team-issue/roles/coordinator/role.md +1 -1
- package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -305
- package/.codex/skills/team-motion-design/SKILL.md +222 -222
- package/.codex/skills/team-motion-design/roles/coordinator/role.md +210 -210
- package/.codex/skills/team-perf-opt/SKILL.md +258 -258
- package/.codex/skills/team-perf-opt/specs/team-config.json +1 -1
- package/.codex/skills/team-planex/SKILL.md +216 -216
- package/.codex/skills/team-quality-assurance/SKILL.md +229 -229
- package/.codex/skills/team-review/SKILL.md +227 -227
- package/.codex/skills/team-roadmap-dev/SKILL.md +238 -238
- package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/roadmap-discuss.md +5 -5
- package/.codex/skills/team-tech-debt/SKILL.md +206 -206
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-testing/SKILL.md +237 -237
- package/.codex/skills/team-ui-polish/SKILL.md +218 -218
- package/.codex/skills/team-ui-polish/roles/coordinator/role.md +213 -213
- package/.codex/skills/team-uidesign/SKILL.md +219 -219
- package/.codex/skills/team-uidesign/roles/coordinator/role.md +2 -2
- package/.codex/skills/team-ultra-analyze/SKILL.md +260 -260
- package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +1 -1
- package/.codex/skills/team-ux-improve/SKILL.md +227 -227
- package/.codex/skills/team-ux-improve/roles/coordinator/role.md +1 -1
- package/.codex/skills/team-ux-improve/specs/team-config.json +1 -1
- package/.codex/skills/team-visual-a11y/SKILL.md +319 -319
- package/.codex/skills/team-visual-a11y/roles/coordinator/role.md +213 -213
- package/.codex/skills/workflow-execute/SKILL.md +5 -5
- package/.codex/skills/workflow-lite-planex/SKILL.md +3 -3
- package/.codex/skills/workflow-plan/SKILL.md +3 -3
- package/.codex/skills/workflow-tdd-plan/SKILL.md +4 -4
- package/.codex/skills/workflow-test-fix-cycle/SKILL.md +403 -402
- package/ccw/dist/cli.d.ts.map +1 -1
- package/ccw/dist/cli.js +16 -0
- package/ccw/dist/cli.js.map +1 -1
- package/ccw/dist/commands/chain-loader.d.ts +2 -0
- package/ccw/dist/commands/chain-loader.d.ts.map +1 -0
- package/ccw/dist/commands/chain-loader.js +11 -0
- package/ccw/dist/commands/chain-loader.js.map +1 -0
- package/ccw/dist/commands/install.d.ts.map +1 -1
- package/ccw/dist/commands/install.js +52 -1
- package/ccw/dist/commands/install.js.map +1 -1
- package/ccw/dist/commands/launcher.d.ts +2 -0
- package/ccw/dist/commands/launcher.d.ts.map +1 -0
- package/ccw/dist/commands/launcher.js +434 -0
- package/ccw/dist/commands/launcher.js.map +1 -0
- package/ccw/dist/tools/chain-loader.d.ts.map +1 -1
- package/ccw/dist/tools/chain-loader.js +457 -45
- package/ccw/dist/tools/chain-loader.js.map +1 -1
- package/ccw/dist/tools/skill-context-loader.d.ts.map +1 -1
- package/ccw/dist/tools/skill-context-loader.js +12 -26
- package/ccw/dist/tools/skill-context-loader.js.map +1 -1
- package/ccw/dist/types/chain-types.d.ts +41 -1
- package/ccw/dist/types/chain-types.d.ts.map +1 -1
- package/ccw/dist/utils/chain-visualizer.d.ts +13 -0
- package/ccw/dist/utils/chain-visualizer.d.ts.map +1 -0
- package/ccw/dist/utils/chain-visualizer.js +164 -0
- package/ccw/dist/utils/chain-visualizer.js.map +1 -0
- package/package.json +1 -1
- package/.claude/commands/cli/cli-init.md +0 -441
- package/.claude/commands/cli/codex-review.md +0 -361
- package/.claude/commands/flow-create.md +0 -663
- package/.claude/skills/ccw-chain/phases/analyze-with-file.md +0 -788
- package/.claude/skills/ccw-chain/phases/brainstorm/SKILL.md +0 -408
- package/.claude/skills/ccw-chain/phases/brainstorm/phases/01-mode-routing.md +0 -207
- package/.claude/skills/ccw-chain/phases/brainstorm/phases/02-artifacts.md +0 -567
- package/.claude/skills/ccw-chain/phases/brainstorm/phases/03-role-analysis.md +0 -748
- package/.claude/skills/ccw-chain/phases/brainstorm/phases/04-synthesis.md +0 -827
- package/.claude/skills/ccw-chain/phases/brainstorm-with-file.md +0 -482
- package/.claude/skills/ccw-chain/phases/collaborative-plan-with-file.md +0 -639
- package/.claude/skills/ccw-chain/phases/debug-with-file.md +0 -656
- package/.claude/skills/ccw-chain/phases/integration-test-cycle.md +0 -936
- package/.claude/skills/ccw-chain/phases/issue-convert-to-plan.md +0 -720
- package/.claude/skills/ccw-chain/phases/issue-discover.md +0 -483
- package/.claude/skills/ccw-chain/phases/issue-execute.md +0 -629
- package/.claude/skills/ccw-chain/phases/issue-from-brainstorm.md +0 -382
- package/.claude/skills/ccw-chain/phases/issue-plan.md +0 -343
- package/.claude/skills/ccw-chain/phases/issue-queue.md +0 -464
- package/.claude/skills/ccw-chain/phases/refactor-cycle.md +0 -852
- package/.claude/skills/ccw-chain/phases/review-cycle/SKILL.md +0 -132
- package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-fix.md +0 -760
- package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-module.md +0 -764
- package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-session.md +0 -775
- package/.claude/skills/ccw-chain/phases/roadmap-with-file.md +0 -544
- package/.claude/skills/ccw-chain/phases/spec-generator/SKILL.md +0 -338
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/01-5-requirement-clarification.md +0 -404
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/01-discovery.md +0 -257
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/02-product-brief.md +0 -274
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/03-requirements.md +0 -184
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/04-architecture.md +0 -248
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/05-epics-stories.md +0 -178
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/06-5-auto-fix.md +0 -144
- package/.claude/skills/ccw-chain/phases/spec-generator/phases/06-readiness-check.md +0 -480
- package/.claude/skills/ccw-chain/phases/team-planex.md +0 -123
- package/.claude/skills/ccw-chain/phases/ui-design-explore-auto.md +0 -678
- package/.claude/skills/ccw-chain/phases/unified-execute-with-file.md +0 -870
- package/.claude/skills/ccw-chain/phases/workflow-execute/SKILL.md +0 -625
- package/.claude/skills/ccw-chain/phases/workflow-execute/phases/06-review.md +0 -215
- package/.claude/skills/ccw-chain/phases/workflow-lite-plan.md +0 -616
- package/.claude/skills/ccw-chain/phases/workflow-multi-cli-plan.md +0 -424
- package/.claude/skills/ccw-chain/phases/workflow-plan/SKILL.md +0 -466
- package/.claude/skills/ccw-chain/phases/workflow-plan/phases/01-session-discovery.md +0 -99
- package/.claude/skills/ccw-chain/phases/workflow-plan/phases/02-context-gathering.md +0 -338
- package/.claude/skills/ccw-chain/phases/workflow-plan/phases/03-conflict-resolution.md +0 -422
- package/.claude/skills/ccw-chain/phases/workflow-plan/phases/04-task-generation.md +0 -440
- package/.claude/skills/ccw-chain/phases/workflow-plan/phases/05-plan-verify.md +0 -395
- package/.claude/skills/ccw-chain/phases/workflow-plan/phases/06-replan.md +0 -594
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/SKILL.md +0 -527
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/01-session-discovery.md +0 -57
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/02-context-gathering.md +0 -407
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/03-test-coverage-analysis.md +0 -172
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/04-conflict-resolution.md +0 -426
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/05-tdd-task-generation.md +0 -473
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/06-tdd-structure-validation.md +0 -189
- package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/07-tdd-verify.md +0 -635
- package/.claude/skills/ccw-chain/phases/workflow-test-fix/SKILL.md +0 -482
- package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/01-session-start.md +0 -60
- package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/02-test-context-gather.md +0 -493
- package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/03-test-concept-enhanced.md +0 -150
- package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/04-test-task-generate.md +0 -346
- package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/05-test-cycle-execute.md +0 -538
- package/.claude/skills/ccw-chain/specs/intent-patterns.md +0 -60
- package/.claude/skills/team-edict.zip +0 -0
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
# Phase 2: Product Brief
|
|
2
|
-
|
|
3
|
-
Generate a product brief through multi-perspective CLI analysis, establishing "what" and "why".
|
|
4
|
-
|
|
5
|
-
## Objective
|
|
6
|
-
|
|
7
|
-
- Read Phase 1 outputs (spec-config.json, discovery-context.json)
|
|
8
|
-
- Launch 3 parallel CLI analyses from product, technical, and user perspectives
|
|
9
|
-
- Synthesize convergent themes and conflicting views
|
|
10
|
-
- Optionally refine with user input
|
|
11
|
-
- Generate product-brief.md using template
|
|
12
|
-
|
|
13
|
-
## Input
|
|
14
|
-
|
|
15
|
-
- Dependency: `{workDir}/spec-config.json`
|
|
16
|
-
- Primary: `{workDir}/refined-requirements.json` (Phase 1.5 output, preferred over raw seed_analysis)
|
|
17
|
-
- Optional: `{workDir}/discovery-context.json`
|
|
18
|
-
- Config: `{workDir}/spec-config.json`
|
|
19
|
-
- Template: `templates/product-brief.md`
|
|
20
|
-
|
|
21
|
-
## Execution Steps
|
|
22
|
-
|
|
23
|
-
### Step 1: Load Phase 1 Context
|
|
24
|
-
|
|
25
|
-
```javascript
|
|
26
|
-
const specConfig = JSON.parse(Read(`${workDir}/spec-config.json`));
|
|
27
|
-
const { seed_analysis, seed_input, has_codebase, depth, focus_areas } = specConfig;
|
|
28
|
-
|
|
29
|
-
// Load refined requirements (Phase 1.5 output) - preferred over raw seed_analysis
|
|
30
|
-
let refinedReqs = null;
|
|
31
|
-
try {
|
|
32
|
-
refinedReqs = JSON.parse(Read(`${workDir}/refined-requirements.json`));
|
|
33
|
-
} catch (e) {
|
|
34
|
-
// No refined requirements, fall back to seed_analysis
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
let discoveryContext = null;
|
|
38
|
-
if (has_codebase) {
|
|
39
|
-
try {
|
|
40
|
-
discoveryContext = JSON.parse(Read(`${workDir}/discovery-context.json`));
|
|
41
|
-
} catch (e) {
|
|
42
|
-
// No discovery context available, proceed without
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Build shared context string for CLI prompts
|
|
47
|
-
// Prefer refined requirements over raw seed_analysis
|
|
48
|
-
const problem = refinedReqs?.clarified_problem_statement || seed_analysis.problem_statement;
|
|
49
|
-
const users = refinedReqs?.confirmed_target_users?.map(u => u.name || u).join(', ')
|
|
50
|
-
|| seed_analysis.target_users.join(', ');
|
|
51
|
-
const domain = refinedReqs?.confirmed_domain || seed_analysis.domain;
|
|
52
|
-
const constraints = refinedReqs?.boundary_conditions?.constraints?.join(', ')
|
|
53
|
-
|| seed_analysis.constraints.join(', ');
|
|
54
|
-
const features = refinedReqs?.confirmed_features?.map(f => f.name).join(', ') || '';
|
|
55
|
-
const nfrs = refinedReqs?.non_functional_requirements?.map(n => `${n.type}: ${n.details}`).join('; ') || '';
|
|
56
|
-
|
|
57
|
-
const sharedContext = `
|
|
58
|
-
SEED: ${seed_input}
|
|
59
|
-
PROBLEM: ${problem}
|
|
60
|
-
TARGET USERS: ${users}
|
|
61
|
-
DOMAIN: ${domain}
|
|
62
|
-
CONSTRAINTS: ${constraints}
|
|
63
|
-
FOCUS AREAS: ${focus_areas.join(', ')}
|
|
64
|
-
${features ? `CONFIRMED FEATURES: ${features}` : ''}
|
|
65
|
-
${nfrs ? `NON-FUNCTIONAL REQUIREMENTS: ${nfrs}` : ''}
|
|
66
|
-
${discoveryContext ? `
|
|
67
|
-
CODEBASE CONTEXT:
|
|
68
|
-
- Existing patterns: ${discoveryContext.existing_patterns?.slice(0,5).join(', ') || 'none'}
|
|
69
|
-
- Architecture constraints: ${discoveryContext.architecture_constraints?.slice(0,3).join(', ') || 'none'}
|
|
70
|
-
- Tech stack: ${JSON.stringify(discoveryContext.tech_stack || {})}
|
|
71
|
-
` : ''}`;
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### Step 2: Multi-CLI Parallel Analysis (3 perspectives)
|
|
75
|
-
|
|
76
|
-
Launch 3 CLI calls in parallel:
|
|
77
|
-
|
|
78
|
-
**Product Perspective (Gemini)**:
|
|
79
|
-
```javascript
|
|
80
|
-
Bash({
|
|
81
|
-
command: `ccw cli -p "PURPOSE: Product analysis for specification - identify market fit, user value, and success criteria.
|
|
82
|
-
Success: Clear vision, measurable goals, competitive positioning.
|
|
83
|
-
|
|
84
|
-
${sharedContext}
|
|
85
|
-
|
|
86
|
-
TASK:
|
|
87
|
-
- Define product vision (1-3 sentences, aspirational)
|
|
88
|
-
- Analyze market/competitive landscape
|
|
89
|
-
- Define 3-5 measurable success metrics
|
|
90
|
-
- Identify scope boundaries (in-scope vs out-of-scope)
|
|
91
|
-
- Assess user value proposition
|
|
92
|
-
- List assumptions that need validation
|
|
93
|
-
|
|
94
|
-
MODE: analysis
|
|
95
|
-
EXPECTED: Structured product analysis with: vision, goals with metrics, scope, competitive positioning, assumptions
|
|
96
|
-
CONSTRAINTS: Focus on 'what' and 'why', not 'how'
|
|
97
|
-
" --tool gemini --mode analysis`,
|
|
98
|
-
run_in_background: true
|
|
99
|
-
});
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
**Technical Perspective (Codex)**:
|
|
103
|
-
```javascript
|
|
104
|
-
Bash({
|
|
105
|
-
command: `ccw cli -p "PURPOSE: Technical feasibility analysis for specification - assess implementation viability and constraints.
|
|
106
|
-
Success: Clear technical constraints, integration complexity, technology recommendations.
|
|
107
|
-
|
|
108
|
-
${sharedContext}
|
|
109
|
-
|
|
110
|
-
TASK:
|
|
111
|
-
- Assess technical feasibility of the core concept
|
|
112
|
-
- Identify technical constraints and blockers
|
|
113
|
-
- Evaluate integration complexity with existing systems
|
|
114
|
-
- Recommend technology approach (high-level)
|
|
115
|
-
- Identify technical risks and dependencies
|
|
116
|
-
- Estimate complexity: simple/moderate/complex
|
|
117
|
-
|
|
118
|
-
MODE: analysis
|
|
119
|
-
EXPECTED: Technical analysis with: feasibility assessment, constraints, integration complexity, tech recommendations, risks
|
|
120
|
-
CONSTRAINTS: Focus on feasibility and constraints, not detailed architecture
|
|
121
|
-
" --tool codex --mode analysis`,
|
|
122
|
-
run_in_background: true
|
|
123
|
-
});
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
**User Perspective (Claude)**:
|
|
127
|
-
```javascript
|
|
128
|
-
Bash({
|
|
129
|
-
command: `ccw cli -p "PURPOSE: User experience analysis for specification - understand user journeys, pain points, and UX considerations.
|
|
130
|
-
Success: Clear user personas, journey maps, UX requirements.
|
|
131
|
-
|
|
132
|
-
${sharedContext}
|
|
133
|
-
|
|
134
|
-
TASK:
|
|
135
|
-
- Elaborate user personas with goals and frustrations
|
|
136
|
-
- Map primary user journey (happy path)
|
|
137
|
-
- Identify key pain points in current experience
|
|
138
|
-
- Define UX success criteria
|
|
139
|
-
- List accessibility and usability considerations
|
|
140
|
-
- Suggest interaction patterns
|
|
141
|
-
|
|
142
|
-
MODE: analysis
|
|
143
|
-
EXPECTED: User analysis with: personas, journey map, pain points, UX criteria, interaction recommendations
|
|
144
|
-
CONSTRAINTS: Focus on user needs and experience, not implementation
|
|
145
|
-
" --tool claude --mode analysis`,
|
|
146
|
-
run_in_background: true
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
// STOP: Wait for all 3 CLI results before continuing
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Step 3: Synthesize Perspectives
|
|
153
|
-
|
|
154
|
-
```javascript
|
|
155
|
-
// After receiving all 3 CLI results:
|
|
156
|
-
// Extract convergent themes (all agree)
|
|
157
|
-
// Identify conflicting views (need resolution)
|
|
158
|
-
// Note unique contributions from each perspective
|
|
159
|
-
|
|
160
|
-
const synthesis = {
|
|
161
|
-
convergent_themes: [], // themes all 3 perspectives agree on
|
|
162
|
-
conflicts: [], // areas where perspectives differ
|
|
163
|
-
product_insights: [], // unique from product perspective
|
|
164
|
-
technical_insights: [], // unique from technical perspective
|
|
165
|
-
user_insights: [] // unique from user perspective
|
|
166
|
-
};
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Step 4: Interactive Refinement (Optional)
|
|
170
|
-
|
|
171
|
-
```javascript
|
|
172
|
-
if (!autoMode) {
|
|
173
|
-
// Present synthesis summary to user
|
|
174
|
-
// AskUserQuestion with:
|
|
175
|
-
// - Confirm vision statement
|
|
176
|
-
// - Resolve any conflicts between perspectives
|
|
177
|
-
// - Adjust scope if needed
|
|
178
|
-
AskUserQuestion({
|
|
179
|
-
questions: [
|
|
180
|
-
{
|
|
181
|
-
question: "Review the synthesized product brief. Any adjustments needed?",
|
|
182
|
-
header: "Review",
|
|
183
|
-
multiSelect: false,
|
|
184
|
-
options: [
|
|
185
|
-
{ label: "Looks good", description: "Proceed to PRD generation" },
|
|
186
|
-
{ label: "Adjust scope", description: "Narrow or expand the scope" },
|
|
187
|
-
{ label: "Revise vision", description: "Refine the vision statement" }
|
|
188
|
-
]
|
|
189
|
-
}
|
|
190
|
-
]
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### Step 5: Generate product-brief.md
|
|
196
|
-
|
|
197
|
-
```javascript
|
|
198
|
-
// Read template
|
|
199
|
-
const template = Read('templates/product-brief.md');
|
|
200
|
-
|
|
201
|
-
// Fill template with synthesized content
|
|
202
|
-
// Apply document-standards.md formatting rules
|
|
203
|
-
// Write with YAML frontmatter
|
|
204
|
-
|
|
205
|
-
const frontmatter = `---
|
|
206
|
-
session_id: ${specConfig.session_id}
|
|
207
|
-
phase: 2
|
|
208
|
-
document_type: product-brief
|
|
209
|
-
status: ${autoMode ? 'complete' : 'draft'}
|
|
210
|
-
generated_at: ${new Date().toISOString()}
|
|
211
|
-
stepsCompleted: ["load-context", "multi-cli-analysis", "synthesis", "generation"]
|
|
212
|
-
version: 1
|
|
213
|
-
dependencies:
|
|
214
|
-
- spec-config.json
|
|
215
|
-
---`;
|
|
216
|
-
|
|
217
|
-
// Combine frontmatter + filled template content
|
|
218
|
-
Write(`${workDir}/product-brief.md`, `${frontmatter}\n\n${filledContent}`);
|
|
219
|
-
|
|
220
|
-
// Update spec-config.json
|
|
221
|
-
specConfig.phasesCompleted.push({
|
|
222
|
-
phase: 2,
|
|
223
|
-
name: "product-brief",
|
|
224
|
-
output_file: "product-brief.md",
|
|
225
|
-
completed_at: new Date().toISOString()
|
|
226
|
-
});
|
|
227
|
-
Write(`${workDir}/spec-config.json`, JSON.stringify(specConfig, null, 2));
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
### Step 5.5: Generate glossary.json
|
|
231
|
-
|
|
232
|
-
```javascript
|
|
233
|
-
// Extract terminology from product brief and CLI analysis
|
|
234
|
-
// Generate structured glossary for cross-document consistency
|
|
235
|
-
|
|
236
|
-
const glossary = {
|
|
237
|
-
session_id: specConfig.session_id,
|
|
238
|
-
terms: [
|
|
239
|
-
// Extract from product brief content:
|
|
240
|
-
// - Key domain nouns from problem statement
|
|
241
|
-
// - User persona names
|
|
242
|
-
// - Technical terms from multi-perspective synthesis
|
|
243
|
-
// Each term should have:
|
|
244
|
-
// { term: "...", definition: "...", aliases: [], first_defined_in: "product-brief.md", category: "core|technical|business" }
|
|
245
|
-
]
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
Write(`${workDir}/glossary.json`, JSON.stringify(glossary, null, 2));
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
**Glossary Injection**: In all subsequent phase prompts, inject the following into the CONTEXT section:
|
|
252
|
-
```
|
|
253
|
-
TERMINOLOGY GLOSSARY (use these terms consistently):
|
|
254
|
-
${JSON.stringify(glossary.terms, null, 2)}
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
## Output
|
|
258
|
-
|
|
259
|
-
- **File**: `product-brief.md`
|
|
260
|
-
- **Format**: Markdown with YAML frontmatter
|
|
261
|
-
|
|
262
|
-
## Quality Checklist
|
|
263
|
-
|
|
264
|
-
- [ ] Vision statement: clear, 1-3 sentences
|
|
265
|
-
- [ ] Problem statement: specific and measurable
|
|
266
|
-
- [ ] Target users: >= 1 persona with needs
|
|
267
|
-
- [ ] Goals: >= 2 with measurable metrics
|
|
268
|
-
- [ ] Scope: in-scope and out-of-scope defined
|
|
269
|
-
- [ ] Multi-perspective synthesis included
|
|
270
|
-
- [ ] YAML frontmatter valid
|
|
271
|
-
|
|
272
|
-
## Next Phase
|
|
273
|
-
|
|
274
|
-
Proceed to [Phase 3: Requirements](03-requirements.md) with the generated product-brief.md.
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
# Phase 3: Requirements (PRD)
|
|
2
|
-
|
|
3
|
-
Generate a detailed Product Requirements Document with functional/non-functional requirements, acceptance criteria, and MoSCoW prioritization.
|
|
4
|
-
|
|
5
|
-
## Objective
|
|
6
|
-
|
|
7
|
-
- Read product-brief.md and extract goals, scope, constraints
|
|
8
|
-
- Expand each goal into functional requirements with acceptance criteria
|
|
9
|
-
- Generate non-functional requirements
|
|
10
|
-
- Apply MoSCoW priority labels (user input or auto)
|
|
11
|
-
- Generate requirements.md using template
|
|
12
|
-
|
|
13
|
-
## Input
|
|
14
|
-
|
|
15
|
-
- Dependency: `{workDir}/product-brief.md`
|
|
16
|
-
- Config: `{workDir}/spec-config.json`
|
|
17
|
-
- Template: `templates/requirements-prd.md` (directory structure: `_index.md` + `REQ-*.md` + `NFR-*.md`)
|
|
18
|
-
|
|
19
|
-
## Execution Steps
|
|
20
|
-
|
|
21
|
-
### Step 1: Load Phase 2 Context
|
|
22
|
-
|
|
23
|
-
```javascript
|
|
24
|
-
const specConfig = JSON.parse(Read(`${workDir}/spec-config.json`));
|
|
25
|
-
const productBrief = Read(`${workDir}/product-brief.md`);
|
|
26
|
-
|
|
27
|
-
// Extract key sections from product brief
|
|
28
|
-
// - Goals & Success Metrics table
|
|
29
|
-
// - Scope (in-scope items)
|
|
30
|
-
// - Target Users (personas)
|
|
31
|
-
// - Constraints
|
|
32
|
-
// - Technical perspective insights
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Step 2: Requirements Expansion via Gemini CLI
|
|
36
|
-
|
|
37
|
-
```javascript
|
|
38
|
-
Bash({
|
|
39
|
-
command: `ccw cli -p "PURPOSE: Generate detailed functional and non-functional requirements from product brief.
|
|
40
|
-
Success: Complete PRD with testable acceptance criteria for every requirement.
|
|
41
|
-
|
|
42
|
-
PRODUCT BRIEF CONTEXT:
|
|
43
|
-
${productBrief}
|
|
44
|
-
|
|
45
|
-
TASK:
|
|
46
|
-
- For each goal in the product brief, generate 3-7 functional requirements
|
|
47
|
-
- Each requirement must have:
|
|
48
|
-
- Unique ID: REQ-NNN (zero-padded)
|
|
49
|
-
- Clear title
|
|
50
|
-
- Detailed description
|
|
51
|
-
- User story: As a [persona], I want [action] so that [benefit]
|
|
52
|
-
- 2-4 specific, testable acceptance criteria
|
|
53
|
-
- Generate non-functional requirements:
|
|
54
|
-
- Performance (response times, throughput)
|
|
55
|
-
- Security (authentication, authorization, data protection)
|
|
56
|
-
- Scalability (user load, data volume)
|
|
57
|
-
- Usability (accessibility, learnability)
|
|
58
|
-
- Assign initial MoSCoW priority based on:
|
|
59
|
-
- Must: Core functionality, cannot launch without
|
|
60
|
-
- Should: Important but has workaround
|
|
61
|
-
- Could: Nice-to-have, enhances experience
|
|
62
|
-
- Won't: Explicitly deferred
|
|
63
|
-
- Use RFC 2119 keywords (MUST, SHOULD, MAY, MUST NOT, SHOULD NOT) to define behavioral constraints for each requirement. Example: 'The system MUST return a 401 response within 100ms for invalid tokens.'
|
|
64
|
-
- For each core domain entity referenced in requirements, define its data model: fields, types, constraints, and relationships to other entities
|
|
65
|
-
- Maintain terminology consistency with the glossary below:
|
|
66
|
-
TERMINOLOGY GLOSSARY:
|
|
67
|
-
\${glossary ? JSON.stringify(glossary.terms, null, 2) : 'N/A - generate terms inline'}
|
|
68
|
-
|
|
69
|
-
MODE: analysis
|
|
70
|
-
EXPECTED: Structured requirements with: ID, title, description, user story, acceptance criteria, priority, traceability to goals
|
|
71
|
-
CONSTRAINTS: Every requirement must be specific enough to estimate and test. No vague requirements like 'system should be fast'.
|
|
72
|
-
" --tool gemini --mode analysis`,
|
|
73
|
-
run_in_background: true
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// Wait for CLI result
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Step 3: User Priority Sorting (Interactive)
|
|
80
|
-
|
|
81
|
-
```javascript
|
|
82
|
-
if (!autoMode) {
|
|
83
|
-
// Present requirements grouped by initial priority
|
|
84
|
-
// Allow user to adjust MoSCoW labels
|
|
85
|
-
AskUserQuestion({
|
|
86
|
-
questions: [
|
|
87
|
-
{
|
|
88
|
-
question: "Review the Must-Have requirements. Any that should be reprioritized?",
|
|
89
|
-
header: "Must-Have",
|
|
90
|
-
multiSelect: false,
|
|
91
|
-
options: [
|
|
92
|
-
{ label: "All correct", description: "Must-have requirements are accurate" },
|
|
93
|
-
{ label: "Too many", description: "Some should be Should/Could" },
|
|
94
|
-
{ label: "Missing items", description: "Some Should requirements should be Must" }
|
|
95
|
-
]
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
question: "What is the target MVP scope?",
|
|
99
|
-
header: "MVP Scope",
|
|
100
|
-
multiSelect: false,
|
|
101
|
-
options: [
|
|
102
|
-
{ label: "Must-Have only (Recommended)", description: "MVP includes only Must requirements" },
|
|
103
|
-
{ label: "Must + key Should", description: "Include critical Should items in MVP" },
|
|
104
|
-
{ label: "Comprehensive", description: "Include all Must and Should" }
|
|
105
|
-
]
|
|
106
|
-
}
|
|
107
|
-
]
|
|
108
|
-
});
|
|
109
|
-
// Apply user adjustments to priorities
|
|
110
|
-
} else {
|
|
111
|
-
// Auto mode: accept CLI-suggested priorities as-is
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### Step 4: Generate requirements/ directory
|
|
116
|
-
|
|
117
|
-
```javascript
|
|
118
|
-
// Read template
|
|
119
|
-
const template = Read('templates/requirements-prd.md');
|
|
120
|
-
|
|
121
|
-
// Create requirements directory
|
|
122
|
-
Bash(`mkdir -p "${workDir}/requirements"`);
|
|
123
|
-
|
|
124
|
-
const status = autoMode ? 'complete' : 'draft';
|
|
125
|
-
const timestamp = new Date().toISOString();
|
|
126
|
-
|
|
127
|
-
// Parse CLI output into structured requirements
|
|
128
|
-
const funcReqs = parseFunctionalRequirements(cliOutput); // [{id, slug, title, priority, ...}]
|
|
129
|
-
const nfReqs = parseNonFunctionalRequirements(cliOutput); // [{id, type, slug, title, ...}]
|
|
130
|
-
|
|
131
|
-
// Step 4a: Write individual REQ-*.md files (one per functional requirement)
|
|
132
|
-
funcReqs.forEach(req => {
|
|
133
|
-
// Use REQ-NNN-{slug}.md template from templates/requirements-prd.md
|
|
134
|
-
// Fill: id, title, priority, description, user_story, acceptance_criteria, traces
|
|
135
|
-
Write(`${workDir}/requirements/REQ-${req.id}-${req.slug}.md`, reqContent);
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
// Step 4b: Write individual NFR-*.md files (one per non-functional requirement)
|
|
139
|
-
nfReqs.forEach(nfr => {
|
|
140
|
-
// Use NFR-{type}-NNN-{slug}.md template from templates/requirements-prd.md
|
|
141
|
-
// Fill: id, type, category, title, requirement, metric, target, traces
|
|
142
|
-
Write(`${workDir}/requirements/NFR-${nfr.type}-${nfr.id}-${nfr.slug}.md`, nfrContent);
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
// Step 4c: Write _index.md (summary + links to all individual files)
|
|
146
|
-
// Use _index.md template from templates/requirements-prd.md
|
|
147
|
-
// Fill: summary table, functional req links table, NFR links tables,
|
|
148
|
-
// data requirements, integration requirements, traceability matrix
|
|
149
|
-
Write(`${workDir}/requirements/_index.md`, indexContent);
|
|
150
|
-
|
|
151
|
-
// Update spec-config.json
|
|
152
|
-
specConfig.phasesCompleted.push({
|
|
153
|
-
phase: 3,
|
|
154
|
-
name: "requirements",
|
|
155
|
-
output_dir: "requirements/",
|
|
156
|
-
output_index: "requirements/_index.md",
|
|
157
|
-
file_count: funcReqs.length + nfReqs.length + 1,
|
|
158
|
-
completed_at: timestamp
|
|
159
|
-
});
|
|
160
|
-
Write(`${workDir}/spec-config.json`, JSON.stringify(specConfig, null, 2));
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
## Output
|
|
164
|
-
|
|
165
|
-
- **Directory**: `requirements/`
|
|
166
|
-
- `_index.md` — Summary, MoSCoW table, traceability matrix, links
|
|
167
|
-
- `REQ-NNN-{slug}.md` — Individual functional requirement (per requirement)
|
|
168
|
-
- `NFR-{type}-NNN-{slug}.md` — Individual non-functional requirement (per NFR)
|
|
169
|
-
- **Format**: Markdown with YAML frontmatter, cross-linked via relative paths
|
|
170
|
-
|
|
171
|
-
## Quality Checklist
|
|
172
|
-
|
|
173
|
-
- [ ] Functional requirements: >= 3 with REQ-NNN IDs, each in own file
|
|
174
|
-
- [ ] Every requirement file has >= 1 acceptance criterion
|
|
175
|
-
- [ ] Every requirement has MoSCoW priority tag in frontmatter
|
|
176
|
-
- [ ] Non-functional requirements: >= 1, each in own file
|
|
177
|
-
- [ ] User stories present for Must-have requirements
|
|
178
|
-
- [ ] `_index.md` links to all individual requirement files
|
|
179
|
-
- [ ] Traceability links to product-brief.md goals
|
|
180
|
-
- [ ] All files have valid YAML frontmatter
|
|
181
|
-
|
|
182
|
-
## Next Phase
|
|
183
|
-
|
|
184
|
-
Proceed to [Phase 4: Architecture](04-architecture.md) with the generated requirements.md.
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
# Phase 4: Architecture
|
|
2
|
-
|
|
3
|
-
Generate technical architecture decisions, component design, and technology selections based on requirements.
|
|
4
|
-
|
|
5
|
-
## Objective
|
|
6
|
-
|
|
7
|
-
- Analyze requirements to identify core components and system architecture
|
|
8
|
-
- Generate Architecture Decision Records (ADRs) with alternatives
|
|
9
|
-
- Map architecture to existing codebase (if applicable)
|
|
10
|
-
- Challenge architecture via Codex CLI review
|
|
11
|
-
- Generate architecture.md using template
|
|
12
|
-
|
|
13
|
-
## Input
|
|
14
|
-
|
|
15
|
-
- Dependency: `{workDir}/requirements/_index.md` (and individual `REQ-*.md` files)
|
|
16
|
-
- Reference: `{workDir}/product-brief.md`
|
|
17
|
-
- Optional: `{workDir}/discovery-context.json`
|
|
18
|
-
- Config: `{workDir}/spec-config.json`
|
|
19
|
-
- Template: `templates/architecture-doc.md`
|
|
20
|
-
|
|
21
|
-
## Execution Steps
|
|
22
|
-
|
|
23
|
-
### Step 1: Load Phase 2-3 Context
|
|
24
|
-
|
|
25
|
-
```javascript
|
|
26
|
-
const specConfig = JSON.parse(Read(`${workDir}/spec-config.json`));
|
|
27
|
-
const productBrief = Read(`${workDir}/product-brief.md`);
|
|
28
|
-
const requirements = Read(`${workDir}/requirements.md`);
|
|
29
|
-
|
|
30
|
-
let discoveryContext = null;
|
|
31
|
-
if (specConfig.has_codebase) {
|
|
32
|
-
try {
|
|
33
|
-
discoveryContext = JSON.parse(Read(`${workDir}/discovery-context.json`));
|
|
34
|
-
} catch (e) { /* no context */ }
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Load glossary for terminology consistency
|
|
38
|
-
let glossary = null;
|
|
39
|
-
try {
|
|
40
|
-
glossary = JSON.parse(Read(`${workDir}/glossary.json`));
|
|
41
|
-
} catch (e) { /* proceed without */ }
|
|
42
|
-
|
|
43
|
-
// Load spec type profile for specialized sections
|
|
44
|
-
const specType = specConfig.spec_type || 'service';
|
|
45
|
-
let profile = null;
|
|
46
|
-
try {
|
|
47
|
-
profile = Read(`templates/profiles/${specType}-profile.md`);
|
|
48
|
-
} catch (e) { /* use base template only */ }
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Step 2: Architecture Analysis via Gemini CLI
|
|
52
|
-
|
|
53
|
-
```javascript
|
|
54
|
-
Bash({
|
|
55
|
-
command: `ccw cli -p "PURPOSE: Generate technical architecture for the specified requirements.
|
|
56
|
-
Success: Complete component architecture, tech stack, and ADRs with justified decisions.
|
|
57
|
-
|
|
58
|
-
PRODUCT BRIEF (summary):
|
|
59
|
-
${productBrief.slice(0, 3000)}
|
|
60
|
-
|
|
61
|
-
REQUIREMENTS:
|
|
62
|
-
${requirements.slice(0, 5000)}
|
|
63
|
-
|
|
64
|
-
${discoveryContext ? `EXISTING CODEBASE:
|
|
65
|
-
- Tech stack: ${JSON.stringify(discoveryContext.tech_stack || {})}
|
|
66
|
-
- Existing patterns: ${discoveryContext.existing_patterns?.slice(0,5).join('; ') || 'none'}
|
|
67
|
-
- Architecture constraints: ${discoveryContext.architecture_constraints?.slice(0,3).join('; ') || 'none'}
|
|
68
|
-
` : ''}
|
|
69
|
-
|
|
70
|
-
TASK:
|
|
71
|
-
- Define system architecture style (monolith, microservices, serverless, etc.) with justification
|
|
72
|
-
- Identify core components and their responsibilities
|
|
73
|
-
- Create component interaction diagram (Mermaid graph TD format)
|
|
74
|
-
- Specify technology stack: languages, frameworks, databases, infrastructure
|
|
75
|
-
- Generate 2-4 Architecture Decision Records (ADRs):
|
|
76
|
-
- Each ADR: context, decision, 2-3 alternatives with pros/cons, consequences
|
|
77
|
-
- Focus on: data storage, API design, authentication, key technical choices
|
|
78
|
-
- Define data model: key entities and relationships (Mermaid erDiagram format)
|
|
79
|
-
- Identify security architecture: auth, authorization, data protection
|
|
80
|
-
- List API endpoints (high-level)
|
|
81
|
-
${discoveryContext ? '- Map new components to existing codebase modules' : ''}
|
|
82
|
-
- For each core entity with a lifecycle, create an ASCII state machine diagram showing:
|
|
83
|
-
- All states and transitions
|
|
84
|
-
- Trigger events for each transition
|
|
85
|
-
- Side effects of transitions
|
|
86
|
-
- Error states and recovery paths
|
|
87
|
-
- Define a Configuration Model: list all configurable fields with name, type, default value, constraint, and description
|
|
88
|
-
- Define Error Handling strategy:
|
|
89
|
-
- Classify errors (transient/permanent/degraded)
|
|
90
|
-
- Per-component error behavior using RFC 2119 keywords
|
|
91
|
-
- Recovery mechanisms
|
|
92
|
-
- Define Observability requirements:
|
|
93
|
-
- Key metrics (name, type: counter/gauge/histogram, labels)
|
|
94
|
-
- Structured log format and key log events
|
|
95
|
-
- Health check endpoints
|
|
96
|
-
\${profile ? \`
|
|
97
|
-
SPEC TYPE PROFILE REQUIREMENTS (\${specType}):
|
|
98
|
-
\${profile}
|
|
99
|
-
\` : ''}
|
|
100
|
-
\${glossary ? \`
|
|
101
|
-
TERMINOLOGY GLOSSARY (use consistently):
|
|
102
|
-
\${JSON.stringify(glossary.terms, null, 2)}
|
|
103
|
-
\` : ''}
|
|
104
|
-
|
|
105
|
-
MODE: analysis
|
|
106
|
-
EXPECTED: Complete architecture with: style justification, component diagram, tech stack table, ADRs, data model, security controls, API overview
|
|
107
|
-
CONSTRAINTS: Architecture must support all Must-have requirements. Prefer proven technologies over cutting-edge.
|
|
108
|
-
" --tool gemini --mode analysis`,
|
|
109
|
-
run_in_background: true
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
// Wait for CLI result
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### Step 3: Architecture Review via Codex CLI
|
|
116
|
-
|
|
117
|
-
```javascript
|
|
118
|
-
// After receiving Gemini analysis, challenge it with Codex
|
|
119
|
-
Bash({
|
|
120
|
-
command: `ccw cli -p "PURPOSE: Critical review of proposed architecture - identify weaknesses and risks.
|
|
121
|
-
Success: Actionable feedback with specific concerns and improvement suggestions.
|
|
122
|
-
|
|
123
|
-
PROPOSED ARCHITECTURE:
|
|
124
|
-
${geminiArchitectureOutput.slice(0, 5000)}
|
|
125
|
-
|
|
126
|
-
REQUIREMENTS CONTEXT:
|
|
127
|
-
${requirements.slice(0, 2000)}
|
|
128
|
-
|
|
129
|
-
TASK:
|
|
130
|
-
- Challenge each ADR: are the alternatives truly the best options?
|
|
131
|
-
- Identify scalability bottlenecks in the component design
|
|
132
|
-
- Assess security gaps: authentication, authorization, data protection
|
|
133
|
-
- Evaluate technology choices: maturity, community support, fit
|
|
134
|
-
- Check for over-engineering or under-engineering
|
|
135
|
-
- Verify architecture covers all Must-have requirements
|
|
136
|
-
- Rate overall architecture quality: 1-5 with justification
|
|
137
|
-
|
|
138
|
-
MODE: analysis
|
|
139
|
-
EXPECTED: Architecture review with: per-ADR feedback, scalability concerns, security gaps, technology risks, quality rating
|
|
140
|
-
CONSTRAINTS: Be genuinely critical, not just validating. Focus on actionable improvements.
|
|
141
|
-
" --tool codex --mode analysis`,
|
|
142
|
-
run_in_background: true
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
// Wait for CLI result
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### Step 4: Interactive ADR Decisions (Optional)
|
|
149
|
-
|
|
150
|
-
```javascript
|
|
151
|
-
if (!autoMode) {
|
|
152
|
-
// Present ADRs with review feedback to user
|
|
153
|
-
// For each ADR where review raised concerns:
|
|
154
|
-
AskUserQuestion({
|
|
155
|
-
questions: [
|
|
156
|
-
{
|
|
157
|
-
question: "Architecture review raised concerns. How should we proceed?",
|
|
158
|
-
header: "ADR Review",
|
|
159
|
-
multiSelect: false,
|
|
160
|
-
options: [
|
|
161
|
-
{ label: "Accept as-is", description: "Architecture is sound, proceed" },
|
|
162
|
-
{ label: "Incorporate feedback", description: "Adjust ADRs based on review" },
|
|
163
|
-
{ label: "Simplify", description: "Reduce complexity, fewer components" }
|
|
164
|
-
]
|
|
165
|
-
}
|
|
166
|
-
]
|
|
167
|
-
});
|
|
168
|
-
// Apply user decisions to architecture
|
|
169
|
-
}
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### Step 5: Codebase Integration Mapping (Conditional)
|
|
173
|
-
|
|
174
|
-
```javascript
|
|
175
|
-
if (specConfig.has_codebase && discoveryContext) {
|
|
176
|
-
// Map new architecture components to existing code
|
|
177
|
-
const integrationMapping = discoveryContext.relevant_files.map(f => ({
|
|
178
|
-
new_component: "...", // matched from architecture
|
|
179
|
-
existing_module: f.path,
|
|
180
|
-
integration_type: "Extend|Replace|New",
|
|
181
|
-
notes: f.rationale
|
|
182
|
-
}));
|
|
183
|
-
// Include in architecture document
|
|
184
|
-
}
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### Step 6: Generate architecture/ directory
|
|
188
|
-
|
|
189
|
-
```javascript
|
|
190
|
-
const template = Read('templates/architecture-doc.md');
|
|
191
|
-
|
|
192
|
-
// Create architecture directory
|
|
193
|
-
Bash(`mkdir -p "${workDir}/architecture"`);
|
|
194
|
-
|
|
195
|
-
const status = autoMode ? 'complete' : 'draft';
|
|
196
|
-
const timestamp = new Date().toISOString();
|
|
197
|
-
|
|
198
|
-
// Parse CLI outputs into structured ADRs
|
|
199
|
-
const adrs = parseADRs(geminiArchitectureOutput, codexReviewOutput); // [{id, slug, title, ...}]
|
|
200
|
-
|
|
201
|
-
// Step 6a: Write individual ADR-*.md files (one per decision)
|
|
202
|
-
adrs.forEach(adr => {
|
|
203
|
-
// Use ADR-NNN-{slug}.md template from templates/architecture-doc.md
|
|
204
|
-
// Fill: id, title, status, context, decision, alternatives, consequences, traces
|
|
205
|
-
Write(`${workDir}/architecture/ADR-${adr.id}-${adr.slug}.md`, adrContent);
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
// Step 6b: Write _index.md (overview + components + tech stack + links to ADRs)
|
|
209
|
-
// Use _index.md template from templates/architecture-doc.md
|
|
210
|
-
// Fill: system overview, component diagram, tech stack, ADR links table,
|
|
211
|
-
// data model, API design, security controls, infrastructure, codebase integration
|
|
212
|
-
Write(`${workDir}/architecture/_index.md`, indexContent);
|
|
213
|
-
|
|
214
|
-
// Update spec-config.json
|
|
215
|
-
specConfig.phasesCompleted.push({
|
|
216
|
-
phase: 4,
|
|
217
|
-
name: "architecture",
|
|
218
|
-
output_dir: "architecture/",
|
|
219
|
-
output_index: "architecture/_index.md",
|
|
220
|
-
file_count: adrs.length + 1,
|
|
221
|
-
completed_at: timestamp
|
|
222
|
-
});
|
|
223
|
-
Write(`${workDir}/spec-config.json`, JSON.stringify(specConfig, null, 2));
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
## Output
|
|
227
|
-
|
|
228
|
-
- **Directory**: `architecture/`
|
|
229
|
-
- `_index.md` — Overview, component diagram, tech stack, data model, security, links
|
|
230
|
-
- `ADR-NNN-{slug}.md` — Individual Architecture Decision Record (per ADR)
|
|
231
|
-
- **Format**: Markdown with YAML frontmatter, cross-linked to requirements via relative paths
|
|
232
|
-
|
|
233
|
-
## Quality Checklist
|
|
234
|
-
|
|
235
|
-
- [ ] Component diagram present in `_index.md` (Mermaid or ASCII)
|
|
236
|
-
- [ ] Tech stack specified (languages, frameworks, key libraries)
|
|
237
|
-
- [ ] >= 1 ADR file with alternatives considered
|
|
238
|
-
- [ ] Each ADR file lists >= 2 options
|
|
239
|
-
- [ ] `_index.md` ADR table links to all individual ADR files
|
|
240
|
-
- [ ] Integration points identified
|
|
241
|
-
- [ ] Data model described
|
|
242
|
-
- [ ] Codebase mapping present (if has_codebase)
|
|
243
|
-
- [ ] All files have valid YAML frontmatter
|
|
244
|
-
- [ ] ADR files link back to requirement files
|
|
245
|
-
|
|
246
|
-
## Next Phase
|
|
247
|
-
|
|
248
|
-
Proceed to [Phase 5: Epics & Stories](05-epics-stories.md) with the generated architecture.md.
|