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,440 @@
|
|
|
1
|
+
# Phase 4: Task Generation
|
|
2
|
+
|
|
3
|
+
> **📌 COMPACT SENTINEL [Phase 4: Task-Generation]**
|
|
4
|
+
> This phase contains 6 execution steps (Step 4.0 — 4.4).
|
|
5
|
+
> If you can read this sentinel but cannot find the full Step protocol below, context has been compressed.
|
|
6
|
+
> Recovery: `Read("phases/04-task-generation.md")`
|
|
7
|
+
|
|
8
|
+
Generate implementation plan and task JSONs via action-planning-agent.
|
|
9
|
+
|
|
10
|
+
## Objective
|
|
11
|
+
|
|
12
|
+
- Generate IMPL_PLAN.md, task JSONs, and TODO_LIST.md
|
|
13
|
+
- Present user with plan confirmation choices (verify / execute / review)
|
|
14
|
+
- Route to Phase 5 (verify) if user selects verification
|
|
15
|
+
|
|
16
|
+
## Relationship with Brainstorm Phase
|
|
17
|
+
|
|
18
|
+
- If brainstorm role analyses exist ([role]/analysis.md files), they are incorporated as input
|
|
19
|
+
- **User's original intent is ALWAYS primary**: New or refined user goals override brainstorm recommendations
|
|
20
|
+
- **Role analysis.md files define "WHAT"**: Requirements, design specs, role-specific insights
|
|
21
|
+
- **IMPL_PLAN.md defines "HOW"**: Executable task breakdown, dependencies, implementation sequence
|
|
22
|
+
- Task generation translates high-level role analyses into concrete, actionable work items
|
|
23
|
+
- **Intent priority**: Current user prompt > role analysis.md files > guidance-specification.md
|
|
24
|
+
|
|
25
|
+
## Core Philosophy
|
|
26
|
+
|
|
27
|
+
- **Planning Only**: Generate planning documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md) - does NOT implement code
|
|
28
|
+
- **Agent-Driven Document Generation**: Delegate plan generation to action-planning-agent
|
|
29
|
+
- **NO Redundant Context Sorting**: Context priority sorting is ALREADY completed in context-gather Phase 2/3
|
|
30
|
+
- Use `context-package.json.prioritized_context` directly
|
|
31
|
+
- DO NOT re-sort files or re-compute priorities
|
|
32
|
+
- `priority_tiers` and `dependency_order` are pre-computed and ready-to-use
|
|
33
|
+
- **N+1 Parallel Planning**: Auto-detect multi-module projects, enable parallel planning (2+1 or 3+1 mode)
|
|
34
|
+
- **Progressive Loading**: Load context incrementally (Core -> Selective -> On-Demand) due to analysis.md file size
|
|
35
|
+
- **Memory-First**: Reuse loaded documents from conversation memory
|
|
36
|
+
- **Smart Selection**: Load synthesis_output OR guidance + relevant role analyses, NOT all role analyses
|
|
37
|
+
|
|
38
|
+
## Execution
|
|
39
|
+
|
|
40
|
+
### Step 4.0: User Configuration (Interactive)
|
|
41
|
+
|
|
42
|
+
**Auto Mode Check**:
|
|
43
|
+
```javascript
|
|
44
|
+
const autoYes = workflowPreferences?.autoYes || false;
|
|
45
|
+
|
|
46
|
+
if (autoYes) {
|
|
47
|
+
console.log(`[autoYes] Using defaults: No materials, Agent executor, Codex CLI`)
|
|
48
|
+
userConfig = {
|
|
49
|
+
supplementaryMaterials: { type: "none", content: [] },
|
|
50
|
+
executionMethod: "agent",
|
|
51
|
+
preferredCliTool: "codex",
|
|
52
|
+
enableResume: true
|
|
53
|
+
}
|
|
54
|
+
// Skip to Step 4.1
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**User Questions** (skipped if autoYes):
|
|
59
|
+
```javascript
|
|
60
|
+
if (!autoYes) AskUserQuestion({
|
|
61
|
+
questions: [
|
|
62
|
+
{
|
|
63
|
+
question: "Do you have supplementary materials or guidelines to include?",
|
|
64
|
+
header: "Materials",
|
|
65
|
+
multiSelect: false,
|
|
66
|
+
options: [
|
|
67
|
+
{ label: "No additional materials", description: "Use existing context only" },
|
|
68
|
+
{ label: "Provide file paths", description: "I'll specify paths to include" },
|
|
69
|
+
{ label: "Provide inline content", description: "I'll paste content directly" }
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
question: "Select execution method for generated tasks:",
|
|
74
|
+
header: "Execution",
|
|
75
|
+
multiSelect: false,
|
|
76
|
+
options: [
|
|
77
|
+
{ label: "Agent (Recommended)", description: "Claude agent executes tasks directly" },
|
|
78
|
+
{ label: "Hybrid", description: "Agent orchestrates, calls CLI for complex steps" },
|
|
79
|
+
{ label: "CLI Only", description: "All execution via CLI tools (codex/gemini/qwen)" }
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
question: "If using CLI, which tool do you prefer?",
|
|
84
|
+
header: "CLI Tool",
|
|
85
|
+
multiSelect: false,
|
|
86
|
+
options: [
|
|
87
|
+
{ label: "Codex (Recommended)", description: "Best for implementation tasks" },
|
|
88
|
+
{ label: "Gemini", description: "Best for analysis and large context" },
|
|
89
|
+
{ label: "Qwen", description: "Alternative analysis tool" },
|
|
90
|
+
{ label: "Auto", description: "Let agent decide per-task" }
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
})
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Step 4.1: Context Preparation & Module Detection
|
|
98
|
+
|
|
99
|
+
**Command prepares session paths, metadata, detects module structure. Context priority sorting is NOT performed here.**
|
|
100
|
+
|
|
101
|
+
```javascript
|
|
102
|
+
// Session Path Structure:
|
|
103
|
+
// .workflow/active/WFS-{session-id}/
|
|
104
|
+
// ├── workflow-session.json # Session metadata
|
|
105
|
+
// ├── planning-notes.md # Consolidated planning notes
|
|
106
|
+
// ├── .process/
|
|
107
|
+
// │ └── context-package.json # Context package
|
|
108
|
+
// ├── .task/ # Output: Task JSON files
|
|
109
|
+
// ├── plan.json # Output: Structured plan overview
|
|
110
|
+
// ├── IMPL_PLAN.md # Output: Implementation plan
|
|
111
|
+
// └── TODO_LIST.md # Output: TODO list
|
|
112
|
+
|
|
113
|
+
// Auto Module Detection (determines single vs parallel mode)
|
|
114
|
+
function autoDetectModules(contextPackage, projectRoot) {
|
|
115
|
+
// Complexity Gate: Only parallelize for High complexity
|
|
116
|
+
const complexity = contextPackage.metadata?.complexity || 'Medium';
|
|
117
|
+
if (complexity !== 'High') {
|
|
118
|
+
return [{ name: 'main', prefix: '', paths: ['.'] }];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Priority 1: Explicit frontend/backend separation
|
|
122
|
+
if (exists('src/frontend') && exists('src/backend')) {
|
|
123
|
+
return [
|
|
124
|
+
{ name: 'frontend', prefix: 'A', paths: ['src/frontend'] },
|
|
125
|
+
{ name: 'backend', prefix: 'B', paths: ['src/backend'] }
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Priority 2: Monorepo structure
|
|
130
|
+
if (exists('packages/*') || exists('apps/*')) {
|
|
131
|
+
return detectMonorepoModules();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Priority 3: Context-package dependency clustering
|
|
135
|
+
const modules = clusterByDependencies(contextPackage.dependencies?.internal);
|
|
136
|
+
if (modules.length >= 2) return modules.slice(0, 3);
|
|
137
|
+
|
|
138
|
+
// Default: Single module (original flow)
|
|
139
|
+
return [{ name: 'main', prefix: '', paths: ['.'] }];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Decision Logic:
|
|
143
|
+
// complexity !== 'High' -> Force Phase 2A (Single Agent)
|
|
144
|
+
// modules.length == 1 -> Phase 2A (Single Agent, original flow)
|
|
145
|
+
// modules.length >= 2 && complexity == 'High' -> Phase 2B + Phase 3 (N+1 Parallel)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Step 4.2A: Single Agent Planning (modules.length == 1)
|
|
149
|
+
|
|
150
|
+
**Purpose**: Generate IMPL_PLAN.md, task JSONs, and TODO_LIST.md - planning documents only, NOT code implementation.
|
|
151
|
+
|
|
152
|
+
**Design Note**: The agent specification (action-planning-agent.md) already defines schemas, strategies, quality standards, and loading algorithms. This prompt provides **instance-specific parameters only** — session paths, user config, and context-package consumption guidance unique to this session.
|
|
153
|
+
|
|
154
|
+
```javascript
|
|
155
|
+
Task(
|
|
156
|
+
subagent_type="action-planning-agent",
|
|
157
|
+
run_in_background=false,
|
|
158
|
+
description="Generate planning documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md)",
|
|
159
|
+
prompt=`
|
|
160
|
+
## TASK OBJECTIVE
|
|
161
|
+
Generate implementation planning documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md) for workflow session ${sessionId}
|
|
162
|
+
|
|
163
|
+
## SESSION PATHS
|
|
164
|
+
Session Root: .workflow/active/${sessionId}/
|
|
165
|
+
Input:
|
|
166
|
+
- Session Metadata: .workflow/active/${sessionId}/workflow-session.json
|
|
167
|
+
- Planning Notes: .workflow/active/${sessionId}/planning-notes.md
|
|
168
|
+
- Context Package: .workflow/active/${sessionId}/.process/context-package.json
|
|
169
|
+
Output:
|
|
170
|
+
- Task Dir: .workflow/active/${sessionId}/.task/
|
|
171
|
+
- IMPL_PLAN: .workflow/active/${sessionId}/IMPL_PLAN.md
|
|
172
|
+
- TODO_LIST: .workflow/active/${sessionId}/TODO_LIST.md
|
|
173
|
+
|
|
174
|
+
## CONTEXT METADATA
|
|
175
|
+
Session ID: ${sessionId}
|
|
176
|
+
MCP Capabilities: {exa_code, exa_web, code_index}
|
|
177
|
+
|
|
178
|
+
## PROJECT CONTEXT (MANDATORY - load via ccw spec)
|
|
179
|
+
Execute: ccw spec load --category planning
|
|
180
|
+
|
|
181
|
+
This loads:
|
|
182
|
+
- Technology stack, architecture, key components, build system, test framework
|
|
183
|
+
- User-maintained rules and constraints (coding_conventions, naming_rules, forbidden_patterns, quality_gates)
|
|
184
|
+
|
|
185
|
+
Usage:
|
|
186
|
+
- Populate plan.json shared_context, align task tech choices, set correct test commands
|
|
187
|
+
- Apply as HARD CONSTRAINTS on all generated tasks — task implementation steps,
|
|
188
|
+
acceptance criteria, and convergence.verification MUST respect these guidelines
|
|
189
|
+
|
|
190
|
+
If spec load returns empty: Proceed normally with context-package.project_context
|
|
191
|
+
|
|
192
|
+
Loading order: ccw spec load → planning-notes.md → context-package.json
|
|
193
|
+
|
|
194
|
+
## USER CONFIGURATION (from Step 4.0)
|
|
195
|
+
Execution Method: ${userConfig.executionMethod} // agent|hybrid|cli
|
|
196
|
+
Preferred CLI Tool: ${userConfig.preferredCliTool} // codex|gemini|qwen|auto
|
|
197
|
+
Supplementary Materials: ${userConfig.supplementaryMaterials}
|
|
198
|
+
|
|
199
|
+
## PRIORITIZED CONTEXT (from context-package.prioritized_context) - ALREADY SORTED
|
|
200
|
+
Context sorting is ALREADY COMPLETED in Phase 2/3. DO NOT re-sort.
|
|
201
|
+
Direct usage:
|
|
202
|
+
- **user_intent**: Use goal/scope/key_constraints for task alignment
|
|
203
|
+
- **priority_tiers.critical**: PRIMARY focus for task generation
|
|
204
|
+
- **priority_tiers.high**: SECONDARY focus
|
|
205
|
+
- **dependency_order**: Use for task sequencing - already computed
|
|
206
|
+
- **sorting_rationale**: Reference for understanding priority decisions
|
|
207
|
+
|
|
208
|
+
## EXPLORATION CONTEXT (from context-package.exploration_results) - SUPPLEMENT ONLY
|
|
209
|
+
If prioritized_context is incomplete, fall back to exploration_results:
|
|
210
|
+
- Use aggregated_insights.critical_files for focus_paths generation
|
|
211
|
+
- Apply aggregated_insights.constraints to acceptance criteria
|
|
212
|
+
- Reference aggregated_insights.all_patterns for implementation approach
|
|
213
|
+
- Use aggregated_insights.all_integration_points for precise modification locations
|
|
214
|
+
|
|
215
|
+
## FEATURE SPECIFICATIONS (conditional)
|
|
216
|
+
If context-package has brainstorm_artifacts.feature_index_path:
|
|
217
|
+
Feature Index: [from context-package]
|
|
218
|
+
Feature Spec Dir: [from context-package]
|
|
219
|
+
Else if .workflow/active/${sessionId}/.brainstorming/feature-specs/ exists:
|
|
220
|
+
Feature Index: .workflow/active/${sessionId}/.brainstorming/feature-specs/feature-index.json
|
|
221
|
+
|
|
222
|
+
If the directory does not exist, skip this section.
|
|
223
|
+
|
|
224
|
+
## SESSION-SPECIFIC NOTES
|
|
225
|
+
- Deliverables: Task JSONs + IMPL_PLAN.md + plan.json + TODO_LIST.md (all 4 required)
|
|
226
|
+
- focus_paths: Derive from prioritized_context.priority_tiers (critical + high)
|
|
227
|
+
- Task sequencing: Use dependency_order from context-package (pre-computed)
|
|
228
|
+
- All other schemas, strategies, quality standards: Follow agent specification
|
|
229
|
+
`
|
|
230
|
+
)
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Step 4.2B: N Parallel Planning (modules.length >= 2)
|
|
234
|
+
|
|
235
|
+
**Condition**: `modules.length >= 2` (multi-module detected)
|
|
236
|
+
|
|
237
|
+
**Purpose**: Launch N action-planning-agents simultaneously, one per module.
|
|
238
|
+
|
|
239
|
+
```javascript
|
|
240
|
+
// Launch N agents in parallel (one per module)
|
|
241
|
+
const planningTasks = modules.map(module =>
|
|
242
|
+
Task(
|
|
243
|
+
subagent_type="action-planning-agent",
|
|
244
|
+
run_in_background=false,
|
|
245
|
+
description=`Generate ${module.name} module task JSONs`,
|
|
246
|
+
prompt=`
|
|
247
|
+
## TASK OBJECTIVE
|
|
248
|
+
Generate task JSON files for ${module.name} module within workflow session
|
|
249
|
+
|
|
250
|
+
IMPORTANT: This is PLANNING ONLY - generate task JSONs, NOT implementing code.
|
|
251
|
+
IMPORTANT: Generate Task JSONs ONLY. IMPL_PLAN.md and TODO_LIST.md by Phase 3 Coordinator.
|
|
252
|
+
|
|
253
|
+
## PLANNING NOTES (PHASE 1-3 CONTEXT)
|
|
254
|
+
Load: .workflow/active/${sessionId}/planning-notes.md
|
|
255
|
+
|
|
256
|
+
## MODULE SCOPE
|
|
257
|
+
- Module: ${module.name} (${module.type})
|
|
258
|
+
- Focus Paths: ${module.paths.join(', ')}
|
|
259
|
+
- Task ID Prefix: IMPL-${module.prefix}
|
|
260
|
+
- Task Limit: <=6 tasks (hard limit for this module)
|
|
261
|
+
- Other Modules: ${otherModules.join(', ')} (reference only)
|
|
262
|
+
|
|
263
|
+
## SESSION PATHS
|
|
264
|
+
Input:
|
|
265
|
+
- Session Metadata: .workflow/active/${sessionId}/workflow-session.json
|
|
266
|
+
- Planning Notes: .workflow/active/${sessionId}/planning-notes.md
|
|
267
|
+
- Context Package: .workflow/active/${sessionId}/.process/context-package.json
|
|
268
|
+
Output:
|
|
269
|
+
- Task Dir: .workflow/active/${sessionId}/.task/
|
|
270
|
+
|
|
271
|
+
## CROSS-MODULE DEPENDENCIES
|
|
272
|
+
- For dependencies ON other modules: Use placeholder depends_on: ["CROSS::{module}::{pattern}"]
|
|
273
|
+
- Example: depends_on: ["CROSS::B::api-endpoint"]
|
|
274
|
+
- Phase 3 Coordinator resolves to actual task IDs
|
|
275
|
+
|
|
276
|
+
## CLI EXECUTION ID REQUIREMENTS (MANDATORY)
|
|
277
|
+
Each task JSON MUST include:
|
|
278
|
+
- **cli_execution.id**: Unique ID (format: {session_id}-IMPL-${module.prefix}{seq})
|
|
279
|
+
- Cross-module dep -> { "strategy": "cross_module_fork", "resume_from": "CROSS::{module}::{pattern}" }
|
|
280
|
+
|
|
281
|
+
## QUALITY STANDARDS
|
|
282
|
+
- Task count <= 9 for this module
|
|
283
|
+
- Focus paths scoped to ${module.paths.join(', ')} only
|
|
284
|
+
- Cross-module dependencies use CROSS:: placeholder format
|
|
285
|
+
|
|
286
|
+
## PLANNING NOTES RECORD (REQUIRED)
|
|
287
|
+
### [${module.name}] YYYY-MM-DD
|
|
288
|
+
- **Tasks**: [count] ([IDs])
|
|
289
|
+
- **CROSS deps**: [placeholders used]
|
|
290
|
+
`
|
|
291
|
+
)
|
|
292
|
+
);
|
|
293
|
+
|
|
294
|
+
// Execute all in parallel
|
|
295
|
+
await Promise.all(planningTasks);
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Step 4.3: Integration (+1 Coordinator, Multi-Module Only)
|
|
299
|
+
|
|
300
|
+
**Condition**: Only executed when `modules.length >= 2`
|
|
301
|
+
|
|
302
|
+
```javascript
|
|
303
|
+
Task(
|
|
304
|
+
subagent_type="action-planning-agent",
|
|
305
|
+
run_in_background=false,
|
|
306
|
+
description="Integrate module tasks and generate unified documents",
|
|
307
|
+
prompt=`
|
|
308
|
+
## TASK OBJECTIVE
|
|
309
|
+
Integrate all module task JSONs, resolve cross-module dependencies, and generate unified IMPL_PLAN.md and TODO_LIST.md
|
|
310
|
+
|
|
311
|
+
IMPORTANT: This is INTEGRATION ONLY - consolidate existing task JSONs, NOT creating new tasks.
|
|
312
|
+
|
|
313
|
+
## SESSION PATHS
|
|
314
|
+
Input:
|
|
315
|
+
- Session Metadata: .workflow/active/${sessionId}/workflow-session.json
|
|
316
|
+
- Context Package: .workflow/active/${sessionId}/.process/context-package.json
|
|
317
|
+
- Task JSONs: .workflow/active/${sessionId}/.task/IMPL-*.json (from Phase 2B)
|
|
318
|
+
Output:
|
|
319
|
+
- Updated Task JSONs: .workflow/active/${sessionId}/.task/IMPL-*.json (resolved dependencies)
|
|
320
|
+
- IMPL_PLAN: .workflow/active/${sessionId}/IMPL_PLAN.md
|
|
321
|
+
- TODO_LIST: .workflow/active/${sessionId}/TODO_LIST.md
|
|
322
|
+
|
|
323
|
+
## INTEGRATION STEPS
|
|
324
|
+
1. Collect all .task/IMPL-*.json, group by module prefix
|
|
325
|
+
2. Resolve CROSS:: dependencies -> actual task IDs, update task JSONs
|
|
326
|
+
3. Generate IMPL_PLAN.md (multi-module format)
|
|
327
|
+
4. Generate TODO_LIST.md (hierarchical format)
|
|
328
|
+
|
|
329
|
+
## CROSS-MODULE DEPENDENCY RESOLUTION
|
|
330
|
+
- Pattern: CROSS::{module}::{pattern} -> IMPL-{module}* matching title/context
|
|
331
|
+
- Log unresolved as warnings
|
|
332
|
+
|
|
333
|
+
## PLANNING NOTES RECORD (REQUIRED)
|
|
334
|
+
### [Coordinator] YYYY-MM-DD
|
|
335
|
+
- **Total**: [count] tasks
|
|
336
|
+
- **Resolved**: [CROSS:: resolutions]
|
|
337
|
+
`
|
|
338
|
+
)
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
**Executor Label** (computed after Step 4.0):
|
|
342
|
+
```javascript
|
|
343
|
+
const executorLabel = userConfig.executionMethod === 'agent' ? 'Agent'
|
|
344
|
+
: userConfig.executionMethod === 'hybrid' ? 'Hybrid'
|
|
345
|
+
: `CLI (${userConfig.preferredCliTool})`
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### TodoWrite Update (Phase 4 in progress)
|
|
349
|
+
|
|
350
|
+
```json
|
|
351
|
+
[
|
|
352
|
+
{"content": "Phase 1: Session Discovery", "status": "completed", "activeForm": "Executing session discovery"},
|
|
353
|
+
{"content": "Phase 2: Context Gathering", "status": "completed", "activeForm": "Executing context gathering"},
|
|
354
|
+
{"content": "Phase 4: Task Generation [${executorLabel}]", "status": "in_progress", "activeForm": "Generating tasks [${executorLabel}]"}
|
|
355
|
+
]
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### TodoWrite Update (Phase 4 completed)
|
|
359
|
+
|
|
360
|
+
```json
|
|
361
|
+
[
|
|
362
|
+
{"content": "Phase 1: Session Discovery", "status": "completed", "activeForm": "Executing session discovery"},
|
|
363
|
+
{"content": "Phase 2: Context Gathering", "status": "completed", "activeForm": "Executing context gathering"},
|
|
364
|
+
{"content": "Phase 4: Task Generation [${executorLabel}]", "status": "completed", "activeForm": "Generating tasks [${executorLabel}]"}
|
|
365
|
+
]
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### Step 4.4: Plan Confirmation (User Decision Gate)
|
|
369
|
+
|
|
370
|
+
After Phase 4 completes, present user with action choices:
|
|
371
|
+
|
|
372
|
+
```javascript
|
|
373
|
+
console.log(`
|
|
374
|
+
Planning complete for session: ${sessionId}
|
|
375
|
+
Tasks generated: ${taskCount}
|
|
376
|
+
Plan: .workflow/active/${sessionId}/IMPL_PLAN.md
|
|
377
|
+
`);
|
|
378
|
+
|
|
379
|
+
// Ask user for next action
|
|
380
|
+
const userChoice = AskUserQuestion({
|
|
381
|
+
questions: [{
|
|
382
|
+
question: "Planning complete. What would you like to do next?",
|
|
383
|
+
header: "Next Action",
|
|
384
|
+
multiSelect: false,
|
|
385
|
+
options: [
|
|
386
|
+
{
|
|
387
|
+
label: "Verify Plan Quality (Recommended)",
|
|
388
|
+
description: "Run quality verification to catch issues before execution."
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
label: "Start Execution",
|
|
392
|
+
description: "Begin implementing tasks immediately."
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
label: "Review Status Only",
|
|
396
|
+
description: "View task breakdown and session status without taking further action."
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
}]
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
// Execute based on user choice
|
|
403
|
+
if (userChoice.answers["Next Action"] === "Verify Plan Quality (Recommended)") {
|
|
404
|
+
console.log("\nStarting plan verification...\n");
|
|
405
|
+
// Route to Phase 5 (plan-verify) within this skill
|
|
406
|
+
} else if (userChoice.answers["Next Action"] === "Start Execution") {
|
|
407
|
+
console.log("\nStarting task execution...\n");
|
|
408
|
+
Skill(skill="workflow-execute", args="--session " + sessionId);
|
|
409
|
+
} else if (userChoice.answers["Next Action"] === "Review Status Only") {
|
|
410
|
+
console.log("\nDisplaying session status...\n");
|
|
411
|
+
// Display session status inline
|
|
412
|
+
const sessionMeta = JSON.parse(Read(`.workflow/active/${sessionId}/workflow-session.json`));
|
|
413
|
+
const todoList = Read(`.workflow/active/${sessionId}/TODO_LIST.md`);
|
|
414
|
+
console.log(`Session: ${sessionId}`);
|
|
415
|
+
console.log(`Status: ${sessionMeta.status}`);
|
|
416
|
+
console.log(`\n--- TODO List ---\n${todoList}`);
|
|
417
|
+
}
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
**Auto Mode**: When `workflowPreferences.autoYes` is true, auto-select "Verify Plan Quality", then auto-continue to execute if quality gate is PROCEED.
|
|
421
|
+
|
|
422
|
+
**Return to Orchestrator**: Based on user's choice:
|
|
423
|
+
- **Verify** -> Orchestrator reads phases/05-plan-verify.md and executes Phase 5 in-process
|
|
424
|
+
- **Execute** -> Skill(skill="workflow-execute")
|
|
425
|
+
- **Review** -> Display session status inline
|
|
426
|
+
|
|
427
|
+
## Output
|
|
428
|
+
|
|
429
|
+
- **File**: `IMPL_PLAN.md` (implementation plan)
|
|
430
|
+
- **File**: `IMPL-*.json` (task JSON files)
|
|
431
|
+
- **File**: `TODO_LIST.md` (task list)
|
|
432
|
+
- **File**: `plan.json` (structured plan overview)
|
|
433
|
+
- **TodoWrite**: Mark Phase 4 completed
|
|
434
|
+
|
|
435
|
+
## Next Phase (Conditional)
|
|
436
|
+
|
|
437
|
+
Based on user's plan confirmation choice:
|
|
438
|
+
- If "Verify" -> [Phase 5: Plan Verification](05-plan-verify.md)
|
|
439
|
+
- If "Execute" -> Skill(skill="workflow-execute")
|
|
440
|
+
- If "Review" -> Display session status inline
|