claude-code-workflow 7.2.24 → 7.2.25

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.
Files changed (42) hide show
  1. package/.ccw/workflows/cli-tools-usage.md +123 -521
  2. package/.claude/skills/brainstorm/SKILL.md +408 -408
  3. package/.claude/skills/review-cycle/SKILL.md +132 -132
  4. package/.claude/skills/spec-generator/SKILL.md +1 -1
  5. package/.claude/skills/team-designer/phases/02-scaffold-generation.md +1 -1
  6. package/.claude/skills/team-lifecycle-v4/SKILL.md +1 -1
  7. package/.claude/skills/team-review/SKILL.md +1 -1
  8. package/.claude/skills/team-ultra-analyze/SKILL.md +1 -1
  9. package/.claude/skills/workflow-multi-cli-plan/SKILL.md +1 -1
  10. package/.claude/skills/workflow-plan/SKILL.md +1 -1
  11. package/.claude/skills/workflow-test-fix/SKILL.md +1 -1
  12. package/.codex/skills/analyze-with-file/SKILL.md +966 -966
  13. package/.codex/skills/issue-discover/SKILL.md +361 -361
  14. package/.codex/skills/review-cycle/SKILL.md +1 -1
  15. package/.codex/skills/roadmap-with-file/SKILL.md +901 -901
  16. package/.codex/skills/spec-generator/SKILL.md +425 -425
  17. package/.codex/skills/spec-setup/SKILL.md +669 -669
  18. package/.codex/skills/team-designer/phases/02-scaffold-generation.md +1 -1
  19. package/.codex/skills/workflow-test-fix-cycle/SKILL.md +402 -402
  20. package/package.json +1 -1
  21. package/.claude/skills/team-iterdev/SKILL.md +0 -127
  22. package/.claude/skills/team-iterdev/roles/architect/role.md +0 -65
  23. package/.claude/skills/team-iterdev/roles/coordinator/commands/analyze.md +0 -62
  24. package/.claude/skills/team-iterdev/roles/coordinator/commands/dispatch.md +0 -234
  25. package/.claude/skills/team-iterdev/roles/coordinator/commands/monitor.md +0 -182
  26. package/.claude/skills/team-iterdev/roles/coordinator/role.md +0 -153
  27. package/.claude/skills/team-iterdev/roles/developer/role.md +0 -74
  28. package/.claude/skills/team-iterdev/roles/reviewer/role.md +0 -66
  29. package/.claude/skills/team-iterdev/roles/tester/role.md +0 -88
  30. package/.claude/skills/team-iterdev/specs/pipelines.md +0 -94
  31. package/.claude/skills/team-iterdev/specs/team-config.json +0 -172
  32. package/.codex/skills/team-iterdev/SKILL.md +0 -219
  33. package/.codex/skills/team-iterdev/roles/architect/role.md +0 -65
  34. package/.codex/skills/team-iterdev/roles/coordinator/commands/analyze.md +0 -62
  35. package/.codex/skills/team-iterdev/roles/coordinator/commands/dispatch.md +0 -187
  36. package/.codex/skills/team-iterdev/roles/coordinator/commands/monitor.md +0 -227
  37. package/.codex/skills/team-iterdev/roles/coordinator/role.md +0 -193
  38. package/.codex/skills/team-iterdev/roles/developer/role.md +0 -74
  39. package/.codex/skills/team-iterdev/roles/reviewer/role.md +0 -66
  40. package/.codex/skills/team-iterdev/roles/tester/role.md +0 -88
  41. package/.codex/skills/team-iterdev/specs/pipelines.md +0 -94
  42. package/.codex/skills/team-iterdev/specs/team-config.json +0 -172
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-workflow",
3
- "version": "7.2.24",
3
+ "version": "7.2.25",
4
4
  "description": "JSON-driven multi-agent development framework with intelligent CLI orchestration (Gemini/Qwen/Codex), context-first architecture, and automated workflow execution",
5
5
  "type": "module",
6
6
  "main": "ccw/dist/index.js",
