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,473 @@
|
|
|
1
|
+
# Phase 5: TDD Task Generation
|
|
2
|
+
|
|
3
|
+
> **📌 COMPACT SENTINEL [Phase 5: TDD-Task-Generation]**
|
|
4
|
+
> This phase contains 3 execution steps (Step 5.1 — 5.3).
|
|
5
|
+
> If you can read this sentinel but cannot find the full Step protocol below, context has been compressed.
|
|
6
|
+
> Recovery: `Read("phases/05-tdd-task-generation.md")`
|
|
7
|
+
|
|
8
|
+
Generate TDD tasks with Red-Green-Refactor cycles via action-planning-agent.
|
|
9
|
+
|
|
10
|
+
## Objective
|
|
11
|
+
|
|
12
|
+
- Generate IMPL_PLAN.md, task JSONs, and TODO_LIST.md with TDD structure
|
|
13
|
+
- Each task contains internal Red-Green-Refactor cycle
|
|
14
|
+
- Include Phase 0 user configuration (execution method, CLI tool preference)
|
|
15
|
+
|
|
16
|
+
## Core Philosophy
|
|
17
|
+
|
|
18
|
+
- **Agent-Driven**: Delegate execution to action-planning-agent for autonomous operation
|
|
19
|
+
- **Two-Phase Flow**: Discovery (context gathering) -> Output (document generation)
|
|
20
|
+
- **Memory-First**: Reuse loaded documents from conversation memory
|
|
21
|
+
- **MCP-Enhanced**: Use MCP tools for advanced code analysis and research
|
|
22
|
+
- **Semantic CLI Selection**: CLI tool usage determined from user's task description, not flags
|
|
23
|
+
- **Path Clarity**: All `focus_paths` prefer absolute paths or clear relative paths from project root
|
|
24
|
+
- **TDD-First**: Every feature starts with a failing test (Red phase)
|
|
25
|
+
- **Feature-Complete Tasks**: Each task contains complete Red-Green-Refactor cycle
|
|
26
|
+
- **Quantification-Enforced**: All test cases, coverage requirements, and implementation scope MUST include explicit counts and enumerations
|
|
27
|
+
|
|
28
|
+
## Task Strategy
|
|
29
|
+
|
|
30
|
+
### Optimized Task Structure
|
|
31
|
+
- **1 feature = 1 task** containing complete TDD cycle internally
|
|
32
|
+
- Each task executes Red-Green-Refactor phases sequentially
|
|
33
|
+
- Task count = Feature count (typically 5 features = 5 tasks)
|
|
34
|
+
|
|
35
|
+
### When to Use Subtasks
|
|
36
|
+
- Feature complexity >2500 lines or >6 files per TDD cycle
|
|
37
|
+
- Multiple independent sub-features needing parallel execution
|
|
38
|
+
- Strong technical dependency blocking (e.g., API before UI)
|
|
39
|
+
- Different tech stacks or domains within feature
|
|
40
|
+
|
|
41
|
+
### Task Limits
|
|
42
|
+
- **Maximum 18 tasks** (hard limit for TDD workflows)
|
|
43
|
+
- **Feature-based**: Complete functional units with internal TDD cycles
|
|
44
|
+
- **Hierarchy**: Flat (<=5 simple features) | Two-level (6-10 for complex features with sub-features)
|
|
45
|
+
- **Re-scope**: If >18 tasks needed, break project into multiple TDD workflow sessions
|
|
46
|
+
|
|
47
|
+
## Execution
|
|
48
|
+
|
|
49
|
+
### Phase 0: User Configuration (Interactive)
|
|
50
|
+
|
|
51
|
+
**Purpose**: Collect user preferences before TDD task generation.
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
AskUserQuestion({
|
|
55
|
+
questions: [
|
|
56
|
+
{
|
|
57
|
+
question: "Do you have supplementary materials or guidelines to include?",
|
|
58
|
+
header: "Materials",
|
|
59
|
+
multiSelect: false,
|
|
60
|
+
options: [
|
|
61
|
+
{ label: "No additional materials", description: "Use existing context only" },
|
|
62
|
+
{ label: "Provide file paths", description: "I'll specify paths to include" },
|
|
63
|
+
{ label: "Provide inline content", description: "I'll paste content directly" }
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
question: "Select execution method for generated TDD tasks:",
|
|
68
|
+
header: "Execution",
|
|
69
|
+
multiSelect: false,
|
|
70
|
+
options: [
|
|
71
|
+
{ label: "Agent (Recommended)", description: "Claude agent executes Red-Green-Refactor cycles directly" },
|
|
72
|
+
{ label: "Hybrid", description: "Agent orchestrates, calls CLI for complex steps (Red/Green phases)" },
|
|
73
|
+
{ label: "CLI Only", description: "All TDD cycles via CLI tools (codex/gemini/qwen)" }
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
question: "If using CLI, which tool do you prefer?",
|
|
78
|
+
header: "CLI Tool",
|
|
79
|
+
multiSelect: false,
|
|
80
|
+
options: [
|
|
81
|
+
{ label: "Codex (Recommended)", description: "Best for TDD Red-Green-Refactor cycles" },
|
|
82
|
+
{ label: "Gemini", description: "Best for analysis and large context" },
|
|
83
|
+
{ label: "Qwen", description: "Alternative analysis tool" },
|
|
84
|
+
{ label: "Auto", description: "Let agent decide per-task" }
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
})
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Handle Materials Response**:
|
|
92
|
+
```javascript
|
|
93
|
+
if (userConfig.materials === "Provide file paths") {
|
|
94
|
+
const pathsResponse = AskUserQuestion({
|
|
95
|
+
questions: [{
|
|
96
|
+
question: "Enter file paths to include (comma-separated or one per line):",
|
|
97
|
+
header: "Paths",
|
|
98
|
+
multiSelect: false,
|
|
99
|
+
options: [
|
|
100
|
+
{ label: "Enter paths", description: "Provide paths in text input" }
|
|
101
|
+
]
|
|
102
|
+
}]
|
|
103
|
+
})
|
|
104
|
+
userConfig.supplementaryPaths = parseUserPaths(pathsResponse)
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Build userConfig**:
|
|
109
|
+
```javascript
|
|
110
|
+
const userConfig = {
|
|
111
|
+
supplementaryMaterials: {
|
|
112
|
+
type: "none|paths|inline",
|
|
113
|
+
content: [...],
|
|
114
|
+
},
|
|
115
|
+
executionMethod: "agent|hybrid|cli",
|
|
116
|
+
preferredCliTool: "codex|gemini|qwen|auto",
|
|
117
|
+
enableResume: true // Always enable resume for CLI executions
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Auto Mode**: When `workflowPreferences.autoYes` is true, skip user questions, use defaults (no materials, Agent executor).
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### Phase 1: Context Preparation & Discovery
|
|
126
|
+
|
|
127
|
+
**Memory-First Rule**: Skip file loading if documents already in conversation memory
|
|
128
|
+
|
|
129
|
+
**Progressive Loading Strategy**: Load context incrementally:
|
|
130
|
+
- **Core**: session metadata + context-package.json (always load)
|
|
131
|
+
- **Selective**: synthesis_output OR (guidance + relevant role analyses) - NOT all role analyses
|
|
132
|
+
- **On-Demand**: conflict resolution (if conflict_risk >= medium), test context
|
|
133
|
+
|
|
134
|
+
**Session Path Structure** (provided to agent):
|
|
135
|
+
```
|
|
136
|
+
.workflow/active/WFS-{session-id}/
|
|
137
|
+
├── workflow-session.json # Session metadata
|
|
138
|
+
├── .process/
|
|
139
|
+
│ ├── context-package.json # Context package with artifact catalog
|
|
140
|
+
│ ├── test-context-package.json # Test coverage analysis
|
|
141
|
+
│ └── conflict-resolution.json # Conflict resolution (if exists)
|
|
142
|
+
├── .task/ # Output: Task JSON files
|
|
143
|
+
│ ├── IMPL-1.json
|
|
144
|
+
│ ├── IMPL-2.json
|
|
145
|
+
│ └── ...
|
|
146
|
+
├── plan.json # Output: Structured plan overview (TDD variant)
|
|
147
|
+
├── IMPL_PLAN.md # Output: TDD implementation plan
|
|
148
|
+
└── TODO_LIST.md # Output: TODO list with TDD phases
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Discovery Actions**:
|
|
152
|
+
|
|
153
|
+
1. **Load Session Context** (if not in memory)
|
|
154
|
+
```javascript
|
|
155
|
+
if (!memory.has("workflow-session.json")) {
|
|
156
|
+
Read(`.workflow/active/${sessionId}/workflow-session.json`)
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
2. **Load Context Package** (if not in memory)
|
|
161
|
+
```javascript
|
|
162
|
+
if (!memory.has("context-package.json")) {
|
|
163
|
+
Read(`.workflow/active/${sessionId}/.process/context-package.json`)
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
3. **Load Test Context Package** (if not in memory)
|
|
168
|
+
```javascript
|
|
169
|
+
if (!memory.has("test-context-package.json")) {
|
|
170
|
+
Read(`.workflow/active/${sessionId}/.process/test-context-package.json`)
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
4. **Extract & Load Role Analyses** (from context-package.json)
|
|
175
|
+
```javascript
|
|
176
|
+
const roleAnalysisPaths = contextPackage.brainstorm_artifacts.role_analyses
|
|
177
|
+
.flatMap(role => role.files.map(f => f.path));
|
|
178
|
+
roleAnalysisPaths.forEach(path => Read(path));
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
5. **Load Conflict Resolution** (if exists)
|
|
182
|
+
```javascript
|
|
183
|
+
if (contextPackage.conflict_detection?.resolution_file) {
|
|
184
|
+
Read(contextPackage.conflict_detection.resolution_file)
|
|
185
|
+
} else if (contextPackage.brainstorm_artifacts?.conflict_resolution?.exists) {
|
|
186
|
+
Read(contextPackage.brainstorm_artifacts.conflict_resolution.path)
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
6. **Code Analysis with Native Tools** (optional)
|
|
191
|
+
```bash
|
|
192
|
+
find . -name "*test*" -type f
|
|
193
|
+
rg "describe|it\(|test\(" -g "*.ts"
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
7. **MCP External Research** (optional)
|
|
197
|
+
```javascript
|
|
198
|
+
mcp__exa__get_code_context_exa(
|
|
199
|
+
query="TypeScript TDD best practices Red-Green-Refactor",
|
|
200
|
+
tokensNum="dynamic"
|
|
201
|
+
)
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### Step 5.1: Execute TDD Task Generation (Agent Invocation)
|
|
207
|
+
|
|
208
|
+
**Design Note**: The agent specification (action-planning-agent.md) already defines schemas, CLI execution strategies, quantification standards, and loading algorithms. This prompt provides **instance-specific parameters** and **TDD-specific requirements** only.
|
|
209
|
+
|
|
210
|
+
```javascript
|
|
211
|
+
Task(
|
|
212
|
+
subagent_type="action-planning-agent",
|
|
213
|
+
run_in_background=false,
|
|
214
|
+
description="Generate TDD planning documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md)",
|
|
215
|
+
prompt=`
|
|
216
|
+
## TASK OBJECTIVE
|
|
217
|
+
Generate TDD implementation planning documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md) for workflow session ${sessionId}
|
|
218
|
+
|
|
219
|
+
## SESSION PATHS
|
|
220
|
+
Session Root: .workflow/active/${sessionId}/
|
|
221
|
+
Input:
|
|
222
|
+
- Session Metadata: .workflow/active/${sessionId}/workflow-session.json
|
|
223
|
+
- Context Package: .workflow/active/${sessionId}/.process/context-package.json
|
|
224
|
+
- Test Context: .workflow/active/${sessionId}/.process/test-context-package.json
|
|
225
|
+
|
|
226
|
+
Output:
|
|
227
|
+
- Task Dir: .workflow/active/${sessionId}/.task/
|
|
228
|
+
- IMPL_PLAN: .workflow/active/${sessionId}/IMPL_PLAN.md
|
|
229
|
+
- TODO_LIST: .workflow/active/${sessionId}/TODO_LIST.md
|
|
230
|
+
|
|
231
|
+
## CONTEXT METADATA
|
|
232
|
+
Session ID: ${sessionId}
|
|
233
|
+
Workflow Type: TDD
|
|
234
|
+
MCP Capabilities: {exa_code, exa_web, code_index}
|
|
235
|
+
|
|
236
|
+
## PROJECT CONTEXT (MANDATORY - load before planning-notes)
|
|
237
|
+
These files provide project-level constraints that apply to ALL tasks:
|
|
238
|
+
|
|
239
|
+
1. **ccw spec load --category execution** (project specs and tech analysis)
|
|
240
|
+
2. **ccw spec load --category test** (test framework, coverage targets, conventions)
|
|
241
|
+
- Contains: tech_stack, architecture_type, key_components, build_system, test_framework, coding_conventions, naming_rules, forbidden_patterns, quality_gates, custom_constraints
|
|
242
|
+
- Usage: Populate plan.json shared_context, align task tech choices, set correct test commands
|
|
243
|
+
- Apply as HARD CONSTRAINTS on all generated tasks — task implementation steps,
|
|
244
|
+
acceptance criteria, and convergence.verification MUST respect these guidelines
|
|
245
|
+
- If empty/missing: No additional constraints (proceed normally)
|
|
246
|
+
|
|
247
|
+
Loading order: \`ccw spec load --category execution\` → \`ccw spec load --category test\` → planning-notes.md → context-package.json
|
|
248
|
+
|
|
249
|
+
## USER CONFIGURATION (from Phase 0)
|
|
250
|
+
Execution Method: ${userConfig.executionMethod} // agent|hybrid|cli
|
|
251
|
+
Preferred CLI Tool: ${userConfig.preferredCliTool} // codex|gemini|qwen|auto
|
|
252
|
+
Supplementary Materials: ${userConfig.supplementaryMaterials}
|
|
253
|
+
|
|
254
|
+
## EXPLORATION CONTEXT (from context-package.exploration_results) - SUPPLEMENT ONLY
|
|
255
|
+
If prioritized_context is incomplete, fall back to exploration_results:
|
|
256
|
+
- Use aggregated_insights.critical_files for focus_paths generation
|
|
257
|
+
- Apply aggregated_insights.constraints to acceptance criteria
|
|
258
|
+
- Reference aggregated_insights.all_patterns for implementation approach
|
|
259
|
+
- Use aggregated_insights.all_integration_points for precise modification locations
|
|
260
|
+
|
|
261
|
+
## TEST CONTEXT INTEGRATION
|
|
262
|
+
- Load test-context-package.json for existing test patterns and coverage analysis
|
|
263
|
+
- Extract test framework configuration (Jest/Pytest/etc.)
|
|
264
|
+
- Identify existing test conventions and patterns
|
|
265
|
+
- Map coverage gaps to TDD Red phase test targets
|
|
266
|
+
|
|
267
|
+
## TDD DOCUMENT GENERATION TASK
|
|
268
|
+
|
|
269
|
+
### TDD-Specific Requirements Summary
|
|
270
|
+
|
|
271
|
+
#### Task Structure Philosophy
|
|
272
|
+
- **1 feature = 1 task** containing complete TDD cycle internally
|
|
273
|
+
- Each task executes Red-Green-Refactor phases sequentially
|
|
274
|
+
- Task count = Feature count (typically 5 features = 5 tasks)
|
|
275
|
+
- Subtasks only when complexity >2500 lines or >6 files per cycle
|
|
276
|
+
- **Maximum 18 tasks** (hard limit for TDD workflows)
|
|
277
|
+
|
|
278
|
+
#### TDD Cycle Mapping
|
|
279
|
+
- **Simple features**: IMPL-N with internal Red-Green-Refactor phases
|
|
280
|
+
- **Complex features**: IMPL-N (container) + IMPL-N.M (subtasks)
|
|
281
|
+
- Each cycle includes: test_count, test_cases array, implementation_scope, expected_coverage
|
|
282
|
+
|
|
283
|
+
#### Required Outputs Summary
|
|
284
|
+
|
|
285
|
+
##### 1. TDD Task JSON Files (.task/IMPL-*.json)
|
|
286
|
+
- **Location**: .workflow/active/${sessionId}/.task/
|
|
287
|
+
- **Schema**: Unified flat schema (task-schema.json) with TDD-specific metadata
|
|
288
|
+
- meta.tdd_workflow: true (REQUIRED)
|
|
289
|
+
- meta.max_iterations: 3 (Green phase test-fix cycle limit)
|
|
290
|
+
- tdd_cycles: Array with quantified test cases and coverage
|
|
291
|
+
- focus_paths: Absolute or clear relative paths (enhanced with exploration critical_files)
|
|
292
|
+
- implementation: Exactly 3 steps with tdd_phase field
|
|
293
|
+
1. Red Phase (tdd_phase: "red"): Write failing tests
|
|
294
|
+
2. Green Phase (tdd_phase: "green"): Implement to pass tests
|
|
295
|
+
3. Refactor Phase (tdd_phase: "refactor"): Improve code quality
|
|
296
|
+
- pre_analysis: Include exploration integration_points analysis
|
|
297
|
+
|
|
298
|
+
##### 2. IMPL_PLAN.md (TDD Variant)
|
|
299
|
+
- **Location**: .workflow/active/${sessionId}/IMPL_PLAN.md
|
|
300
|
+
- **Template**: ~/.ccw/workflows/cli-templates/prompts/workflow/impl-plan-template.txt
|
|
301
|
+
- **TDD-Specific Frontmatter**: workflow_type="tdd", tdd_workflow=true, feature_count, task_breakdown
|
|
302
|
+
|
|
303
|
+
##### 3. TODO_LIST.md
|
|
304
|
+
- **Location**: .workflow/active/${sessionId}/TODO_LIST.md
|
|
305
|
+
- **Format**: Hierarchical task list with internal TDD phase indicators (Red -> Green -> Refactor)
|
|
306
|
+
|
|
307
|
+
## SUCCESS CRITERIA
|
|
308
|
+
- All planning documents generated successfully:
|
|
309
|
+
- Task JSONs valid and saved to .task/ directory
|
|
310
|
+
- IMPL_PLAN.md created with complete TDD structure
|
|
311
|
+
- TODO_LIST.md generated matching task JSONs
|
|
312
|
+
- Return completion status with document count and task breakdown summary
|
|
313
|
+
|
|
314
|
+
## SESSION-SPECIFIC NOTES
|
|
315
|
+
- Workflow Type: TDD — tasks use Red-Green-Refactor phases
|
|
316
|
+
- Deliverables: Task JSONs + IMPL_PLAN.md + plan.json + TODO_LIST.md (all 4 required)
|
|
317
|
+
- focus_paths: Derive from exploration critical_files and test context
|
|
318
|
+
- All other schemas, CLI execution strategies, quantification standards: Follow agent specification
|
|
319
|
+
`
|
|
320
|
+
)
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
**Note**: Phase 0 now includes:
|
|
324
|
+
- Supplementary materials collection (file paths or inline content)
|
|
325
|
+
- Execution method preference (Agent/Hybrid/CLI)
|
|
326
|
+
- CLI tool preference (Codex/Gemini/Qwen/Auto)
|
|
327
|
+
- These preferences are passed to agent for task generation
|
|
328
|
+
|
|
329
|
+
**CLI Tool Selection**: CLI tool usage is determined semantically from user's task description. Include "use Codex/Gemini/Qwen" in your request for CLI execution.
|
|
330
|
+
|
|
331
|
+
### Step 5.2: Parse Output
|
|
332
|
+
|
|
333
|
+
Extract: feature count, task count, CLI execution IDs assigned
|
|
334
|
+
|
|
335
|
+
### Step 5.3: Validate Outputs
|
|
336
|
+
|
|
337
|
+
- `plan.json` exists (structured plan overview with `_metadata.plan_type: "tdd"`)
|
|
338
|
+
- `IMPL_PLAN.md` exists (unified plan with TDD Implementation Tasks section)
|
|
339
|
+
- `IMPL-*.json` files exist (one per feature, or container + subtasks for complex features)
|
|
340
|
+
- `TODO_LIST.md` exists with internal TDD phase indicators
|
|
341
|
+
- Each IMPL task includes:
|
|
342
|
+
- `meta.tdd_workflow: true`
|
|
343
|
+
- `cli_execution.id: {session_id}-{task_id}`
|
|
344
|
+
- `cli_execution: { "strategy": "new|resume|fork|merge_fork", ... }`
|
|
345
|
+
- `implementation` with exactly 3 steps (red/green/refactor)
|
|
346
|
+
- Green phase includes test-fix-cycle configuration
|
|
347
|
+
- `focus_paths`: absolute or clear relative paths (enhanced with exploration critical_files)
|
|
348
|
+
- `pre_analysis`: includes exploration integration_points analysis
|
|
349
|
+
- `IMPL_PLAN.md` contains `workflow_type: "tdd"` in frontmatter
|
|
350
|
+
- User configuration applied:
|
|
351
|
+
- If executionMethod == "cli" or "hybrid": command field added to steps
|
|
352
|
+
- CLI tool preference reflected in execution guidance
|
|
353
|
+
- Task count <=18 (compliance with hard limit)
|
|
354
|
+
|
|
355
|
+
### Red Flag Detection (Non-Blocking Warnings)
|
|
356
|
+
|
|
357
|
+
- Task count >18: `WARNING: Task count exceeds hard limit - request re-scope`
|
|
358
|
+
- Missing cli_execution.id: `WARNING: Task lacks CLI execution ID for resume support`
|
|
359
|
+
- Missing test-fix-cycle: `WARNING: Green phase lacks auto-revert configuration`
|
|
360
|
+
- Generic task names: `WARNING: Vague task names suggest unclear TDD cycles`
|
|
361
|
+
- Missing focus_paths: `WARNING: Task lacks clear file scope for implementation`
|
|
362
|
+
|
|
363
|
+
**Action**: Log warnings to `.workflow/active/[sessionId]/.process/tdd-warnings.log` (non-blocking)
|
|
364
|
+
|
|
365
|
+
### TodoWrite Update (Phase 5 Skill executed - tasks attached)
|
|
366
|
+
|
|
367
|
+
```json
|
|
368
|
+
[
|
|
369
|
+
{"content": "Phase 1: Session Discovery", "status": "completed", "activeForm": "Executing session discovery"},
|
|
370
|
+
{"content": "Phase 2: Context Gathering", "status": "completed", "activeForm": "Executing context gathering"},
|
|
371
|
+
{"content": "Phase 3: Test Coverage Analysis", "status": "completed", "activeForm": "Executing test coverage analysis"},
|
|
372
|
+
{"content": "Phase 5: TDD Task Generation", "status": "in_progress", "activeForm": "Executing TDD task generation"},
|
|
373
|
+
{"content": " -> Discovery - analyze TDD requirements", "status": "in_progress", "activeForm": "Analyzing TDD requirements"},
|
|
374
|
+
{"content": " -> Planning - design Red-Green-Refactor cycles", "status": "pending", "activeForm": "Designing TDD cycles"},
|
|
375
|
+
{"content": " -> Output - generate IMPL tasks with internal TDD phases", "status": "pending", "activeForm": "Generating TDD tasks"},
|
|
376
|
+
{"content": "Phase 6: TDD Structure Validation", "status": "pending", "activeForm": "Validating TDD structure"}
|
|
377
|
+
]
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
**Note**: Agent execution **attaches** task-generate-tdd's 3 tasks. Orchestrator **executes** these tasks. Each generated IMPL task will contain internal Red-Green-Refactor cycle.
|
|
381
|
+
|
|
382
|
+
**Next Action**: Tasks attached -> **Execute Phase 5.1-5.3** sequentially
|
|
383
|
+
|
|
384
|
+
### TodoWrite Update (Phase 5 completed - tasks collapsed)
|
|
385
|
+
|
|
386
|
+
```json
|
|
387
|
+
[
|
|
388
|
+
{"content": "Phase 1: Session Discovery", "status": "completed", "activeForm": "Executing session discovery"},
|
|
389
|
+
{"content": "Phase 2: Context Gathering", "status": "completed", "activeForm": "Executing context gathering"},
|
|
390
|
+
{"content": "Phase 3: Test Coverage Analysis", "status": "completed", "activeForm": "Executing test coverage analysis"},
|
|
391
|
+
{"content": "Phase 5: TDD Task Generation", "status": "completed", "activeForm": "Executing TDD task generation"},
|
|
392
|
+
{"content": "Phase 6: TDD Structure Validation", "status": "in_progress", "activeForm": "Validating TDD structure"}
|
|
393
|
+
]
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
**Note**: Phase 5 tasks completed and collapsed to summary. Each generated IMPL task contains complete Red-Green-Refactor cycle internally.
|
|
397
|
+
|
|
398
|
+
## TDD Task Structure Reference
|
|
399
|
+
|
|
400
|
+
**Quick Reference**:
|
|
401
|
+
- Each TDD task contains complete Red-Green-Refactor cycle
|
|
402
|
+
- Task ID format: `IMPL-N` (simple) or `IMPL-N.M` (complex subtasks)
|
|
403
|
+
- Required metadata:
|
|
404
|
+
- `meta.tdd_workflow: true`
|
|
405
|
+
- `meta.max_iterations: 3`
|
|
406
|
+
- `cli_execution.id: "{session_id}-{task_id}"`
|
|
407
|
+
- `cli_execution: { "strategy": "new|resume|fork|merge_fork", ... }`
|
|
408
|
+
- `tdd_cycles` array with quantified test cases and coverage:
|
|
409
|
+
```javascript
|
|
410
|
+
tdd_cycles: [
|
|
411
|
+
{
|
|
412
|
+
test_count: 5,
|
|
413
|
+
test_cases: ["case1", "case2"],
|
|
414
|
+
implementation_scope: "...",
|
|
415
|
+
expected_coverage: ">=85%"
|
|
416
|
+
}
|
|
417
|
+
]
|
|
418
|
+
```
|
|
419
|
+
- `focus_paths` use absolute or clear relative paths
|
|
420
|
+
- `implementation`: Exactly 3 steps with `tdd_phase` field ("red", "green", "refactor")
|
|
421
|
+
- `pre_analysis`: includes exploration integration_points analysis
|
|
422
|
+
- **meta.execution_config**: Set per `userConfig.executionMethod` (agent/cli/hybrid)
|
|
423
|
+
|
|
424
|
+
## Output Files Structure
|
|
425
|
+
|
|
426
|
+
```
|
|
427
|
+
.workflow/active/{session-id}/
|
|
428
|
+
├── plan.json # Structured plan overview (TDD variant)
|
|
429
|
+
├── IMPL_PLAN.md # Unified plan with TDD Implementation Tasks section
|
|
430
|
+
├── TODO_LIST.md # Progress tracking with internal TDD phase indicators
|
|
431
|
+
├── .task/
|
|
432
|
+
│ ├── IMPL-1.json # Complete TDD task (Red-Green-Refactor internally)
|
|
433
|
+
│ ├── IMPL-2.json # Complete TDD task
|
|
434
|
+
│ ├── IMPL-3.json # Complex feature container (if needed)
|
|
435
|
+
│ ├── IMPL-3.1.json # Complex feature subtask (if needed)
|
|
436
|
+
│ ├── IMPL-3.2.json # Complex feature subtask (if needed)
|
|
437
|
+
│ └── ...
|
|
438
|
+
└── .process/
|
|
439
|
+
├── conflict-resolution.json # Conflict resolution results (if conflict_risk >= medium)
|
|
440
|
+
├── test-context-package.json # Test coverage analysis
|
|
441
|
+
├── context-package.json # Input from context-gather
|
|
442
|
+
└── tdd-warnings.log # Non-blocking warnings
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
## Validation Rules
|
|
446
|
+
|
|
447
|
+
### Task Completeness
|
|
448
|
+
- Every IMPL-N must contain complete TDD workflow in `implementation`
|
|
449
|
+
- Each task must have 3 steps with `tdd_phase`: "red", "green", "refactor"
|
|
450
|
+
- Every task must have `meta.tdd_workflow: true`
|
|
451
|
+
|
|
452
|
+
### Dependency Enforcement
|
|
453
|
+
- Sequential features: IMPL-N depends_on ["IMPL-(N-1)"] if needed
|
|
454
|
+
- Complex feature subtasks: IMPL-N.M depends_on ["IMPL-N.(M-1)"] or parent dependencies
|
|
455
|
+
- No circular dependencies allowed
|
|
456
|
+
|
|
457
|
+
### Task Limits
|
|
458
|
+
- Maximum 18 total tasks (simple + subtasks) - hard limit for TDD workflows
|
|
459
|
+
- Flat hierarchy (<=5 tasks) or two-level (6-18 tasks with containers)
|
|
460
|
+
- Re-scope requirements if >18 tasks needed
|
|
461
|
+
|
|
462
|
+
## Output
|
|
463
|
+
|
|
464
|
+
- **File**: `plan.json` (structured plan overview)
|
|
465
|
+
- **File**: `IMPL_PLAN.md` (unified plan with TDD Implementation Tasks section)
|
|
466
|
+
- **File**: `IMPL-*.json` (task JSONs with internal TDD cycles)
|
|
467
|
+
- **File**: `TODO_LIST.md` (task list with TDD phase indicators)
|
|
468
|
+
- **File**: `.process/tdd-warnings.log` (non-blocking warnings)
|
|
469
|
+
- **TodoWrite**: Mark Phase 5 completed, Phase 6 in_progress
|
|
470
|
+
|
|
471
|
+
## Next Phase
|
|
472
|
+
|
|
473
|
+
Return to orchestrator, then auto-continue to [Phase 6: TDD Structure Validation](06-tdd-structure-validation.md).
|
package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/06-tdd-structure-validation.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# Phase 6: TDD Structure Validation & Plan Confirmation
|
|
2
|
+
|
|
3
|
+
> **📌 COMPACT SENTINEL [Phase 6: TDD-Structure-Validation]**
|
|
4
|
+
> This phase contains 4 execution steps (Step 6.1 — 6.4).
|
|
5
|
+
> If you can read this sentinel but cannot find the full Step protocol below, context has been compressed.
|
|
6
|
+
> Recovery: `Read("phases/06-tdd-structure-validation.md")`
|
|
7
|
+
|
|
8
|
+
Internal validation of TDD task structure and user decision gate for next steps.
|
|
9
|
+
|
|
10
|
+
## Objective
|
|
11
|
+
|
|
12
|
+
- Validate Red-Green-Refactor structure in all generated tasks
|
|
13
|
+
- Verify TDD compliance checkpoints
|
|
14
|
+
- Gather evidence before claiming completion
|
|
15
|
+
- Present Plan Confirmation Gate to user
|
|
16
|
+
|
|
17
|
+
## Execution
|
|
18
|
+
|
|
19
|
+
### Step 6.1: Internal Validation
|
|
20
|
+
|
|
21
|
+
Validate each generated task contains complete TDD workflow:
|
|
22
|
+
|
|
23
|
+
1. **Task structure validation**:
|
|
24
|
+
- `meta.tdd_workflow: true` in all IMPL tasks
|
|
25
|
+
- `cli_execution.id` present (format: {session_id}-{task_id})
|
|
26
|
+
- `cli_execution` strategy assigned (new/resume/fork/merge_fork)
|
|
27
|
+
- `implementation` has exactly 3 steps
|
|
28
|
+
- Each step has correct `tdd_phase`: "red", "green", "refactor"
|
|
29
|
+
- `focus_paths` are absolute or clear relative paths
|
|
30
|
+
- `pre_analysis` includes exploration integration analysis
|
|
31
|
+
|
|
32
|
+
2. **Dependency validation**:
|
|
33
|
+
- Sequential features: IMPL-N depends_on ["IMPL-(N-1)"] if needed
|
|
34
|
+
- Complex features: IMPL-N.M depends_on ["IMPL-N.(M-1)"] for subtasks
|
|
35
|
+
- CLI execution strategies correctly assigned based on dependency graph
|
|
36
|
+
|
|
37
|
+
3. **Agent assignment**: All IMPL tasks use @code-developer
|
|
38
|
+
|
|
39
|
+
4. **Test-fix cycle**: Green phase step includes test-fix-cycle logic with max_iterations
|
|
40
|
+
|
|
41
|
+
5. **Task count**: Total tasks ≤18 (simple + subtasks hard limit)
|
|
42
|
+
|
|
43
|
+
6. **User configuration**:
|
|
44
|
+
- Execution method choice reflected in task structure
|
|
45
|
+
- CLI tool preference documented in implementation guidance (if CLI selected)
|
|
46
|
+
|
|
47
|
+
### Step 6.2: Red Flag Checklist
|
|
48
|
+
|
|
49
|
+
From TDD best practices:
|
|
50
|
+
- [ ] No tasks skip Red phase (`tdd_phase: "red"` exists in step 1)
|
|
51
|
+
- [ ] Test files referenced in Red phase (explicit paths, not placeholders)
|
|
52
|
+
- [ ] Green phase has test-fix-cycle with `max_iterations` configured
|
|
53
|
+
- [ ] Refactor phase has clear completion criteria
|
|
54
|
+
|
|
55
|
+
**Non-Compliance Warning Format**:
|
|
56
|
+
```
|
|
57
|
+
⚠️ TDD Red Flag: [issue description]
|
|
58
|
+
Task: [IMPL-N]
|
|
59
|
+
Recommendation: [action to fix]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Step 6.3: Evidence Gathering
|
|
63
|
+
|
|
64
|
+
Before claiming completion, verify artifacts exist:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Verify session artifacts exist
|
|
68
|
+
ls -la .workflow/active/[sessionId]/{IMPL_PLAN.md,TODO_LIST.md}
|
|
69
|
+
ls -la .workflow/active/[sessionId]/.task/IMPL-*.json
|
|
70
|
+
|
|
71
|
+
# Count generated artifacts
|
|
72
|
+
echo "IMPL tasks: $(ls .workflow/active/[sessionId]/.task/IMPL-*.json 2>/dev/null | wc -l)"
|
|
73
|
+
|
|
74
|
+
# Sample task structure verification (first task)
|
|
75
|
+
jq '{id, tdd: .meta.tdd_workflow, cli_id: .cli_execution.id, phases: [.implementation[].tdd_phase]}' \
|
|
76
|
+
"$(ls .workflow/active/[sessionId]/.task/IMPL-*.json | head -1)"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Evidence Required Before Summary**:
|
|
80
|
+
|
|
81
|
+
| Evidence Type | Verification Method | Pass Criteria |
|
|
82
|
+
|---------------|---------------------|---------------|
|
|
83
|
+
| File existence | `ls -la` artifacts | All files present |
|
|
84
|
+
| Task count | Count IMPL-*.json | Count matches claims (≤18) |
|
|
85
|
+
| TDD structure | jq sample extraction | Shows red/green/refactor + cli_execution.id |
|
|
86
|
+
| CLI execution IDs | jq extraction | All tasks have cli_execution.id assigned |
|
|
87
|
+
| Warning log | Check tdd-warnings.log | Logged (may be empty) |
|
|
88
|
+
|
|
89
|
+
### Step 6.4: Plan Confirmation Gate
|
|
90
|
+
|
|
91
|
+
Present user with action choices:
|
|
92
|
+
|
|
93
|
+
```javascript
|
|
94
|
+
console.log(`
|
|
95
|
+
TDD Planning complete for session: ${sessionId}
|
|
96
|
+
|
|
97
|
+
Features analyzed: [N]
|
|
98
|
+
Total tasks: [M] (1 task per simple feature + subtasks for complex features)
|
|
99
|
+
|
|
100
|
+
Task breakdown:
|
|
101
|
+
- Simple features: [K] tasks (IMPL-1 to IMPL-K)
|
|
102
|
+
- Complex features: [L] features with [P] subtasks
|
|
103
|
+
- Total task count: [M] (within 18-task hard limit)
|
|
104
|
+
|
|
105
|
+
Structure:
|
|
106
|
+
- IMPL-1: {Feature 1 Name} (Internal: Red → Green → Refactor)
|
|
107
|
+
- IMPL-2: {Feature 2 Name} (Internal: Red → Green → Refactor)
|
|
108
|
+
- IMPL-3: {Complex Feature} (Container)
|
|
109
|
+
- IMPL-3.1: {Sub-feature A} (Internal: Red → Green → Refactor)
|
|
110
|
+
- IMPL-3.2: {Sub-feature B} (Internal: Red → Green → Refactor)
|
|
111
|
+
[...]
|
|
112
|
+
|
|
113
|
+
Plans generated:
|
|
114
|
+
- Unified Implementation Plan: .workflow/active/[sessionId]/IMPL_PLAN.md
|
|
115
|
+
(includes TDD Implementation Tasks section with workflow_type: "tdd")
|
|
116
|
+
- Task List: .workflow/active/[sessionId]/TODO_LIST.md
|
|
117
|
+
(with internal TDD phase indicators and CLI execution strategies)
|
|
118
|
+
- Task JSONs: .workflow/active/[sessionId]/.task/IMPL-*.json
|
|
119
|
+
(with cli_execution.id and execution strategies for resume support)
|
|
120
|
+
|
|
121
|
+
TDD Configuration:
|
|
122
|
+
- Each task contains complete Red-Green-Refactor cycle
|
|
123
|
+
- Green phase includes test-fix cycle (max 3 iterations)
|
|
124
|
+
- Auto-revert on max iterations reached
|
|
125
|
+
- CLI execution strategies: new/resume/fork/merge_fork based on dependency graph
|
|
126
|
+
|
|
127
|
+
User Configuration Applied:
|
|
128
|
+
- Execution Method: [agent|hybrid|cli]
|
|
129
|
+
- CLI Tool Preference: [codex|gemini|qwen|auto]
|
|
130
|
+
- Supplementary Materials: [included|none]
|
|
131
|
+
- Task generation follows cli-tools-usage.md guidelines
|
|
132
|
+
|
|
133
|
+
⚠️ ACTION REQUIRED: Before execution, ensure you understand WHY each Red phase test is expected to fail.
|
|
134
|
+
This is crucial for valid TDD - if you don't know why the test fails, you can't verify it tests the right thing.
|
|
135
|
+
`);
|
|
136
|
+
|
|
137
|
+
// Ask user for next action
|
|
138
|
+
const userChoice = AskUserQuestion({
|
|
139
|
+
questions: [{
|
|
140
|
+
question: "TDD Planning complete. What would you like to do next?",
|
|
141
|
+
header: "Next Action",
|
|
142
|
+
multiSelect: false,
|
|
143
|
+
options: [
|
|
144
|
+
{
|
|
145
|
+
label: "Verify TDD Compliance (Recommended)",
|
|
146
|
+
description: "Run full TDD compliance verification to check task chain structure, coverage, and Red-Green-Refactor cycle quality."
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
label: "Start Execution",
|
|
150
|
+
description: "Begin implementing TDD tasks immediately with Red-Green-Refactor cycles."
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
label: "Review Status Only",
|
|
154
|
+
description: "View TDD task breakdown and session status without taking further action."
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
}]
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// Execute based on user choice
|
|
161
|
+
if (userChoice === "Verify TDD Compliance (Recommended)") {
|
|
162
|
+
// Route to Phase 7 (tdd-verify) within this skill
|
|
163
|
+
// Orchestrator reads phases/07-tdd-verify.md and executes
|
|
164
|
+
} else if (userChoice === "Start Execution") {
|
|
165
|
+
Skill(skill="workflow-execute", args="--session " + sessionId);
|
|
166
|
+
} else if (userChoice === "Review Status Only") {
|
|
167
|
+
// Display session status inline
|
|
168
|
+
const sessionMeta = JSON.parse(Read(`.workflow/active/${sessionId}/workflow-session.json`));
|
|
169
|
+
const todoList = Read(`.workflow/active/${sessionId}/TODO_LIST.md`);
|
|
170
|
+
console.log(`\nSession: ${sessionId}`);
|
|
171
|
+
console.log(`Status: ${sessionMeta.status}`);
|
|
172
|
+
console.log(`\n--- TODO List ---\n${todoList}`);
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Auto Mode**: When `workflowPreferences.autoYes` is true, auto-select "Verify TDD Compliance", then auto-continue to execute if quality gate is APPROVED.
|
|
177
|
+
|
|
178
|
+
## Output
|
|
179
|
+
|
|
180
|
+
- **Validation**: TDD structure verified
|
|
181
|
+
- **User Decision**: Route to Phase 7 / Execute / Review
|
|
182
|
+
- **TodoWrite**: Mark Phase 6 completed
|
|
183
|
+
|
|
184
|
+
## Next Phase (Conditional)
|
|
185
|
+
|
|
186
|
+
Based on user's plan confirmation choice:
|
|
187
|
+
- If "Verify" → [Phase 7: TDD Verification](07-tdd-verify.md)
|
|
188
|
+
- If "Execute" → Skill(skill="workflow-execute")
|
|
189
|
+
- If "Review" -> Display session status inline
|