claude-code-workflow 7.2.25 → 7.2.27
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/CLAUDE.md +20 -0
- package/.claude/agents/action-planning-agent.md +6 -0
- package/.claude/agents/cli-explore-agent.md +63 -77
- package/.claude/agents/cli-lite-planning-agent.md +10 -11
- package/.claude/agents/issue-plan-agent.md +7 -2
- package/.claude/commands/workflow/spec/setup.md +1 -1
- package/.claude/skills/review-cycle/phases/review-module.md +4 -4
- package/.claude/skills/review-cycle/phases/review-session.md +4 -4
- package/.claude/skills/team-arch-opt/SKILL.md +1 -1
- package/.claude/skills/team-arch-opt/roles/coordinator/commands/monitor.md +3 -1
- package/.claude/skills/team-arch-opt/roles/refactorer/role.md +3 -1
- package/.claude/skills/team-arch-opt/specs/team-config.json +2 -2
- package/.claude/skills/team-coordinate/SKILL.md +4 -3
- package/.claude/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +1 -1
- package/.claude/skills/team-coordinate/roles/coordinator/commands/dispatch.md +3 -2
- package/.claude/skills/team-coordinate/roles/coordinator/commands/monitor.md +3 -2
- package/.claude/skills/team-coordinate/roles/coordinator/role.md +16 -15
- package/.claude/skills/team-coordinate/specs/pipelines.md +7 -4
- package/.claude/skills/team-coordinate/specs/role-spec-template.md +1 -0
- package/.claude/skills/team-lifecycle-v4/SKILL.md +1 -1
- package/.claude/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +14 -2
- package/.claude/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +24 -2
- package/.claude/skills/team-lifecycle-v4/roles/executor/role.md +3 -1
- package/.claude/skills/team-perf-opt/SKILL.md +1 -1
- package/.claude/skills/team-perf-opt/roles/optimizer/role.md +3 -1
- package/.claude/skills/team-perf-opt/specs/team-config.json +2 -2
- package/.claude/skills/team-quality-assurance/SKILL.md +1 -1
- package/.claude/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +4 -2
- package/.claude/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +4 -2
- package/.claude/skills/team-quality-assurance/roles/executor/role.md +3 -1
- package/.claude/skills/team-testing/SKILL.md +1 -1
- package/.claude/skills/team-testing/roles/coordinator/commands/dispatch.md +5 -2
- package/.claude/skills/team-testing/roles/coordinator/commands/monitor.md +4 -2
- package/.claude/skills/team-testing/roles/executor/role.md +3 -1
- package/.claude/skills/workflow-multi-cli-plan/SKILL.md +2 -2
- package/.claude/skills/workflow-plan/phases/03-conflict-resolution.md +2 -2
- package/.claude/skills/workflow-plan/phases/05-plan-verify.md +2 -2
- package/.claude/skills/workflow-tdd-plan/phases/02-context-gathering.md +3 -3
- package/.claude/skills/workflow-tdd-plan/phases/04-conflict-resolution.md +2 -2
- package/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md +2 -2
- package/.codex/AGENTS.md +16 -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.d.ts +17 -0
- package/ccw/dist/tools/json-builder.d.ts.map +1 -0
- package/ccw/dist/tools/json-builder.js +746 -0
- package/ccw/dist/tools/json-builder.js.map +1 -0
- package/ccw/dist/tools/schema-registry.d.ts +71 -0
- package/ccw/dist/tools/schema-registry.d.ts.map +1 -0
- package/ccw/dist/tools/schema-registry.js +136 -0
- package/ccw/dist/tools/schema-registry.js.map +1 -0
- package/package.json +1 -1
- package/.codex/prompts/prep-cycle.md +0 -416
- package/.codex/prompts/prep-plan.md +0 -371
package/.claude/CLAUDE.md
CHANGED
|
@@ -36,6 +36,26 @@ Available CLI endpoints are dynamically defined by the config file
|
|
|
36
36
|
- **Key scenarios**: Self-repair fails, ambiguous requirements, architecture decisions, pattern uncertainty, critical code paths
|
|
37
37
|
- **Principles**: Default `--mode analysis`, no confirmation needed, wait for completion, flexible rule selection
|
|
38
38
|
|
|
39
|
+
## Workflow Session Awareness
|
|
40
|
+
|
|
41
|
+
### Artifact Locations
|
|
42
|
+
|
|
43
|
+
| Workflow | Directory | Summary File |
|
|
44
|
+
|----------|-----------|-------------|
|
|
45
|
+
| `workflow-plan` | `.workflow/active/WFS-*/` | `workflow-session.json` |
|
|
46
|
+
| `workflow-lite-plan` | `.workflow/.lite-plan/{slug}-{date}/` | `plan.json` |
|
|
47
|
+
| `analyze-with-file` | `.workflow/.analysis/ANL-*/` | `conclusions.json` |
|
|
48
|
+
| `multi-cli-plan` | `.workflow/.multi-cli-plan/*/` | `session-state.json` |
|
|
49
|
+
| `lite-fix` | `.workflow/.lite-fix/*/` | `fix-plan.json` |
|
|
50
|
+
| Other | `.workflow/.debug/`, `.workflow/.scratchpad/`, `.workflow/archives/` | — |
|
|
51
|
+
|
|
52
|
+
### Pre-Task Discovery
|
|
53
|
+
|
|
54
|
+
Before starting any workflow skill, scan recent sessions (7 days) to avoid conflicts and reuse prior work:
|
|
55
|
+
- If overlapping file scope found: warn user, suggest `--continue` or reference prior session
|
|
56
|
+
- If complementary: feed prior findings into new session context
|
|
57
|
+
- `memory/MEMORY.md` for cross-session knowledge; `.workflow/` for session-specific artifacts — reference session IDs, don't duplicate
|
|
58
|
+
|
|
39
59
|
## Code Diagnostics
|
|
40
60
|
|
|
41
61
|
- **Prefer `mcp__ide__getDiagnostics`** for code error checking over shell-based TypeScript compilation
|
|
@@ -829,6 +829,12 @@ Generate at `.workflow/active/{session_id}/plan.json` following `plan-overview-b
|
|
|
829
829
|
|
|
830
830
|
**Generation Timing**: After all `.task/IMPL-*.json` files are generated, aggregate into plan.json.
|
|
831
831
|
|
|
832
|
+
**Validation**: After writing plan.json and task files, validate with json_builder:
|
|
833
|
+
```bash
|
|
834
|
+
ccw tool exec json_builder '{"cmd":"validate","target":"<session>/plan.json","schema":"plan"}'
|
|
835
|
+
ccw tool exec json_builder '{"cmd":"validate","target":"<session>/.task/IMPL-001.json","schema":"task"}'
|
|
836
|
+
```
|
|
837
|
+
|
|
832
838
|
### 2.3 IMPL_PLAN.md Structure
|
|
833
839
|
|
|
834
840
|
**Template-Based Generation**:
|
|
@@ -5,6 +5,7 @@ description: |
|
|
|
5
5
|
Orchestrates 4-phase workflow: Task Understanding → Analysis Execution → Schema Validation → Output Generation.
|
|
6
6
|
Spawned by /explore command orchestrator.
|
|
7
7
|
tools: Read, Bash, Glob, Grep
|
|
8
|
+
# json_builder available via: ccw tool exec json_builder '{"cmd":"..."}' (Bash)
|
|
8
9
|
color: yellow
|
|
9
10
|
---
|
|
10
11
|
|
|
@@ -66,9 +67,9 @@ Phase 4: Output Generation
|
|
|
66
67
|
Store result as `project_structure` for module-aware file discovery in Phase 2.
|
|
67
68
|
|
|
68
69
|
2. **Output Schema Loading** (if output file path specified in prompt):
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
|
|
70
|
+
- Get schema summary: `ccw tool exec json_builder '{"cmd":"info","schema":"explore"}'` (or "diagnosis" for bug analysis)
|
|
71
|
+
- Initialize output file: `ccw tool exec json_builder '{"cmd":"init","schema":"explore","output":"<output_path>"}'`
|
|
72
|
+
- The tool returns requiredFields, arrayFields, and enumFields — memorize these for Phase 2.
|
|
72
73
|
|
|
73
74
|
3. **Project Context Loading** (from spec system):
|
|
74
75
|
- Load exploration specs using: `ccw spec load --category exploration`
|
|
@@ -150,55 +151,56 @@ RULES: {from prompt, if template specified} | analysis=READ-ONLY
|
|
|
150
151
|
---
|
|
151
152
|
|
|
152
153
|
<schema_validation>
|
|
153
|
-
## Phase 3:
|
|
154
|
+
## Phase 3: Incremental Build & Validation (via json_builder)
|
|
154
155
|
|
|
155
|
-
|
|
156
|
+
**This phase replaces manual JSON writing + self-validation with tool-assisted construction.**
|
|
156
157
|
|
|
157
|
-
**
|
|
158
|
+
**Step 1: Set text fields** (discovered during Phase 2 analysis)
|
|
159
|
+
```bash
|
|
160
|
+
ccw tool exec json_builder '{"cmd":"set","target":"<output_path>","ops":[
|
|
161
|
+
{"path":"project_structure","value":"..."},
|
|
162
|
+
{"path":"patterns","value":"..."},
|
|
163
|
+
{"path":"dependencies","value":"..."},
|
|
164
|
+
{"path":"integration_points","value":"..."},
|
|
165
|
+
{"path":"constraints","value":"..."}
|
|
166
|
+
]}'
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Step 2: Append file entries** (as discovered — one `set` per batch)
|
|
170
|
+
```bash
|
|
171
|
+
ccw tool exec json_builder '{"cmd":"set","target":"<output_path>","ops":[
|
|
172
|
+
{"path":"relevant_files[+]","value":{"path":"src/auth.ts","relevance":0.9,"rationale":"Contains AuthService.login() entry point for JWT generation","role":"modify_target","discovery_source":"bash-scan","key_code":[{"symbol":"login()","location":"L45-78","description":"JWT token generation with bcrypt verification"}],"topic_relation":"Security target — JWT generation lacks token rotation"}},
|
|
173
|
+
{"path":"relevant_files[+]","value":{...}}
|
|
174
|
+
]}'
|
|
175
|
+
```
|
|
158
176
|
|
|
159
|
-
**
|
|
177
|
+
The tool **automatically validates** each operation:
|
|
178
|
+
- enum values (role, discovery_source) → rejects invalid
|
|
179
|
+
- minLength (rationale >= 10) → rejects too short
|
|
180
|
+
- type checking → rejects wrong types
|
|
181
|
+
|
|
182
|
+
**Step 3: Set metadata**
|
|
183
|
+
```bash
|
|
184
|
+
ccw tool exec json_builder '{"cmd":"set","target":"<output_path>","ops":[
|
|
185
|
+
{"path":"_metadata.timestamp","value":"auto"},
|
|
186
|
+
{"path":"_metadata.task_description","value":"..."},
|
|
187
|
+
{"path":"_metadata.source","value":"cli-explore-agent"},
|
|
188
|
+
{"path":"_metadata.exploration_angle","value":"..."},
|
|
189
|
+
{"path":"_metadata.exploration_index","value":1},
|
|
190
|
+
{"path":"_metadata.total_explorations","value":2}
|
|
191
|
+
]}'
|
|
160
192
|
```
|
|
161
|
-
|
|
193
|
+
|
|
194
|
+
**Step 4: Final validation**
|
|
195
|
+
```bash
|
|
196
|
+
ccw tool exec json_builder '{"cmd":"validate","target":"<output_path>"}'
|
|
162
197
|
```
|
|
198
|
+
Returns `{valid, errors, warnings, stats}`. If errors exist → fix with `set` → re-validate.
|
|
163
199
|
|
|
164
|
-
**
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
2. **Required fields** - List all `"required": [...]` arrays
|
|
169
|
-
3. **Field names EXACTLY** - Copy character-by-character (case-sensitive)
|
|
170
|
-
4. **Enum values** - Copy exact strings (e.g., `"critical"` not `"Critical"`)
|
|
171
|
-
5. **Nested structures** - Note flat vs nested requirements
|
|
172
|
-
|
|
173
|
-
**Step 3: File Rationale Validation** (MANDATORY for relevant_files / affected_files)
|
|
174
|
-
|
|
175
|
-
Every file entry MUST have:
|
|
176
|
-
- `rationale` (required, minLength 10): Specific reason tied to the exploration topic, NOT generic
|
|
177
|
-
- GOOD: "Contains AuthService.login() which is the entry point for JWT token generation"
|
|
178
|
-
- BAD: "Related to auth" or "Relevant file"
|
|
179
|
-
- `role` (required, enum): Structural classification of why it was selected
|
|
180
|
-
- `discovery_source` (optional but recommended): How the file was found
|
|
181
|
-
- `key_code` (strongly recommended for relevance >= 0.7): Array of {symbol, location?, description}
|
|
182
|
-
- GOOD: [{"symbol": "AuthService.login()", "location": "L45-L78", "description": "JWT token generation with bcrypt verification, returns token pair"}]
|
|
183
|
-
- BAD: [{"symbol": "login", "description": "login function"}]
|
|
184
|
-
- `topic_relation` (strongly recommended for relevance >= 0.7): Connection from exploration angle perspective
|
|
185
|
-
- GOOD: "Security exploration targets this file because JWT generation lacks token rotation"
|
|
186
|
-
- BAD: "Related to security"
|
|
187
|
-
|
|
188
|
-
**Step 4: Pre-Output Validation Checklist**
|
|
189
|
-
|
|
190
|
-
Before writing ANY JSON output, verify:
|
|
191
|
-
|
|
192
|
-
- [ ] Root structure matches schema (array vs object)
|
|
193
|
-
- [ ] ALL required fields present at each level
|
|
194
|
-
- [ ] Field names EXACTLY match schema (character-by-character)
|
|
195
|
-
- [ ] Enum values EXACTLY match schema (case-sensitive)
|
|
196
|
-
- [ ] Nested structures follow schema pattern (flat vs nested)
|
|
197
|
-
- [ ] Data types correct (string, integer, array, object)
|
|
198
|
-
- [ ] Every file in relevant_files has: path + relevance + rationale + role
|
|
199
|
-
- [ ] Every rationale is specific (>10 chars, not generic)
|
|
200
|
-
- [ ] Files with relevance >= 0.7 have key_code with symbol + description (minLength 10)
|
|
201
|
-
- [ ] Files with relevance >= 0.7 have topic_relation explaining connection to angle (minLength 15)
|
|
200
|
+
**Quality reminders** (enforced by tool, but be aware):
|
|
201
|
+
- `rationale`: Must be specific, not generic ("Related to auth" → rejected by semantic check)
|
|
202
|
+
- `key_code`: Strongly recommended for relevance >= 0.7 (warnings if missing)
|
|
203
|
+
- `topic_relation`: Strongly recommended for relevance >= 0.7 (warnings if missing)
|
|
202
204
|
</schema_validation>
|
|
203
205
|
|
|
204
206
|
---
|
|
@@ -212,16 +214,12 @@ Brief summary:
|
|
|
212
214
|
- Task completion status
|
|
213
215
|
- Key findings summary
|
|
214
216
|
- Generated file paths (if any)
|
|
217
|
+
- Validation result (from Phase 3 Step 4)
|
|
215
218
|
|
|
216
|
-
### File Output
|
|
217
|
-
|
|
218
|
-
**MANDATORY WORKFLOW**:
|
|
219
|
+
### File Output
|
|
219
220
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
3. Build JSON using ONLY schema field names
|
|
223
|
-
4. Validate against checklist before writing
|
|
224
|
-
5. Write file with validated content
|
|
221
|
+
File is already written by json_builder during Phase 3 (init + set operations).
|
|
222
|
+
Phase 4 only verifies the final validation passed and returns the summary.
|
|
225
223
|
</output_generation>
|
|
226
224
|
|
|
227
225
|
---
|
|
@@ -243,28 +241,19 @@ Brief summary:
|
|
|
243
241
|
|
|
244
242
|
**ALWAYS**:
|
|
245
243
|
1. **Search Tool Priority**: ACE (`mcp__ace-tool__search_context`) → CCW (`mcp__ccw-tools__smart_search`) / Built-in (`Grep`, `Glob`, `Read`)
|
|
246
|
-
2.
|
|
247
|
-
3.
|
|
248
|
-
4.
|
|
249
|
-
5.
|
|
250
|
-
6.
|
|
251
|
-
7. Include ALL required fields at every level
|
|
252
|
-
8. Include file:line references in findings
|
|
253
|
-
9. **Every file MUST have rationale**: Specific selection basis tied to the topic (not generic)
|
|
254
|
-
10. **Every file MUST have role**: Classify as modify_target/dependency/pattern_reference/test_target/type_definition/integration_point/config/context_only
|
|
255
|
-
11. **Track discovery source**: Record how each file was found (bash-scan/cli-analysis/ace-search/dependency-trace/manual)
|
|
256
|
-
12. **Populate key_code for high-relevance files**: relevance >= 0.7 → key_code array with symbol, location, description
|
|
257
|
-
13. **Populate topic_relation for high-relevance files**: relevance >= 0.7 → topic_relation explaining file-to-angle connection
|
|
244
|
+
2. **Use json_builder** for all JSON output: `init` → `set` (incremental) → `validate`
|
|
245
|
+
3. Include file:line references in findings
|
|
246
|
+
4. **Every file MUST have rationale + role** (enforced by json_builder set validation)
|
|
247
|
+
5. **Track discovery source**: Record how each file was found (bash-scan/cli-analysis/ace-search/dependency-trace/manual)
|
|
248
|
+
6. **Populate key_code + topic_relation for high-relevance files** (relevance >= 0.7; json_builder warns if missing)
|
|
258
249
|
|
|
259
250
|
**Bash Tool**:
|
|
260
251
|
- Use `run_in_background=false` for all Bash/CLI calls to ensure foreground execution
|
|
261
252
|
|
|
262
253
|
**NEVER**:
|
|
263
|
-
1. Modify any files (read-only agent)
|
|
264
|
-
2.
|
|
265
|
-
3.
|
|
266
|
-
4. Assume structure - ALWAYS verify against schema
|
|
267
|
-
5. Omit required fields
|
|
254
|
+
1. Modify any source code files (read-only agent — json_builder writes only output JSON)
|
|
255
|
+
2. Hand-write JSON output — always use json_builder
|
|
256
|
+
3. Skip the `validate` step before returning
|
|
268
257
|
</operational_rules>
|
|
269
258
|
|
|
270
259
|
<output_contract>
|
|
@@ -282,11 +271,8 @@ When exploration is complete, return one of:
|
|
|
282
271
|
|
|
283
272
|
Before returning, verify:
|
|
284
273
|
- [ ] All 4 phases were executed (or skipped with justification)
|
|
285
|
-
- [ ]
|
|
286
|
-
- [ ]
|
|
287
|
-
- [ ] Every file entry has rationale (specific, >10 chars) and role
|
|
288
|
-
- [ ] High-relevance files (>= 0.7) have key_code and topic_relation
|
|
274
|
+
- [ ] json_builder `init` was called at start
|
|
275
|
+
- [ ] json_builder `validate` returned `valid: true` (or all errors were fixed)
|
|
289
276
|
- [ ] Discovery sources are tracked for all findings
|
|
290
|
-
- [ ] No files were modified (read-only agent)
|
|
291
|
-
- [ ] Output format matches schema root structure (array vs object)
|
|
277
|
+
- [ ] No source code files were modified (read-only agent)
|
|
292
278
|
</quality_gate>
|
|
@@ -139,16 +139,15 @@ When `process_docs: true`, generate planning-context.md before sub-plan.json:
|
|
|
139
139
|
|
|
140
140
|
## Schema-Driven Output
|
|
141
141
|
|
|
142
|
-
**CRITICAL**:
|
|
143
|
-
- `plan
|
|
144
|
-
- `plan-
|
|
142
|
+
**CRITICAL**: Get schema info via json_builder to determine output structure:
|
|
143
|
+
- `ccw tool exec json_builder '{"cmd":"info","schema":"plan"}'` → Implementation plan with `approach`, `complexity`
|
|
144
|
+
- `ccw tool exec json_builder '{"cmd":"info","schema":"plan-fix"}'` → Fix plan with `root_cause`, `severity`, `risk_level`
|
|
145
145
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const planObject = generatePlanFromSchema(schema, context)
|
|
146
|
+
After generating plan.json and .task/*.json, validate:
|
|
147
|
+
```bash
|
|
148
|
+
ccw tool exec json_builder '{"cmd":"validate","target":"<session>/plan.json","schema":"plan"}'
|
|
149
|
+
# For each task file:
|
|
150
|
+
ccw tool exec json_builder '{"cmd":"validate","target":"<session>/.task/TASK-001.json","schema":"task"}'
|
|
152
151
|
```
|
|
153
152
|
|
|
154
153
|
</schema_driven_output>
|
|
@@ -863,7 +862,7 @@ function validateTask(task) {
|
|
|
863
862
|
|
|
864
863
|
**ALWAYS**:
|
|
865
864
|
- **Search Tool Priority**: ACE (`mcp__ace-tool__search_context`) → CCW (`mcp__ccw-tools__smart_search`) / Built-in (`Grep`, `Glob`, `Read`)
|
|
866
|
-
- **
|
|
865
|
+
- **Get schema info via json_builder** to determine output structure
|
|
867
866
|
- Generate task IDs (TASK-001/TASK-002 for plan, FIX-001/FIX-002 for fix-plan)
|
|
868
867
|
- Include depends_on (even if empty [])
|
|
869
868
|
- **Assign cli_execution_id** (`{sessionId}-{taskId}`)
|
|
@@ -981,7 +980,7 @@ Upon completion, return one of:
|
|
|
981
980
|
|
|
982
981
|
Before returning, verify:
|
|
983
982
|
|
|
984
|
-
- [ ] Schema
|
|
983
|
+
- [ ] Schema info was obtained via json_builder and output structure matches schema type (base vs fix)
|
|
985
984
|
- [ ] All tasks have valid IDs (TASK-NNN or FIX-NNN format)
|
|
986
985
|
- [ ] All tasks have 2+ implementation steps
|
|
987
986
|
- [ ] All convergence criteria are quantified and testable (no vague language)
|
|
@@ -348,7 +348,7 @@ Write({ file_path: filePath, content: newContent })
|
|
|
348
348
|
.workflow/issues/solutions/{issue-id}.jsonl
|
|
349
349
|
```
|
|
350
350
|
|
|
351
|
-
Each line is a solution JSON containing tasks. Schema: `
|
|
351
|
+
Each line is a solution JSON containing tasks. Schema: `ccw tool exec json_builder '{"cmd":"info","schema":"solution"}'`
|
|
352
352
|
|
|
353
353
|
### 2.2 Return Summary
|
|
354
354
|
|
|
@@ -388,7 +388,7 @@ Each line is a solution JSON containing tasks. Schema: `cat ~/.ccw/workflows/cli
|
|
|
388
388
|
|
|
389
389
|
**ALWAYS**:
|
|
390
390
|
1. **Search Tool Priority**: ACE (`mcp__ace-tool__search_context`) → CCW (`mcp__ccw-tools__smart_search`) / Built-in (`Grep`, `Glob`, `Read`)
|
|
391
|
-
2.
|
|
391
|
+
2. Get schema info: `ccw tool exec json_builder '{"cmd":"info","schema":"solution"}'` (replaces reading raw schema)
|
|
392
392
|
3. Use ACE semantic search as PRIMARY exploration tool
|
|
393
393
|
4. Fetch issue details via `ccw issue status <id> --json`
|
|
394
394
|
5. **Analyze failure history**: Check `issue.feedback` for type='failure', stage='execute'
|
|
@@ -408,6 +408,11 @@ Each line is a solution JSON containing tasks. Schema: `cat ~/.ccw/workflows/cli
|
|
|
408
408
|
4. **Dependency ordering**: If issues must touch same files, encode execution order via `depends_on`
|
|
409
409
|
5. **Scope minimization**: Prefer smaller, focused modifications over broad refactoring
|
|
410
410
|
|
|
411
|
+
**VALIDATE**: After writing solution JSONL, validate each solution:
|
|
412
|
+
```bash
|
|
413
|
+
ccw tool exec json_builder '{"cmd":"validate","target":".workflow/issues/solutions/<issue-id>.jsonl","schema":"solution"}'
|
|
414
|
+
```
|
|
415
|
+
|
|
411
416
|
**NEVER**:
|
|
412
417
|
1. Execute implementation (return plan only)
|
|
413
418
|
2. Use vague criteria ("works correctly", "good performance")
|
|
@@ -129,7 +129,7 @@ Task(
|
|
|
129
129
|
Analyze project for workflow initialization and generate .workflow/project-tech.json.
|
|
130
130
|
|
|
131
131
|
## MANDATORY FIRST STEPS
|
|
132
|
-
1. Execute:
|
|
132
|
+
1. Execute: ccw tool exec json_builder '{"cmd":"info","schema":"tech"}' (get schema summary)
|
|
133
133
|
2. Execute: ccw tool exec get_modules_by_depth '{}' (get project structure)
|
|
134
134
|
|
|
135
135
|
## Task
|
|
@@ -401,7 +401,7 @@ Task(
|
|
|
401
401
|
1. Read review state: ${reviewStateJsonPath}
|
|
402
402
|
2. Get target files: Read resolved_files from review-state.json
|
|
403
403
|
3. Validate file access: bash(ls -la ${targetFiles.join(' ')})
|
|
404
|
-
4. Execute:
|
|
404
|
+
4. Execute: ccw tool exec json_builder '{"cmd":"info","schema":"review-dim"}' (get output schema summary)
|
|
405
405
|
5. Read: .workflow/project-tech.json (technology stack and architecture context)
|
|
406
406
|
6. Read: .workflow/specs/*.md (user-defined constraints and conventions to validate against)
|
|
407
407
|
|
|
@@ -456,7 +456,7 @@ Task(
|
|
|
456
456
|
${getDimensionGuidance(dimension)}
|
|
457
457
|
|
|
458
458
|
## Success Criteria
|
|
459
|
-
- [ ] Schema obtained via
|
|
459
|
+
- [ ] Schema obtained via json_builder info
|
|
460
460
|
- [ ] All target files analyzed for ${dimension} concerns
|
|
461
461
|
- [ ] All findings include file:line references with code snippets
|
|
462
462
|
- [ ] Severity assessment follows established criteria (see reference)
|
|
@@ -505,7 +505,7 @@ Task(
|
|
|
505
505
|
2. Read affected file: ${file}
|
|
506
506
|
3. Identify related code: bash(grep -r "import.*${basename(file)}" ${projectDir}/src --include="*.ts")
|
|
507
507
|
4. Read test files: bash(find ${projectDir}/tests -name "*${basename(file, '.ts')}*" -type f)
|
|
508
|
-
5. Execute:
|
|
508
|
+
5. Execute: ccw tool exec json_builder '{"cmd":"info","schema":"review-deep"}' (get output schema summary)
|
|
509
509
|
6. Read: .workflow/project-tech.json (technology stack and architecture context)
|
|
510
510
|
7. Read: .workflow/specs/*.md (user-defined constraints for remediation compliance)
|
|
511
511
|
|
|
@@ -538,7 +538,7 @@ Task(
|
|
|
538
538
|
- Impact assessment and rollback strategy
|
|
539
539
|
|
|
540
540
|
## Success Criteria
|
|
541
|
-
- [ ] Schema obtained via
|
|
541
|
+
- [ ] Schema obtained via json_builder info
|
|
542
542
|
- [ ] Root cause clearly identified with supporting evidence
|
|
543
543
|
- [ ] Remediation plan is step-by-step actionable with exact file:line references
|
|
544
544
|
- [ ] Each step includes specific commands and validation tests
|
|
@@ -412,7 +412,7 @@ Task(
|
|
|
412
412
|
2. Read completed task summaries: bash(find ${summariesDir} -name "IMPL-*.md" -type f)
|
|
413
413
|
3. Get changed files: bash(cd ${workflowDir} && git log --since="${sessionCreatedAt}" --name-only --pretty=format: | sort -u)
|
|
414
414
|
4. Read review state: ${reviewStateJsonPath}
|
|
415
|
-
5. Execute:
|
|
415
|
+
5. Execute: ccw tool exec json_builder '{"cmd":"info","schema":"review-dim"}' (get output schema summary)
|
|
416
416
|
6. Read: .workflow/project-tech.json (technology stack and architecture context)
|
|
417
417
|
7. Read: .workflow/specs/*.md (user-defined constraints and conventions to validate against)
|
|
418
418
|
|
|
@@ -467,7 +467,7 @@ Task(
|
|
|
467
467
|
${getDimensionGuidance(dimension)}
|
|
468
468
|
|
|
469
469
|
## Success Criteria
|
|
470
|
-
- [ ] Schema obtained via
|
|
470
|
+
- [ ] Schema obtained via json_builder info
|
|
471
471
|
- [ ] All changed files analyzed for ${dimension} concerns
|
|
472
472
|
- [ ] All findings include file:line references with code snippets
|
|
473
473
|
- [ ] Severity assessment follows established criteria (see reference)
|
|
@@ -516,7 +516,7 @@ Task(
|
|
|
516
516
|
2. Read affected file: ${file}
|
|
517
517
|
3. Identify related code: bash(grep -r "import.*${basename(file)}" ${workflowDir}/src --include="*.ts")
|
|
518
518
|
4. Read test files: bash(find ${workflowDir}/tests -name "*${basename(file, '.ts')}*" -type f)
|
|
519
|
-
5. Execute:
|
|
519
|
+
5. Execute: ccw tool exec json_builder '{"cmd":"info","schema":"review-deep"}' (get output schema summary)
|
|
520
520
|
6. Read: .workflow/project-tech.json (technology stack and architecture context)
|
|
521
521
|
7. Read: .workflow/specs/*.md (user-defined constraints for remediation compliance)
|
|
522
522
|
|
|
@@ -550,7 +550,7 @@ Task(
|
|
|
550
550
|
- Impact assessment and rollback strategy
|
|
551
551
|
|
|
552
552
|
## Success Criteria
|
|
553
|
-
- [ ] Schema obtained via
|
|
553
|
+
- [ ] Schema obtained via json_builder info
|
|
554
554
|
- [ ] Root cause clearly identified with supporting evidence
|
|
555
555
|
- [ ] Remediation plan is step-by-step actionable with exact file:line references
|
|
556
556
|
- [ ] Each step includes specific commands and validation tests
|
|
@@ -78,7 +78,7 @@ Execute built-in Phase 1 (task discovery) -> role Phase 2-4 -> built-in Phase 5
|
|
|
78
78
|
})
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
**Inner Loop roles** (refactorer): Set `inner_loop
|
|
81
|
+
**Inner Loop roles** (refactorer): Set `inner_loop` dynamically — `true` for single mode, `false` for fan-out/independent (parallel branches).
|
|
82
82
|
**Single-task roles** (analyzer, designer, validator, reviewer): Set `inner_loop: false`.
|
|
83
83
|
|
|
84
84
|
## User Commands
|
|
@@ -82,7 +82,9 @@ Find ready tasks, spawn workers, STOP.
|
|
|
82
82
|
2. No ready + work in progress -> report waiting, STOP
|
|
83
83
|
3. No ready + nothing in progress -> handleComplete
|
|
84
84
|
4. Has ready -> for each:
|
|
85
|
-
a. Check
|
|
85
|
+
a. Check inner_loop: parse task description `InnerLoop:` field (NOT role.md default)
|
|
86
|
+
- InnerLoop: true AND same-role worker already active -> skip (worker picks up)
|
|
87
|
+
- InnerLoop: false OR no active same-role worker -> spawn new worker
|
|
86
88
|
b. TaskUpdate -> in_progress
|
|
87
89
|
c. team_msg log -> task_unblocked
|
|
88
90
|
d. Spawn team-worker (see SKILL.md Spawn Template):
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
role: refactorer
|
|
3
3
|
prefix: REFACTOR
|
|
4
|
-
inner_loop:
|
|
4
|
+
inner_loop: dynamic
|
|
5
5
|
message_types: [state_update]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Code Refactorer
|
|
9
9
|
|
|
10
|
+
> **inner_loop: dynamic** — Dispatch sets per-task: `true` for single mode (one REFACTOR task with iterative fix cycles), `false` for fan-out/independent modes (REFACTOR-B01..N run as separate parallel workers). When false, each branch gets its own worker.
|
|
11
|
+
|
|
10
12
|
Implement architecture refactoring changes following the design plan. For FIX tasks, apply targeted corrections based on review/validation feedback.
|
|
11
13
|
|
|
12
14
|
## Modes
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"type": "code_generation",
|
|
65
65
|
"description": "Implements architecture refactoring changes following the design plan",
|
|
66
66
|
"role_spec": "roles/refactorer/role.md",
|
|
67
|
-
"inner_loop":
|
|
67
|
+
"inner_loop": "dynamic",
|
|
68
68
|
"frontmatter": {
|
|
69
69
|
"prefix": "REFACTOR",
|
|
70
|
-
"inner_loop":
|
|
70
|
+
"inner_loop": "dynamic",
|
|
71
71
|
"additional_prefixes": ["FIX"],
|
|
72
72
|
"discuss_rounds": [],
|
|
73
73
|
"cli_tools": ["explore"],
|
|
@@ -130,9 +130,10 @@ Execute built-in Phase 1 (task discovery) -> role-spec Phase 2-4 -> built-in Pha
|
|
|
130
130
|
})
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
**Inner Loop
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
**Inner Loop**: Determined per-task from task description `InnerLoop:` field, not per-role:
|
|
134
|
+
- Serial chain (2+ tasks, each blockedBy previous): `inner_loop: true` — single worker loops
|
|
135
|
+
- Parallel tasks (no mutual blockedBy): `inner_loop: false` — separate workers per task
|
|
136
|
+
- Single-task roles: `inner_loop: false`
|
|
136
137
|
|
|
137
138
|
---
|
|
138
139
|
|
|
@@ -130,7 +130,7 @@ For each role, determine frontmatter and generation hints:
|
|
|
130
130
|
| Field | Derivation |
|
|
131
131
|
|-------|------------|
|
|
132
132
|
| `prefix` | From capability prefix (e.g., RESEARCH, DRAFT, IMPL) |
|
|
133
|
-
| `inner_loop` | `true` if role has 2+
|
|
133
|
+
| `inner_loop` | `true` if role has 2+ same-prefix tasks AND they form a serial chain (each blockedBy the previous). `false` if tasks are parallel (no mutual blockedBy) or role has only 1 task |
|
|
134
134
|
| `CLI tools` | Suggested, not mandatory — coordinator may adjust based on task needs |
|
|
135
135
|
| `pattern_hint` | Reference pattern name from role-spec-template (research/document/code/analysis/validation) — guides coordinator's Phase 2-4 composition, NOT a rigid template selector |
|
|
136
136
|
| `output_type` | `artifact` (new files in session/artifacts/) / `codebase` (modify existing project files) / `mixed` (both) — determines verification strategy in Behavioral Traits |
|
|
@@ -95,9 +95,10 @@ RoleSpec: <session-folder>/role-specs/<role-name>.md
|
|
|
95
95
|
|
|
96
96
|
| Condition | InnerLoop |
|
|
97
97
|
|-----------|-----------|
|
|
98
|
-
| Role has 2+
|
|
98
|
+
| Role has 2+ same-prefix tasks forming a serial chain (each blockedBy the previous) | true |
|
|
99
99
|
| Role has 1 task | false |
|
|
100
|
-
|
|
|
100
|
+
| Role has 2+ same-prefix tasks but they are parallel (no mutual blockedBy) | false |
|
|
101
|
+
| Mixed: some serial, some parallel within same role | Set per-task: true for serial chain members, false for parallel members |
|
|
101
102
|
|
|
102
103
|
### Dependency Validation
|
|
103
104
|
|
|
@@ -144,9 +144,10 @@ Ready tasks found?
|
|
|
144
144
|
+- NONE + work in progress -> report waiting -> STOP
|
|
145
145
|
+- NONE + nothing in progress -> PIPELINE_COMPLETE -> handleComplete
|
|
146
146
|
+- HAS ready tasks -> for each:
|
|
147
|
-
+-
|
|
147
|
+
+- Parse task description `InnerLoop:` field (NOT session.roles[].inner_loop)
|
|
148
|
+
+- InnerLoop: true AND same-role worker already in active_workers?
|
|
148
149
|
| +- YES -> SKIP spawn (existing worker will pick it up via inner loop)
|
|
149
|
-
| +- NO -> normal spawn below
|
|
150
|
+
| +- NO -> normal spawn below (InnerLoop: false OR no active same-role worker)
|
|
150
151
|
+- TaskUpdate -> in_progress
|
|
151
152
|
+- team_msg log -> task_unblocked (session_id=<session-id>)
|
|
152
153
|
+- Spawn team-worker (see spawn tool call below)
|
|
@@ -207,15 +207,9 @@ Regardless of complexity score or role count, coordinator MUST:
|
|
|
207
207
|
- `project_root` = result of `Bash({ command: "pwd" })`
|
|
208
208
|
- `skill_root` = `<project_root>/.claude/skills/team-coordinate`
|
|
209
209
|
|
|
210
|
-
2. **
|
|
211
|
-
- If `true`: **Spawn researcher worker first** to gather codebase context
|
|
212
|
-
- Wait for researcher callback
|
|
213
|
-
- Merge research findings into task context
|
|
214
|
-
- Update task-analysis.json with enriched context
|
|
210
|
+
2. **Generate session ID**: `TC-<slug>-<date>` (slug from first 3 meaningful words of task)
|
|
215
211
|
|
|
216
|
-
3. **
|
|
217
|
-
|
|
218
|
-
4. **Create session folder structure**:
|
|
212
|
+
3. **Create session folder structure**:
|
|
219
213
|
```
|
|
220
214
|
.workflow/.team/<session-id>/
|
|
221
215
|
+-- role-specs/
|
|
@@ -226,11 +220,11 @@ Regardless of complexity score or role count, coordinator MUST:
|
|
|
226
220
|
+-- .msg/
|
|
227
221
|
```
|
|
228
222
|
|
|
229
|
-
|
|
223
|
+
4. **Call TeamCreate** with team name derived from session ID
|
|
230
224
|
|
|
231
|
-
|
|
225
|
+
5. **Read `specs/role-spec-template.md`** for Behavioral Traits + Reference Patterns
|
|
232
226
|
|
|
233
|
-
|
|
227
|
+
6. **For each role in task-analysis.json#roles**:
|
|
234
228
|
- Fill YAML frontmatter: role, prefix, inner_loop, additional_members, message_types
|
|
235
229
|
- **Compose Phase 2-4 content** (NOT copy from template):
|
|
236
230
|
- Phase 2: Derive input sources and context loading steps from **task description + upstream dependencies**
|
|
@@ -239,14 +233,14 @@ Regardless of complexity score or role count, coordinator MUST:
|
|
|
239
233
|
- Reference Patterns may guide phase structure, but task description determines specific content
|
|
240
234
|
- Write generated role-spec to `<session>/role-specs/<role-name>.md`
|
|
241
235
|
|
|
242
|
-
|
|
236
|
+
7. **Register roles** in team-session.json#roles (with `role_spec` path instead of `role_file`)
|
|
243
237
|
|
|
244
|
-
|
|
238
|
+
8. **Initialize shared infrastructure**:
|
|
245
239
|
- `wisdom/learnings.md`, `wisdom/decisions.md`, `wisdom/issues.md` (empty with headers)
|
|
246
240
|
- `explorations/cache-index.json` (`{ "entries": [] }`)
|
|
247
241
|
- `discussions/` (empty directory)
|
|
248
242
|
|
|
249
|
-
|
|
243
|
+
9. **Initialize pipeline metadata** via team_msg:
|
|
250
244
|
```typescript
|
|
251
245
|
// 使用 team_msg 将 pipeline 元数据写入 .msg/meta.json
|
|
252
246
|
// 注意: 此处为动态角色,执行时需将 <placeholders> 替换为 task-analysis.json 中生成的实际角色列表
|
|
@@ -265,7 +259,14 @@ mcp__ccw-tools__team_msg({
|
|
|
265
259
|
})
|
|
266
260
|
```
|
|
267
261
|
|
|
268
|
-
|
|
262
|
+
10. **Write team-session.json** with: session_id, task_description, status="active", roles, pipeline (empty), active_workers=[], completion_action="interactive", created_at
|
|
263
|
+
|
|
264
|
+
11. **Check `needs_research` flag** from task-analysis.json:
|
|
265
|
+
- If `true`: Spawn researcher worker (role-spec now exists from step 6) to gather codebase context
|
|
266
|
+
- Wait for researcher callback
|
|
267
|
+
- Merge research findings into task context
|
|
268
|
+
- Update task-analysis.json with enriched context
|
|
269
|
+
- If `false`: Skip, proceed to Phase 3
|
|
269
270
|
|
|
270
271
|
**Success**: Session created, role-spec files generated, shared infrastructure initialized.
|
|
271
272
|
|
|
@@ -38,18 +38,20 @@ Phase 3-N: monitor.md
|
|
|
38
38
|
|
|
39
39
|
## Dependency Graph Structure
|
|
40
40
|
|
|
41
|
-
task-analysis.json encodes the pipeline:
|
|
41
|
+
task-analysis.json encodes the pipeline as adjacency list (task ID -> blockedBy array):
|
|
42
42
|
|
|
43
43
|
```json
|
|
44
44
|
{
|
|
45
45
|
"dependency_graph": {
|
|
46
|
-
"RESEARCH-001":
|
|
47
|
-
"IMPL-001":
|
|
48
|
-
"TEST-001":
|
|
46
|
+
"RESEARCH-001": [],
|
|
47
|
+
"IMPL-001": ["RESEARCH-001"],
|
|
48
|
+
"TEST-001": ["IMPL-001"]
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
Role mapping comes from `task-analysis.json#capabilities[].tasks[]`, not from the dependency graph itself.
|
|
54
|
+
|
|
53
55
|
## Role-Worker Map
|
|
54
56
|
|
|
55
57
|
Dynamic — loaded from session role-specs at runtime:
|
|
@@ -64,6 +66,7 @@ Role-spec files contain YAML frontmatter:
|
|
|
64
66
|
role: <role-name>
|
|
65
67
|
prefix: <PREFIX>
|
|
66
68
|
inner_loop: <true|false>
|
|
69
|
+
output_tag: "[<role-name>]"
|
|
67
70
|
message_types:
|
|
68
71
|
success: <type>
|
|
69
72
|
error: error
|
|
@@ -40,7 +40,7 @@ Skill(skill="team-lifecycle-v4", args="task description")
|
|
|
40
40
|
| analyst | [roles/analyst/role.md](roles/analyst/role.md) | RESEARCH-* | false |
|
|
41
41
|
| writer | [roles/writer/role.md](roles/writer/role.md) | DRAFT-* | true |
|
|
42
42
|
| planner | [roles/planner/role.md](roles/planner/role.md) | PLAN-* | true |
|
|
43
|
-
| executor | [roles/executor/role.md](roles/executor/role.md) | IMPL-* |
|
|
43
|
+
| executor | [roles/executor/role.md](roles/executor/role.md) | IMPL-* | dynamic |
|
|
44
44
|
| tester | [roles/tester/role.md](roles/tester/role.md) | TEST-* | false |
|
|
45
45
|
| reviewer | [roles/reviewer/role.md](roles/reviewer/role.md) | REVIEW-*, QUALITY-*, IMPROVE-* | false |
|
|
46
46
|
| supervisor | [roles/supervisor/role.md](roles/supervisor/role.md) | CHECKPOINT-* | false |
|