@@ -1,127 +0,0 @@
1
- ---
2
- name: team-iterdev
3
- description: Unified team skill for iterative development team. Pure router — all roles read this file. Beat model is coordinator-only in monitor.md. Generator-Critic loops (developer<->reviewer, max 3 rounds). Triggers on "team iterdev".
4
- allowed-tools: TeamCreate(*), TeamDelete(*), SendMessage(*), TaskCreate(*), TaskUpdate(*), TaskList(*), TaskGet(*), Agent(*), AskUserQuestion(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*)
5
- ---
6
-
7
- # Team IterDev
8
-
9
- Iterative development team skill. Generator-Critic loops (developer<->reviewer, max 3 rounds), task ledger (task-ledger.json) for real-time progress, shared memory (cross-sprint learning), and dynamic pipeline selection for incremental delivery.
10
-
11
- ## Architecture
12
-
13
- ```
14
- Skill(skill="team-iterdev", args="task description")
15
- |
16
- SKILL.md (this file) = Router
17
- |
18
- +--------------+--------------+
19
- | |
20
- no --role flag --role <name>
21
- | |
22
- Coordinator Worker
23
- roles/coordinator/role.md roles/<name>/role.md
24
- |
25
- +-- analyze -> dispatch -> spawn workers -> STOP
26
- |
27
- +-------+-------+-------+
28
- v v v v
29
- [architect] [developer] [tester] [reviewer]
30
- (team-worker agents, each loads roles/<role>/role.md)
31
- ```
32
-
33
- ## Role Registry
34
-
35
- | Role | Path | Prefix | Inner Loop |
36
- |------|------|--------|------------|
37
- | coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | — | — |
38
- | architect | [roles/architect/role.md](roles/architect/role.md) | DESIGN-* | false |
39
- | developer | [roles/developer/role.md](roles/developer/role.md) | DEV-* | true |
40
- | tester | [roles/tester/role.md](roles/tester/role.md) | VERIFY-* | false |
41
- | reviewer | [roles/reviewer/role.md](roles/reviewer/role.md) | REVIEW-* | false |
42
-
43
- ## Role Router
44
-
45
- Parse `$ARGUMENTS`:
46
- - Has `--role <name>` → Read `roles/<name>/role.md`, execute Phase 2-4
47
- - No `--role` → `@roles/coordinator/role.md`, execute entry router
48
-
49
- ## Shared Constants
50
-
51
- - **Session prefix**: `IDS`
52
- - **Session path**: `.workflow/.team/IDS-<slug>-<date>/`
53
- - **CLI tools**: `ccw cli --mode analysis` (read-only), `ccw cli --mode write` (modifications)
54
- - **Message bus**: `mcp__ccw-tools__team_msg(session_id=<session-id>, ...)`
55
-
56
- ## Worker Spawn Template
57
-
58
- Coordinator spawns workers using this template:
59
-
60
- ```
61
- Agent({
62
- subagent_type: "team-worker",
63
- description: "Spawn <role> worker",
64
- team_name: "iterdev",
65
- name: "<role>",
66
- run_in_background: true,
67
- prompt: `## Role Assignment
68
- role: <role>
69
- role_spec: <skill_root>/roles/<role>/role.md
70
- session: <session-folder>
71
- session_id: <session-id>
72
- team_name: iterdev
73
- requirement: <task-description>
74
- inner_loop: <true|false>
75
-
76
- Read role_spec file (@<skill_root>/roles/<role>/role.md) to load Phase 2-4 domain instructions.
77
- Execute built-in Phase 1 (task discovery) -> role Phase 2-4 -> built-in Phase 5 (report).`
78
- })
79
- ```
80
-
81
- ## User Commands
82
-
83
- | Command | Action |
84
- |---------|--------|
85
- | `check` / `status` | View execution status graph |
86
- | `resume` / `continue` | Advance to next step |
87
-
88
- ## Session Directory
89
-
90
- ```
91
- .workflow/.team/IDS-<slug>-<YYYY-MM-DD>/
92
- ├── .msg/
93
- │ ├── messages.jsonl # Team message bus
94
- │ └── meta.json # Session state
95
- ├── task-analysis.json # Coordinator analyze output
96
- ├── task-ledger.json # Real-time task progress ledger
97
- ├── wisdom/ # Cross-task knowledge accumulation
98
- │ ├── learnings.md
99
- │ ├── decisions.md
100
- │ ├── conventions.md
101
- │ └── issues.md
102
- ├── design/ # Architect output
103
- │ ├── design-001.md
104
- │ └── task-breakdown.json
105
- ├── code/ # Developer tracking
106
- │ └── dev-log.md
107
- ├── verify/ # Tester output
108
- │ └── verify-001.json
109
- └── review/ # Reviewer output
110
- └── review-001.md
111
- ```
112
-
113
- ## Specs Reference
114
-
115
- - [specs/pipelines.md](specs/pipelines.md) — Pipeline definitions and task registry
116
-
117
- ## Error Handling
118
-
119
- | Scenario | Resolution |
120
- |----------|------------|
121
- | Unknown command | Error with available command list |
122
- | Role not found | Error with role registry |
123
- | GC loop exceeds 3 rounds | Accept with warning, record in shared memory |
124
- | Sprint velocity drops below 50% | Coordinator alerts user, suggests scope reduction |
125
- | Task ledger corrupted | Rebuild from TaskList state |
126
- | Conflict detected | Update conflict_info, notify coordinator, create DEV-fix task |
127
- | Pipeline deadlock | Check blockedBy chain, report blocking point |
@@ -1,65 +0,0 @@
1
- ---
2
- role: architect
3
- prefix: DESIGN
4
- inner_loop: false
5
- message_types:
6
- success: design_ready
7
- revision: design_revision
8
- error: error
9
- ---
10
-
11
- # Architect
12
-
13
- Technical design, task decomposition, and architecture decision records for iterative development.
14
-
15
- ## Phase 2: Context Loading + Codebase Exploration
16
-
17
- | Input | Source | Required |
18
- |-------|--------|----------|
19
- | Task description | From task subject/description | Yes |
20
- | Session path | Extracted from task description | Yes |
21
- | .msg/meta.json | <session>/.msg/meta.json | No |
22
- | Wisdom files | <session>/wisdom/ | No |
23
-
24
- 1. Extract session path and requirement from task description
25
- 2. Read .msg/meta.json for shared context (architecture_decisions, implementation_context)
26
- 3. Read wisdom files if available (learnings.md, decisions.md, conventions.md)
27
- 4. Explore codebase for existing patterns, module structure, dependencies:
28
- - Use mcp__ace-tool__search_context for semantic discovery
29
- - Identify similar implementations and integration points
30
-
31
- ## Phase 3: Technical Design + Task Decomposition
32
-
33
- **Design strategy selection**:
34
-
35
- | Condition | Strategy |
36
- |-----------|----------|
37
- | Single module change | Direct inline design |
38
- | Cross-module change | Multi-component design with integration points |
39
- | Large refactoring | Phased approach with milestones |
40
-
41
- **Outputs**:
42
-
43
- 1. **Design Document** (`<session>/design/design-<num>.md`):
44
- - Architecture decision: approach, rationale, alternatives
45
- - Component design: responsibility, dependencies, files, complexity
46
- - Task breakdown: files, estimated complexity, dependencies, acceptance criteria
47
- - Integration points and risks with mitigations
48
-
49
- 2. **Task Breakdown JSON** (`<session>/design/task-breakdown.json`):
50
- - Array of tasks with id, title, files, complexity, dependencies, acceptance_criteria
51
- - Execution order for developer to follow
52
-
53
- ## Phase 4: Design Validation
54
-
55
- | Check | Method | Pass Criteria |
56
- |-------|--------|---------------|
57
- | Components defined | Verify component list | At least 1 component |
58
- | Task breakdown exists | Verify task list | At least 1 task |
59
- | Dependencies mapped | All components have dependencies field | All present (can be empty) |
60
- | Integration points | Verify integration section | Key integrations documented |
61
-
62
- 1. Run validation checks above
63
- 2. Write architecture_decisions entry to .msg/meta.json:
64
- - design_id, approach, rationale, components, task_count
65
- 3. Write discoveries to wisdom/decisions.md and wisdom/conventions.md
@@ -1,62 +0,0 @@
1
- # Analyze Task
2
-
3
- Parse iterative development task -> detect capabilities -> assess pipeline complexity -> design roles.
4
-
5
- **CONSTRAINT**: Text-level analysis only. NO source code reading, NO codebase exploration.
6
-
7
- ## Signal Detection
8
-
9
- | Keywords | Capability | Role |
10
- |----------|------------|------|
11
- | design, architect, restructure, refactor plan | architect | architect |
12
- | implement, build, code, fix, develop | developer | developer |
13
- | test, verify, validate, coverage | tester | tester |
14
- | review, audit, quality, check | reviewer | reviewer |
15
-
16
- ## Pipeline Selection
17
-
18
- | Signal | Score |
19
- |--------|-------|
20
- | Changed files > 10 | +3 |
21
- | Changed files 3-10 | +2 |
22
- | Structural change (refactor, architect, restructure) | +3 |
23
- | Cross-cutting (multiple, across, cross) | +2 |
24
- | Simple fix (fix, bug, typo, patch) | -2 |
25
-
26
- | Score | Pipeline |
27
- |-------|----------|
28
- | >= 5 | multi-sprint |
29
- | 2-4 | sprint |
30
- | 0-1 | patch |
31
-
32
- ## Dependency Graph
33
-
34
- Natural ordering tiers:
35
- - Tier 0: architect (design must come first)
36
- - Tier 1: developer (implementation requires design)
37
- - Tier 2: tester, reviewer (validation requires artifacts, can run parallel)
38
-
39
- ## Complexity Assessment
40
-
41
- | Factor | Points |
42
- |--------|--------|
43
- | Cross-module changes | +2 |
44
- | Serial depth > 3 | +1 |
45
- | Multiple developers needed | +2 |
46
- | GC loop likely needed | +1 |
47
-
48
- ## Output
49
-
50
- Write <session>/task-analysis.json:
51
- ```json
52
- {
53
- "task_description": "<original>",
54
- "pipeline_type": "<patch|sprint|multi-sprint>",
55
- "capabilities": [{ "name": "<cap>", "role": "<role>", "keywords": ["..."] }],
56
- "roles": [{ "name": "<role>", "prefix": "<PREFIX>", "inner_loop": false }],
57
- "complexity": { "score": 0, "level": "Low|Medium|High" },
58
- "needs_architecture": true,
59
- "needs_testing": true,
60
- "needs_review": true
61
- }
62
- ```
@@ -1,234 +0,0 @@
1
- # Command: Dispatch
2
-
3
- Create the iterative development task chain with correct dependencies and structured task descriptions.
4
-
5
- ## Phase 2: Context Loading
6
-
7
- | Input | Source | Required |
8
- |-------|--------|----------|
9
- | User requirement | From coordinator Phase 1 | Yes |
10
- | Session folder | From coordinator Phase 2 | Yes |
11
- | Pipeline definition | From SKILL.md Pipeline Definitions | Yes |
12
- | Pipeline mode | From session.json `pipeline` | Yes |
13
-
14
- 1. Load user requirement and scope from session.json
15
- 2. Load pipeline stage definitions from SKILL.md Task Metadata Registry
16
- 3. Read `pipeline` mode from session.json (patch / sprint / multi-sprint)
17
-
18
- ## Phase 3: Task Chain Creation
19
-
20
- ### Task Description Template
21
-
22
- Every task description uses structured format for clarity:
23
-
24
- ```
25
- TaskCreate({
26
- subject: "<TASK-ID>",
27
- description: "PURPOSE: <what this task achieves> | Success: <measurable completion criteria>
28
- TASK:
29
- - <step 1: specific action>
30
- - <step 2: specific action>
31
- - <step 3: specific action>
32
- CONTEXT:
33
- - Session: <session-folder>
34
- - Scope: <task-scope>
35
- - Upstream artifacts: <artifact-1>, <artifact-2>
36
- - Shared memory: <session>/.msg/meta.json
37
- EXPECTED: <deliverable path> + <quality criteria>
38
- CONSTRAINTS: <scope limits, focus areas>
39
- ---
40
- InnerLoop: <true|false>"
41
- })
42
- TaskUpdate({ taskId: "<TASK-ID>", addBlockedBy: [<dependency-list>], owner: "<role>" })
43
- ```
44
-
45
- ### Mode Router
46
-
47
- | Mode | Action |
48
- |------|--------|
49
- | `patch` | Create DEV-001 + VERIFY-001 |
50
- | `sprint` | Create DESIGN-001 + DEV-001 + VERIFY-001 + REVIEW-001 |
51
- | `multi-sprint` | Create Sprint 1 chain, subsequent sprints created dynamically |
52
-
53
- ---
54
-
55
- ### Patch Pipeline
56
-
57
- **DEV-001** (developer):
58
- ```
59
- TaskCreate({
60
- subject: "DEV-001",
61
- description: "PURPOSE: Implement fix | Success: Fix applied, syntax clean
62
- TASK:
63
- - Load target files and understand context
64
- - Apply fix changes
65
- - Validate syntax
66
- CONTEXT:
67
- - Session: <session-folder>
68
- - Scope: <task-scope>
69
- - Shared memory: <session>/.msg/meta.json
70
- EXPECTED: Modified source files + <session>/code/dev-log.md | Syntax clean
71
- CONSTRAINTS: Minimal changes | Preserve existing behavior
72
- ---
73
- InnerLoop: true"
74
- })
75
- TaskUpdate({ taskId: "DEV-001", owner: "developer" })
76
- ```
77
-
78
- **VERIFY-001** (tester):
79
- ```
80
- TaskCreate({
81
- subject: "VERIFY-001",
82
- description: "PURPOSE: Verify fix correctness | Success: Tests pass, no regressions
83
- TASK:
84
- - Detect test framework
85
- - Run targeted tests for changed files
86
- - Run regression test suite
87
- CONTEXT:
88
- - Session: <session-folder>
89
- - Scope: <task-scope>
90
- - Upstream artifacts: code/dev-log.md
91
- - Shared memory: <session>/.msg/meta.json
92
- EXPECTED: <session>/verify/verify-001.json | Pass rate >= 95%
93
- CONSTRAINTS: Focus on changed files | Report any regressions
94
- ---
95
- InnerLoop: false"
96
- })
97
- TaskUpdate({ taskId: "VERIFY-001", addBlockedBy: ["DEV-001"], owner: "tester" })
98
- ```
99
-
100
- ---
101
-
102
- ### Sprint Pipeline
103
-
104
- **DESIGN-001** (architect):
105
- ```
106
- TaskCreate({
107
- subject: "DESIGN-001",
108
- description: "PURPOSE: Technical design and task breakdown | Success: Design document + task breakdown ready
109
- TASK:
110
- - Explore codebase for patterns and dependencies
111
- - Create component design with integration points
112
- - Break down into implementable tasks with acceptance criteria
113
- CONTEXT:
114
- - Session: <session-folder>
115
- - Scope: <task-scope>
116
- - Shared memory: <session>/.msg/meta.json
117
- EXPECTED: <session>/design/design-001.md + <session>/design/task-breakdown.json | Components defined, tasks actionable
118
- CONSTRAINTS: Focus on <task-scope> | Risk assessment required
119
- ---
120
- InnerLoop: false"
121
- })
122
- TaskUpdate({ taskId: "DESIGN-001", owner: "architect" })
123
- ```
124
-
125
- **DEV-001** (developer):
126
- ```
127
- TaskCreate({
128
- subject: "DEV-001",
129
- description: "PURPOSE: Implement design | Success: All design tasks implemented, syntax clean
130
- TASK:
131
- - Load design and task breakdown
132
- - Implement tasks in execution order
133
- - Validate syntax after changes
134
- CONTEXT:
135
- - Session: <session-folder>
136
- - Scope: <task-scope>
137
- - Upstream artifacts: design/design-001.md, design/task-breakdown.json
138
- - Shared memory: <session>/.msg/meta.json
139
- EXPECTED: Modified source files + <session>/code/dev-log.md | Syntax clean, all tasks done
140
- CONSTRAINTS: Follow design | Preserve existing behavior | Follow code conventions
141
- ---
142
- InnerLoop: true"
143
- })
144
- TaskUpdate({ taskId: "DEV-001", addBlockedBy: ["DESIGN-001"], owner: "developer" })
145
- ```
146
-
147
- **VERIFY-001** (tester, parallel with REVIEW-001):
148
- ```
149
- TaskCreate({
150
- subject: "VERIFY-001",
151
- description: "PURPOSE: Verify implementation | Success: Tests pass, no regressions
152
- TASK:
153
- - Detect test framework
154
- - Run tests for changed files
155
- - Run regression test suite
156
- CONTEXT:
157
- - Session: <session-folder>
158
- - Scope: <task-scope>
159
- - Upstream artifacts: code/dev-log.md
160
- - Shared memory: <session>/.msg/meta.json
161
- EXPECTED: <session>/verify/verify-001.json | Pass rate >= 95%
162
- CONSTRAINTS: Focus on changed files | Report regressions
163
- ---
164
- InnerLoop: false"
165
- })
166
- TaskUpdate({ taskId: "VERIFY-001", addBlockedBy: ["DEV-001"], owner: "tester" })
167
- ```
168
-
169
- **REVIEW-001** (reviewer, parallel with VERIFY-001):
170
- ```
171
- TaskCreate({
172
- subject: "REVIEW-001",
173
- description: "PURPOSE: Code review for correctness and quality | Success: All dimensions reviewed, verdict issued
174
- TASK:
175
- - Load changed files and design document
176
- - Review across 4 dimensions: correctness, completeness, maintainability, security
177
- - Score quality (1-10) and issue verdict
178
- CONTEXT:
179
- - Session: <session-folder>
180
- - Scope: <task-scope>
181
- - Upstream artifacts: design/design-001.md, code/dev-log.md
182
- - Shared memory: <session>/.msg/meta.json
183
- EXPECTED: <session>/review/review-001.md | Per-dimension findings with severity
184
- CONSTRAINTS: Focus on implementation changes | Provide file:line references
185
- ---
186
- InnerLoop: false"
187
- })
188
- TaskUpdate({ taskId: "REVIEW-001", addBlockedBy: ["DEV-001"], owner: "reviewer" })
189
- ```
190
-
191
- ---
192
-
193
- ### Multi-Sprint Pipeline
194
-
195
- Sprint 1: DESIGN-001 -> DEV-001 -> DEV-002(incremental) -> VERIFY-001 -> DEV-fix -> REVIEW-001
196
-
197
- Create Sprint 1 tasks using sprint templates above, plus:
198
-
199
- **DEV-002** (developer, incremental):
200
- ```
201
- TaskCreate({
202
- subject: "DEV-002",
203
- description: "PURPOSE: Incremental implementation | Success: Remaining tasks implemented
204
- TASK:
205
- - Load remaining tasks from breakdown
206
- - Implement incrementally
207
- - Validate syntax
208
- CONTEXT:
209
- - Session: <session-folder>
210
- - Scope: <task-scope>
211
- - Upstream artifacts: design/task-breakdown.json, code/dev-log.md
212
- - Shared memory: <session>/.msg/meta.json
213
- EXPECTED: Modified source files + updated dev-log.md
214
- CONSTRAINTS: Incremental delivery | Follow existing patterns
215
- ---
216
- InnerLoop: true"
217
- })
218
- TaskUpdate({ taskId: "DEV-002", addBlockedBy: ["DEV-001"], owner: "developer" })
219
- ```
220
-
221
- Subsequent sprints created dynamically after Sprint N completes.
222
-
223
- ## Phase 4: Validation
224
-
225
- Verify task chain integrity:
226
-
227
- | Check | Method | Expected |
228
- |-------|--------|----------|
229
- | Task count correct | TaskList count | patch: 2, sprint: 4, multi: 5+ |
230
- | Dependencies correct | Trace addBlockedBy graph | Acyclic, correct ordering |
231
- | No circular dependencies | Trace full graph | Acyclic |
232
- | Structured descriptions | Each has PURPOSE/TASK/CONTEXT/EXPECTED | All present |
233
-
234
- If validation fails, fix the specific task and re-validate.
@@ -1,182 +0,0 @@
1
- # Command: Monitor
2
-
3
- Event-driven pipeline coordination. Beat model: coordinator wake -> process -> spawn -> STOP.
4
-
5
- ## Constants
6
-
7
- - SPAWN_MODE: background
8
- - ONE_STEP_PER_INVOCATION: true
9
- - FAST_ADVANCE_AWARE: true
10
- - WORKER_AGENT: team-worker
11
- - MAX_GC_ROUNDS: 3
12
-
13
- ## Handler Router
14
-
15
- | Source | Handler |
16
- |--------|---------|
17
- | Message contains [architect], [developer], [tester], [reviewer] | handleCallback |
18
- | "capability_gap" | handleAdapt |
19
- | "check" or "status" | handleCheck |
20
- | "resume" or "continue" | handleResume |
21
- | All tasks completed | handleComplete |
22
- | Default | handleSpawnNext |
23
-
24
- ## Phase 2: Context Loading
25
-
26
- | Input | Source | Required |
27
- |-------|--------|----------|
28
- | Session state | <session>/session.json | Yes |
29
- | Task list | TaskList() | Yes |
30
- | Trigger event | From Entry Router detection | Yes |
31
- | Meta state | <session>/.msg/meta.json | Yes |
32
- | Task ledger | <session>/task-ledger.json | No |
33
-
34
- 1. Load session.json for current state, pipeline mode, gc_round, max_gc_rounds
35
- 2. Run TaskList() to get current task statuses
36
- 3. Identify trigger event type from Entry Router
37
-
38
- ## Phase 3: Event Handlers
39
-
40
- ### handleCallback
41
-
42
- Triggered when a worker sends completion message.
43
-
44
- 1. Parse message to identify role and task ID:
45
-
46
- | Message Pattern | Role Detection |
47
- |----------------|---------------|
48
- | `[architect]` or task ID `DESIGN-*` | architect |
49
- | `[developer]` or task ID `DEV-*` | developer |
50
- | `[tester]` or task ID `VERIFY-*` | tester |
51
- | `[reviewer]` or task ID `REVIEW-*` | reviewer |
52
-
53
- 2. Mark task as completed:
54
-
55
- ```
56
- TaskUpdate({ taskId: "<task-id>", status: "completed" })
57
- ```
58
-
59
- 3. Record completion in session state and update task-ledger.json metrics
60
-
61
- 4. **Generator-Critic check** (when reviewer completes):
62
- - If completed task is REVIEW-* AND pipeline is sprint or multi-sprint:
63
- - Read review report for GC signal (critical_count, score)
64
- - Read session.json for gc_round
65
-
66
- | GC Signal | gc_round < max | Action |
67
- |-----------|----------------|--------|
68
- | review.critical_count > 0 OR review.score < 7 | Yes | Increment gc_round, create DEV-fix task blocked by this REVIEW, log `gc_loop_trigger` |
69
- | review.critical_count > 0 OR review.score < 7 | No (>= max) | Force convergence, accept with warning, log to wisdom/issues.md |
70
- | review.critical_count == 0 AND review.score >= 7 | - | Review passed, proceed to handleComplete check |
71
-
72
- - Log team_msg with type "gc_loop_trigger" or "task_unblocked"
73
-
74
- 5. Proceed to handleSpawnNext
75
-
76
- ### handleSpawnNext
77
-
78
- Find and spawn the next ready tasks.
79
-
80
- 1. Scan task list for tasks where:
81
- - Status is "pending"
82
- - All blockedBy tasks have status "completed"
83
-
84
- 2. For each ready task, determine role from task prefix:
85
-
86
- | Task Prefix | Role | Inner Loop |
87
- |-------------|------|------------|
88
- | DESIGN-* | architect | false |
89
- | DEV-* | developer | true |
90
- | VERIFY-* | tester | false |
91
- | REVIEW-* | reviewer | false |
92
-
93
- 3. Spawn team-worker:
94
-
95
- ```
96
- Agent({
97
- subagent_type: "team-worker",
98
- description: "Spawn <role> worker for <task-id>",
99
- team_name: "iterdev",
100
- name: "<role>",
101
- run_in_background: true,
102
- prompt: `## Role Assignment
103
- role: <role>
104
- role_spec: ~ or <project>/.claude/skills/team-iterdev/roles/<role>/role.md
105
- session: <session-folder>
106
- session_id: <session-id>
107
- team_name: iterdev
108
- requirement: <task-description>
109
- inner_loop: <true|false>
110
-
111
- Read role_spec file to load Phase 2-4 domain instructions.
112
- Execute built-in Phase 1 -> role-spec Phase 2-4 -> built-in Phase 5.`
113
- })
114
- ```
115
-
116
- 4. **Parallel spawn rules**:
117
-
118
- | Pipeline | Scenario | Spawn Behavior |
119
- |----------|----------|---------------|
120
- | Patch | DEV -> VERIFY | One worker at a time |
121
- | Sprint | VERIFY + REVIEW both unblocked | Spawn BOTH in parallel |
122
- | Sprint | Other stages | One worker at a time |
123
- | Multi-Sprint | VERIFY + DEV-fix both unblocked | Spawn BOTH in parallel |
124
- | Multi-Sprint | Other stages | One worker at a time |
125
-
126
- 5. STOP after spawning -- wait for next callback
127
-
128
- ### handleCheck
129
-
130
- Output current pipeline status. Do NOT advance pipeline.
131
-
132
- ```
133
- Pipeline Status (<pipeline-mode>):
134
- [DONE] DESIGN-001 (architect) -> design/design-001.md
135
- [DONE] DEV-001 (developer) -> code/dev-log.md
136
- [RUN] VERIFY-001 (tester) -> verifying...
137
- [RUN] REVIEW-001 (reviewer) -> reviewing...
138
- [WAIT] DEV-fix (developer) -> blocked by REVIEW-001
139
-
140
- GC Rounds: <gc_round>/<max_gc_rounds>
141
- Sprint: <sprint_id>
142
- Session: <session-id>
143
- ```
144
-
145
- ### handleResume
146
-
147
- Resume pipeline after user pause or interruption.
148
-
149
- 1. Audit task list for inconsistencies:
150
- - Tasks stuck in "in_progress" -> reset to "pending"
151
- - Tasks with completed blockers but still "pending" -> include in spawn list
152
- 2. Proceed to handleSpawnNext
153
-
154
- ### handleComplete
155
-
156
- Triggered when all pipeline tasks are completed.
157
-
158
- **Completion check by mode**:
159
-
160
- | Mode | Completion Condition |
161
- |------|---------------------|
162
- | patch | DEV-001 + VERIFY-001 completed |
163
- | sprint | DESIGN-001 + DEV-001 + VERIFY-001 + REVIEW-001 (+ any GC tasks) completed |
164
- | multi-sprint | All sprint tasks (+ any GC tasks) completed |
165
-
166
- 1. Verify all tasks completed via TaskList()
167
- 2. If any tasks not completed, return to handleSpawnNext
168
- 3. **Multi-sprint check**: If multi-sprint AND more sprints planned:
169
- - Record sprint metrics to .msg/meta.json sprint_history
170
- - Evaluate downgrade eligibility (velocity >= expected, review avg >= 8)
171
- - Pause for user confirmation before Sprint N+1
172
- 4. If all completed, transition to coordinator Phase 5 (Report + Completion Action)
173
-
174
- ## Phase 4: State Persistence
175
-
176
- After every handler execution:
177
-
178
- 1. Update session.json with current state (gc_round, last event, active tasks)
179
- 2. Update task-ledger.json metrics (completed count, in_progress count, velocity)
180
- 3. Update .msg/meta.json gc_round if changed
181
- 4. Verify task list consistency
182
- 5. STOP and wait for next event