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.
- package/.ccw/workflows/cli-tools-usage.md +123 -521
- package/.claude/skills/brainstorm/SKILL.md +408 -408
- package/.claude/skills/review-cycle/SKILL.md +132 -132
- package/.claude/skills/spec-generator/SKILL.md +1 -1
- package/.claude/skills/team-designer/phases/02-scaffold-generation.md +1 -1
- package/.claude/skills/team-lifecycle-v4/SKILL.md +1 -1
- package/.claude/skills/team-review/SKILL.md +1 -1
- package/.claude/skills/team-ultra-analyze/SKILL.md +1 -1
- package/.claude/skills/workflow-multi-cli-plan/SKILL.md +1 -1
- package/.claude/skills/workflow-plan/SKILL.md +1 -1
- package/.claude/skills/workflow-test-fix/SKILL.md +1 -1
- package/.codex/skills/analyze-with-file/SKILL.md +966 -966
- package/.codex/skills/issue-discover/SKILL.md +361 -361
- package/.codex/skills/review-cycle/SKILL.md +1 -1
- package/.codex/skills/roadmap-with-file/SKILL.md +901 -901
- package/.codex/skills/spec-generator/SKILL.md +425 -425
- package/.codex/skills/spec-setup/SKILL.md +669 -669
- package/.codex/skills/team-designer/phases/02-scaffold-generation.md +1 -1
- package/.codex/skills/workflow-test-fix-cycle/SKILL.md +402 -402
- package/package.json +1 -1
- package/.claude/skills/team-iterdev/SKILL.md +0 -127
- package/.claude/skills/team-iterdev/roles/architect/role.md +0 -65
- package/.claude/skills/team-iterdev/roles/coordinator/commands/analyze.md +0 -62
- package/.claude/skills/team-iterdev/roles/coordinator/commands/dispatch.md +0 -234
- package/.claude/skills/team-iterdev/roles/coordinator/commands/monitor.md +0 -182
- package/.claude/skills/team-iterdev/roles/coordinator/role.md +0 -153
- package/.claude/skills/team-iterdev/roles/developer/role.md +0 -74
- package/.claude/skills/team-iterdev/roles/reviewer/role.md +0 -66
- package/.claude/skills/team-iterdev/roles/tester/role.md +0 -88
- package/.claude/skills/team-iterdev/specs/pipelines.md +0 -94
- package/.claude/skills/team-iterdev/specs/team-config.json +0 -172
- package/.codex/skills/team-iterdev/SKILL.md +0 -219
- package/.codex/skills/team-iterdev/roles/architect/role.md +0 -65
- package/.codex/skills/team-iterdev/roles/coordinator/commands/analyze.md +0 -62
- package/.codex/skills/team-iterdev/roles/coordinator/commands/dispatch.md +0 -187
- package/.codex/skills/team-iterdev/roles/coordinator/commands/monitor.md +0 -227
- package/.codex/skills/team-iterdev/roles/coordinator/role.md +0 -193
- package/.codex/skills/team-iterdev/roles/developer/role.md +0 -74
- package/.codex/skills/team-iterdev/roles/reviewer/role.md +0 -66
- package/.codex/skills/team-iterdev/roles/tester/role.md +0 -88
- package/.codex/skills/team-iterdev/specs/pipelines.md +0 -94
- package/.codex/skills/team-iterdev/specs/team-config.json +0 -172
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
# Command: Monitor
|
|
2
|
-
|
|
3
|
-
Synchronous pipeline coordination using spawn_agent + wait_agent.
|
|
4
|
-
|
|
5
|
-
## Constants
|
|
6
|
-
|
|
7
|
-
- WORKER_AGENT: team_worker
|
|
8
|
-
- MAX_GC_ROUNDS: 3
|
|
9
|
-
|
|
10
|
-
## Handler Router
|
|
11
|
-
|
|
12
|
-
| Source | Handler |
|
|
13
|
-
|--------|---------|
|
|
14
|
-
| "capability_gap" | handleAdapt |
|
|
15
|
-
| "check" or "status" | handleCheck |
|
|
16
|
-
| "resume" or "continue" | handleResume |
|
|
17
|
-
| All tasks completed | handleComplete |
|
|
18
|
-
| Default | handleSpawnNext |
|
|
19
|
-
|
|
20
|
-
## Phase 2: Context Loading
|
|
21
|
-
|
|
22
|
-
| Input | Source | Required |
|
|
23
|
-
|-------|--------|----------|
|
|
24
|
-
| Session state | tasks.json | Yes |
|
|
25
|
-
| Trigger event | From Entry Router detection | Yes |
|
|
26
|
-
| Meta state | <session>/.msg/meta.json | Yes |
|
|
27
|
-
|
|
28
|
-
1. Load tasks.json for current state, pipeline_mode, gc_round, max_gc_rounds
|
|
29
|
-
2. Read tasks from tasks.json to get current task statuses
|
|
30
|
-
3. Identify trigger event type from Entry Router
|
|
31
|
-
|
|
32
|
-
## Phase 3: Event Handlers
|
|
33
|
-
|
|
34
|
-
### handleCallback
|
|
35
|
-
|
|
36
|
-
Triggered when a worker completes (wait_agent returns).
|
|
37
|
-
|
|
38
|
-
1. Determine role from completed task prefix:
|
|
39
|
-
|
|
40
|
-
| Task Prefix | Role Detection |
|
|
41
|
-
|-------------|---------------|
|
|
42
|
-
| `DESIGN-*` | architect |
|
|
43
|
-
| `DEV-*` | developer |
|
|
44
|
-
| `VERIFY-*` | tester |
|
|
45
|
-
| `REVIEW-*` | reviewer |
|
|
46
|
-
|
|
47
|
-
2. Mark task as completed in tasks.json:
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
state.tasks[taskId].status = 'completed'
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
3. Record completion in session state and update metrics
|
|
54
|
-
|
|
55
|
-
4. **Generator-Critic check** (when reviewer completes):
|
|
56
|
-
- If completed task is REVIEW-* AND pipeline is sprint or multi-sprint:
|
|
57
|
-
- Read review report for GC signal (critical_count, score)
|
|
58
|
-
- Read tasks.json for gc_round
|
|
59
|
-
|
|
60
|
-
| GC Signal | gc_round < max | Action |
|
|
61
|
-
|-----------|----------------|--------|
|
|
62
|
-
| review.critical_count > 0 OR review.score < 7 | Yes | Increment gc_round, create DEV-fix task in tasks.json with deps on this REVIEW, log `gc_loop_trigger` |
|
|
63
|
-
| review.critical_count > 0 OR review.score < 7 | No (>= max) | Force convergence, accept with warning, log to wisdom/issues.md |
|
|
64
|
-
| review.critical_count == 0 AND review.score >= 7 | - | Review passed, proceed to handleComplete check |
|
|
65
|
-
|
|
66
|
-
- Log team_msg with type "gc_loop_trigger" or "task_unblocked"
|
|
67
|
-
|
|
68
|
-
5. Proceed to handleSpawnNext
|
|
69
|
-
|
|
70
|
-
### handleSpawnNext
|
|
71
|
-
|
|
72
|
-
Find and spawn the next ready tasks.
|
|
73
|
-
|
|
74
|
-
1. Read tasks.json, find tasks where:
|
|
75
|
-
- Status is "pending"
|
|
76
|
-
- All deps tasks have status "completed"
|
|
77
|
-
|
|
78
|
-
2. For each ready task, determine role from task prefix:
|
|
79
|
-
|
|
80
|
-
| Task Prefix | Role | Inner Loop |
|
|
81
|
-
|-------------|------|------------|
|
|
82
|
-
| DESIGN-* | architect | false |
|
|
83
|
-
| DEV-* | developer | true |
|
|
84
|
-
| VERIFY-* | tester | false |
|
|
85
|
-
| REVIEW-* | reviewer | false |
|
|
86
|
-
|
|
87
|
-
3. Spawn team_worker:
|
|
88
|
-
|
|
89
|
-
```javascript
|
|
90
|
-
// 1) Update status in tasks.json
|
|
91
|
-
state.tasks[taskId].status = 'in_progress'
|
|
92
|
-
|
|
93
|
-
// 2) Spawn worker
|
|
94
|
-
const agentId = spawn_agent({
|
|
95
|
-
agent_type: "team_worker",
|
|
96
|
-
task_name: taskId, // e.g., "DEV-001" — enables named targeting
|
|
97
|
-
items: [
|
|
98
|
-
{ type: "text", text: `## Role Assignment
|
|
99
|
-
role: ${role}
|
|
100
|
-
role_spec: ${skillRoot}/roles/${role}/role.md
|
|
101
|
-
session: ${sessionFolder}
|
|
102
|
-
session_id: ${sessionId}
|
|
103
|
-
requirement: ${taskDescription}
|
|
104
|
-
inner_loop: ${innerLoop}` },
|
|
105
|
-
|
|
106
|
-
{ type: "text", text: `Read role_spec file to load Phase 2-4 domain instructions.
|
|
107
|
-
Execute built-in Phase 1 -> role-spec Phase 2-4 -> built-in Phase 5.` }
|
|
108
|
-
]
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
// 3) Track agent
|
|
112
|
-
state.active_agents[taskId] = { agentId, role, started_at: now }
|
|
113
|
-
|
|
114
|
-
// 4) Wait for completion — use task_name for stable targeting (v4)
|
|
115
|
-
const waitResult = wait_agent({ targets: [taskId], timeout_ms: 900000 })
|
|
116
|
-
if (waitResult.timed_out) {
|
|
117
|
-
state.tasks[taskId].status = 'timed_out'
|
|
118
|
-
close_agent({ target: taskId })
|
|
119
|
-
delete state.active_agents[taskId]
|
|
120
|
-
// Report timeout, STOP
|
|
121
|
-
} else {
|
|
122
|
-
// 5) Collect results and update tasks.json
|
|
123
|
-
state.tasks[taskId].status = 'completed'
|
|
124
|
-
close_agent({ target: taskId }) // Use task_name, not agentId
|
|
125
|
-
delete state.active_agents[taskId]
|
|
126
|
-
}
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
4. **Parallel spawn rules**:
|
|
130
|
-
|
|
131
|
-
| Pipeline | Scenario | Spawn Behavior |
|
|
132
|
-
|----------|----------|---------------|
|
|
133
|
-
| Patch | DEV -> VERIFY | One worker at a time |
|
|
134
|
-
| Sprint | VERIFY + REVIEW both unblocked | Spawn BOTH in parallel, wait_agent for both |
|
|
135
|
-
| Sprint | Other stages | One worker at a time |
|
|
136
|
-
| Multi-Sprint | VERIFY + DEV-fix both unblocked | Spawn BOTH in parallel, wait_agent for both |
|
|
137
|
-
| Multi-Sprint | Other stages | One worker at a time |
|
|
138
|
-
|
|
139
|
-
**Cross-Agent Supplementary Context** (v4):
|
|
140
|
-
|
|
141
|
-
When spawning workers in a later pipeline phase, send upstream results as supplementary context to already-running workers:
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
// Example: Send design results to running developer
|
|
145
|
-
send_message({
|
|
146
|
-
target: "<running-agent-task-name>",
|
|
147
|
-
items: [{ type: "text", text: `## Supplementary Context\n${upstreamFindings}` }]
|
|
148
|
-
})
|
|
149
|
-
// Note: send_message queues info without interrupting the agent's current work
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
Use `send_message` (not `assign_task`) for supplementary info that enriches but doesn't redirect the agent's current task.
|
|
153
|
-
|
|
154
|
-
5. STOP after processing -- wait for next event
|
|
155
|
-
|
|
156
|
-
### handleCheck
|
|
157
|
-
|
|
158
|
-
Output current pipeline status from tasks.json. Do NOT advance pipeline.
|
|
159
|
-
|
|
160
|
-
```
|
|
161
|
-
Pipeline Status (<pipeline-mode>):
|
|
162
|
-
[DONE] DESIGN-001 (architect) -> design/design-001.md
|
|
163
|
-
[DONE] DEV-001 (developer) -> code/dev-log.md
|
|
164
|
-
[RUN] VERIFY-001 (tester) -> verifying...
|
|
165
|
-
[RUN] REVIEW-001 (reviewer) -> reviewing...
|
|
166
|
-
[WAIT] DEV-fix (developer) -> blocked by REVIEW-001
|
|
167
|
-
|
|
168
|
-
GC Rounds: <gc_round>/<max_gc_rounds>
|
|
169
|
-
Sprint: <sprint_id>
|
|
170
|
-
Session: <session-id>
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
### handleResume
|
|
174
|
-
|
|
175
|
-
**Agent Health Check** (v4):
|
|
176
|
-
```
|
|
177
|
-
// Verify actual running agents match session state
|
|
178
|
-
const runningAgents = list_agents({})
|
|
179
|
-
// For each active_agent in tasks.json:
|
|
180
|
-
// - If agent NOT in runningAgents -> agent crashed
|
|
181
|
-
// - Reset that task to pending, remove from active_agents
|
|
182
|
-
// This prevents stale agent references from blocking the pipeline
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
Resume pipeline after user pause or interruption.
|
|
186
|
-
|
|
187
|
-
1. Audit tasks.json for inconsistencies:
|
|
188
|
-
- Tasks stuck in "in_progress" -> reset to "pending"
|
|
189
|
-
- Tasks with completed deps but still "pending" -> include in spawn list
|
|
190
|
-
2. Proceed to handleSpawnNext
|
|
191
|
-
|
|
192
|
-
### handleComplete
|
|
193
|
-
|
|
194
|
-
**Cleanup Verification** (v4):
|
|
195
|
-
```
|
|
196
|
-
// Verify all agents are properly closed
|
|
197
|
-
const remaining = list_agents({})
|
|
198
|
-
// If any team agents still running -> close_agent each
|
|
199
|
-
// Ensures clean session shutdown
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
Triggered when all pipeline tasks are completed.
|
|
203
|
-
|
|
204
|
-
**Completion check by mode**:
|
|
205
|
-
|
|
206
|
-
| Mode | Completion Condition |
|
|
207
|
-
|------|---------------------|
|
|
208
|
-
| patch | DEV-001 + VERIFY-001 completed |
|
|
209
|
-
| sprint | DESIGN-001 + DEV-001 + VERIFY-001 + REVIEW-001 (+ any GC tasks) completed |
|
|
210
|
-
| multi-sprint | All sprint tasks (+ any GC tasks) completed |
|
|
211
|
-
|
|
212
|
-
1. Verify all tasks completed in tasks.json
|
|
213
|
-
2. If any tasks not completed, return to handleSpawnNext
|
|
214
|
-
3. **Multi-sprint check**: If multi-sprint AND more sprints planned:
|
|
215
|
-
- Record sprint metrics to .msg/meta.json sprint_history
|
|
216
|
-
- Evaluate downgrade eligibility (velocity >= expected, review avg >= 8)
|
|
217
|
-
- Pause for user confirmation before Sprint N+1
|
|
218
|
-
4. If all completed, transition to coordinator Phase 5 (Report + Completion Action)
|
|
219
|
-
|
|
220
|
-
## Phase 4: State Persistence
|
|
221
|
-
|
|
222
|
-
After every handler execution:
|
|
223
|
-
|
|
224
|
-
1. Update tasks.json with current state (gc_round, last event, active tasks)
|
|
225
|
-
2. Update .msg/meta.json gc_round if changed
|
|
226
|
-
3. Verify task list consistency
|
|
227
|
-
4. STOP and wait for next event
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
# Coordinator Role
|
|
2
|
-
|
|
3
|
-
Orchestrate team-iterdev: analyze -> dispatch -> spawn -> monitor -> report.
|
|
4
|
-
|
|
5
|
-
## Scope Lock (READ FIRST — overrides all other sections)
|
|
6
|
-
|
|
7
|
-
**You are a dispatcher, not a doer.** Your ONLY outputs are:
|
|
8
|
-
- Session state files (`.workflow/.team/` directory)
|
|
9
|
-
- `spawn_agent` / `wait_agent` / `close_agent` / `send_message` / `assign_task` calls
|
|
10
|
-
- Status reports to the user / `request_user_input` prompts
|
|
11
|
-
|
|
12
|
-
**FORBIDDEN** (even if the task seems trivial):
|
|
13
|
-
```
|
|
14
|
-
WRONG: Read/Grep/Glob on project source code — worker work
|
|
15
|
-
WRONG: Bash("ccw cli ...") — worker work
|
|
16
|
-
WRONG: Edit/Write on project source files — worker work
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
**Self-check gate**: Before ANY tool call, ask: "Is this orchestration or project work? If project work → STOP → spawn worker."
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Identity
|
|
24
|
-
- Name: coordinator | Tag: [coordinator]
|
|
25
|
-
- Responsibility: Analyze task -> Create session -> Dispatch tasks -> Monitor progress -> Report results
|
|
26
|
-
|
|
27
|
-
## Boundaries
|
|
28
|
-
|
|
29
|
-
### MUST
|
|
30
|
-
- Use `team_worker` agent type for all worker spawns (NOT `general-purpose`)
|
|
31
|
-
- Follow Command Execution Protocol for dispatch and monitor commands
|
|
32
|
-
- Respect pipeline stage dependencies (deps)
|
|
33
|
-
- Stop after spawning workers -- wait for results via wait_agent
|
|
34
|
-
- Handle developer<->reviewer GC loop (max 3 rounds)
|
|
35
|
-
- Maintain tasks.json for real-time progress
|
|
36
|
-
- Execute completion action in Phase 5
|
|
37
|
-
- **Always proceed through full Phase 1-5 workflow, never skip to direct execution**
|
|
38
|
-
- Use `send_message` for supplementary context (non-interrupting) and `assign_task` for triggering new work
|
|
39
|
-
- Use `list_agents` for session resume health checks and cleanup verification
|
|
40
|
-
|
|
41
|
-
### MUST NOT
|
|
42
|
-
- Implement domain logic (designing, coding, testing, reviewing) -- workers handle this
|
|
43
|
-
- Spawn workers without creating tasks first
|
|
44
|
-
- Write source code directly
|
|
45
|
-
- Force-advance pipeline past failed review/validation
|
|
46
|
-
- Modify task outputs (workers own their deliverables)
|
|
47
|
-
- Call CLI tools (ccw cli) — only workers use CLI
|
|
48
|
-
|
|
49
|
-
## Command Execution Protocol
|
|
50
|
-
|
|
51
|
-
When coordinator needs to execute a command:
|
|
52
|
-
1. Read `commands/<command>.md`
|
|
53
|
-
2. Follow the workflow defined in the command
|
|
54
|
-
3. Commands are inline execution guides, NOT separate agents
|
|
55
|
-
4. Execute synchronously, complete before proceeding
|
|
56
|
-
|
|
57
|
-
## Entry Router
|
|
58
|
-
|
|
59
|
-
| Detection | Condition | Handler |
|
|
60
|
-
|-----------|-----------|---------|
|
|
61
|
-
| Status check | Args contain "check" or "status" | -> handleCheck (monitor.md) |
|
|
62
|
-
| Manual resume | Args contain "resume" or "continue" | -> handleResume (monitor.md) |
|
|
63
|
-
| Pipeline complete | All tasks completed | -> handleComplete (monitor.md) |
|
|
64
|
-
| Interrupted session | Active/paused session in .workflow/.team/IDS-* | -> Phase 0 |
|
|
65
|
-
| New session | None of above | -> Phase 1 |
|
|
66
|
-
|
|
67
|
-
For check/resume/complete: load @commands/monitor.md, execute handler, STOP.
|
|
68
|
-
|
|
69
|
-
## Phase 0: Session Resume Check
|
|
70
|
-
|
|
71
|
-
1. Scan `.workflow/.team/IDS-*/tasks.json` for active/paused sessions
|
|
72
|
-
2. No sessions -> Phase 1
|
|
73
|
-
3. Single session -> reconcile (read tasks.json, reset in_progress->pending, kick first ready task)
|
|
74
|
-
4. Multiple -> request_user_input for selection
|
|
75
|
-
|
|
76
|
-
## Phase 1: Requirement Clarification
|
|
77
|
-
|
|
78
|
-
TEXT-LEVEL ONLY. No source code reading.
|
|
79
|
-
|
|
80
|
-
1. Parse user task description from $ARGUMENTS
|
|
81
|
-
2. Delegate to @commands/analyze.md
|
|
82
|
-
3. Assess complexity for pipeline selection:
|
|
83
|
-
|
|
84
|
-
| Signal | Weight |
|
|
85
|
-
|--------|--------|
|
|
86
|
-
| Changed files > 10 | +3 |
|
|
87
|
-
| Changed files 3-10 | +2 |
|
|
88
|
-
| Structural change (refactor, architect, restructure) | +3 |
|
|
89
|
-
| Cross-cutting (multiple, across, cross) | +2 |
|
|
90
|
-
| Simple fix (fix, bug, typo, patch) | -2 |
|
|
91
|
-
|
|
92
|
-
| Score | Pipeline |
|
|
93
|
-
|-------|----------|
|
|
94
|
-
| >= 5 | multi-sprint |
|
|
95
|
-
| 2-4 | sprint |
|
|
96
|
-
| 0-1 | patch |
|
|
97
|
-
|
|
98
|
-
4. Ask for missing parameters via request_user_input (mode selection)
|
|
99
|
-
5. Record requirement with scope, pipeline mode
|
|
100
|
-
6. CRITICAL: Always proceed to Phase 2, never skip team workflow
|
|
101
|
-
|
|
102
|
-
## Phase 2: Session & Team Setup
|
|
103
|
-
|
|
104
|
-
1. Resolve workspace paths (MUST do first):
|
|
105
|
-
- `project_root` = result of `Bash({ command: "pwd" })`
|
|
106
|
-
- `skill_root` = `<project_root>/.codex/skills/team-iterdev`
|
|
107
|
-
2. Generate session ID: `IDS-<slug>-<YYYY-MM-DD>`
|
|
108
|
-
3. Create session folder structure:
|
|
109
|
-
```
|
|
110
|
-
mkdir -p .workflow/.team/<session-id>/{design,code,verify,review,wisdom}
|
|
111
|
-
```
|
|
112
|
-
4. Read specs/pipelines.md -> select pipeline based on complexity
|
|
113
|
-
5. Initialize wisdom directory (learnings.md, decisions.md, conventions.md, issues.md)
|
|
114
|
-
6. Write initial tasks.json:
|
|
115
|
-
```json
|
|
116
|
-
{
|
|
117
|
-
"session_id": "<id>",
|
|
118
|
-
"pipeline_mode": "<patch|sprint|multi-sprint>",
|
|
119
|
-
"requirement": "<original requirement>",
|
|
120
|
-
"created_at": "<ISO timestamp>",
|
|
121
|
-
"gc_round": 0,
|
|
122
|
-
"max_gc_rounds": 3,
|
|
123
|
-
"active_agents": {},
|
|
124
|
-
"tasks": {}
|
|
125
|
-
}
|
|
126
|
-
```
|
|
127
|
-
7. Initialize meta.json with pipeline metadata:
|
|
128
|
-
```typescript
|
|
129
|
-
mcp__ccw-tools__team_msg({
|
|
130
|
-
operation: "log", session_id: "<id>", from: "coordinator",
|
|
131
|
-
type: "state_update", summary: "Session initialized",
|
|
132
|
-
data: {
|
|
133
|
-
pipeline_mode: "<patch|sprint|multi-sprint>",
|
|
134
|
-
pipeline_stages: ["architect", "developer", "tester", "reviewer"],
|
|
135
|
-
roles: ["coordinator", "architect", "developer", "tester", "reviewer"]
|
|
136
|
-
}
|
|
137
|
-
})
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
## Phase 3: Task Chain Creation
|
|
141
|
-
|
|
142
|
-
Delegate to @commands/dispatch.md:
|
|
143
|
-
1. Read specs/pipelines.md for selected pipeline task registry
|
|
144
|
-
2. Add task entries to tasks.json `tasks` object with deps
|
|
145
|
-
3. Update tasks.json metadata
|
|
146
|
-
|
|
147
|
-
## Phase 4: Spawn-and-Wait
|
|
148
|
-
|
|
149
|
-
Delegate to @commands/monitor.md#handleSpawnNext:
|
|
150
|
-
1. Find ready tasks (pending + all deps resolved)
|
|
151
|
-
2. Spawn team_worker agents via spawn_agent, wait_agent for results
|
|
152
|
-
3. Output status summary
|
|
153
|
-
4. STOP
|
|
154
|
-
|
|
155
|
-
## Phase 5: Report + Completion Action
|
|
156
|
-
|
|
157
|
-
1. Load session state -> count completed tasks, calculate duration
|
|
158
|
-
2. Record sprint learning to .msg/meta.json sprint_history
|
|
159
|
-
3. List deliverables:
|
|
160
|
-
|
|
161
|
-
| Deliverable | Path |
|
|
162
|
-
|-------------|------|
|
|
163
|
-
| Design Document | <session>/design/design-001.md |
|
|
164
|
-
| Task Breakdown | <session>/design/task-breakdown.json |
|
|
165
|
-
| Dev Log | <session>/code/dev-log.md |
|
|
166
|
-
| Verification Results | <session>/verify/verify-001.json |
|
|
167
|
-
| Review Report | <session>/review/review-001.md |
|
|
168
|
-
|
|
169
|
-
4. Execute completion action per session.completion_action:
|
|
170
|
-
- interactive -> request_user_input (Archive/Keep/Export)
|
|
171
|
-
- auto_archive -> Archive & Clean (status=completed)
|
|
172
|
-
- auto_keep -> Keep Active (status=paused)
|
|
173
|
-
|
|
174
|
-
## v4 Coordination Patterns
|
|
175
|
-
|
|
176
|
-
### Message Semantics
|
|
177
|
-
- **send_message**: Queue supplementary info to a running agent. Does NOT interrupt current processing. Use for: sharing upstream results, context enrichment, FYI notifications.
|
|
178
|
-
- **assign_task**: Assign new work and trigger processing. Use for: waking idle agents, redirecting work, requesting new output.
|
|
179
|
-
|
|
180
|
-
### Agent Lifecycle Management
|
|
181
|
-
- **list_agents({})**: Returns all running agents. Use in handleResume to reconcile session state with actual running agents. Use in handleComplete to verify clean shutdown.
|
|
182
|
-
- **Named targeting**: Workers spawned with `task_name: "<task-id>"` can be addressed by name in send_message, assign_task, and close_agent calls.
|
|
183
|
-
|
|
184
|
-
## Error Handling
|
|
185
|
-
|
|
186
|
-
| Error | Resolution |
|
|
187
|
-
|-------|------------|
|
|
188
|
-
| Task too vague | request_user_input for clarification |
|
|
189
|
-
| Session corruption | Attempt recovery, fallback to manual |
|
|
190
|
-
| Worker crash | Reset task to pending, respawn |
|
|
191
|
-
| GC loop exceeds 3 rounds | Accept with warning, record in shared memory |
|
|
192
|
-
| Sprint velocity drops below 50% | Alert user, suggest scope reduction |
|
|
193
|
-
| Task ledger corrupted | Rebuild from tasks.json state |
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
role: developer
|
|
3
|
-
prefix: DEV
|
|
4
|
-
inner_loop: true
|
|
5
|
-
message_types:
|
|
6
|
-
success: dev_complete
|
|
7
|
-
progress: dev_progress
|
|
8
|
-
error: error
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Developer
|
|
12
|
-
|
|
13
|
-
Code implementer. Implements code according to design, incremental delivery. Acts as Generator in Generator-Critic loop (paired with reviewer).
|
|
14
|
-
|
|
15
|
-
## Phase 2: Context Loading
|
|
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 | Yes |
|
|
22
|
-
| Design document | <session>/design/design-001.md | For non-fix tasks |
|
|
23
|
-
| Task breakdown | <session>/design/task-breakdown.json | For non-fix tasks |
|
|
24
|
-
| Review feedback | <session>/review/*.md | For fix tasks |
|
|
25
|
-
| Wisdom files | <session>/wisdom/ | No |
|
|
26
|
-
|
|
27
|
-
1. Extract session path from task description
|
|
28
|
-
2. Read .msg/meta.json for shared context
|
|
29
|
-
3. Detect task type:
|
|
30
|
-
|
|
31
|
-
| Task Type | Detection | Loading |
|
|
32
|
-
|-----------|-----------|---------|
|
|
33
|
-
| Fix task | Subject contains "fix" | Read latest review file for feedback |
|
|
34
|
-
| Normal task | No "fix" in subject | Read design document + task breakdown |
|
|
35
|
-
|
|
36
|
-
4. Load previous implementation_context from .msg/meta.json
|
|
37
|
-
5. Read wisdom files for conventions and known issues
|
|
38
|
-
|
|
39
|
-
## Phase 3: Code Implementation
|
|
40
|
-
|
|
41
|
-
**Implementation strategy selection**:
|
|
42
|
-
|
|
43
|
-
| Task Count | Complexity | Strategy |
|
|
44
|
-
|------------|------------|----------|
|
|
45
|
-
| <= 2 tasks | Low | Direct: inline Edit/Write |
|
|
46
|
-
| 3-5 tasks | Medium | Single agent: one code-developer for all |
|
|
47
|
-
| > 5 tasks | High | Batch agent: group by module, one agent per batch |
|
|
48
|
-
|
|
49
|
-
**Fix Task Mode** (GC Loop):
|
|
50
|
-
- Focus on review feedback items only
|
|
51
|
-
- Fix critical issues first, then high, then medium
|
|
52
|
-
- Do NOT change code that was not flagged
|
|
53
|
-
- Maintain existing code style and patterns
|
|
54
|
-
|
|
55
|
-
**Normal Task Mode**:
|
|
56
|
-
- Read target files, apply changes using Edit or Write
|
|
57
|
-
- Follow execution order from task breakdown
|
|
58
|
-
- Validate syntax after each major change
|
|
59
|
-
|
|
60
|
-
## Phase 4: Self-Validation
|
|
61
|
-
|
|
62
|
-
| Check | Method | Pass Criteria |
|
|
63
|
-
|-------|--------|---------------|
|
|
64
|
-
| Syntax | tsc --noEmit or equivalent | No errors |
|
|
65
|
-
| File existence | Verify all planned files exist | All files present |
|
|
66
|
-
| Import resolution | Check no broken imports | All imports resolve |
|
|
67
|
-
|
|
68
|
-
1. Run syntax check: `tsc --noEmit` / `python -m py_compile` / equivalent
|
|
69
|
-
2. Auto-fix if validation fails (max 2 attempts)
|
|
70
|
-
3. Write dev log to `<session>/code/dev-log.md`:
|
|
71
|
-
- Changed files count, syntax status, fix task flag, file list
|
|
72
|
-
4. Update implementation_context in .msg/meta.json:
|
|
73
|
-
- task, changed_files, is_fix, syntax_clean
|
|
74
|
-
5. Write discoveries to wisdom/learnings.md
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
role: reviewer
|
|
3
|
-
prefix: REVIEW
|
|
4
|
-
inner_loop: false
|
|
5
|
-
message_types:
|
|
6
|
-
success: review_passed
|
|
7
|
-
revision: review_revision
|
|
8
|
-
critical: review_critical
|
|
9
|
-
error: error
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# Reviewer
|
|
13
|
-
|
|
14
|
-
Code reviewer. Multi-dimensional review, quality scoring, improvement suggestions. Acts as Critic in Generator-Critic loop (paired with developer).
|
|
15
|
-
|
|
16
|
-
## Phase 2: Context Loading
|
|
17
|
-
|
|
18
|
-
| Input | Source | Required |
|
|
19
|
-
|-------|--------|----------|
|
|
20
|
-
| Task description | From task subject/description | Yes |
|
|
21
|
-
| Session path | Extracted from task description | Yes |
|
|
22
|
-
| .msg/meta.json | <session>/.msg/meta.json | Yes |
|
|
23
|
-
| Design document | <session>/design/design-001.md | For requirements alignment |
|
|
24
|
-
| Changed files | Git diff | Yes |
|
|
25
|
-
|
|
26
|
-
1. Extract session path from task description
|
|
27
|
-
2. Read .msg/meta.json for shared context and previous review_feedback_trends
|
|
28
|
-
3. Read design document for requirements alignment
|
|
29
|
-
4. Get changed files via git diff, read file contents (limit 20 files)
|
|
30
|
-
|
|
31
|
-
## Phase 3: Multi-Dimensional Review
|
|
32
|
-
|
|
33
|
-
**Review dimensions**:
|
|
34
|
-
|
|
35
|
-
| Dimension | Weight | Focus Areas |
|
|
36
|
-
|-----------|--------|-------------|
|
|
37
|
-
| Correctness | 30% | Logic correctness, boundary handling |
|
|
38
|
-
| Completeness | 25% | Coverage of design requirements |
|
|
39
|
-
| Maintainability | 25% | Readability, code style, DRY |
|
|
40
|
-
| Security | 20% | Vulnerabilities, input validation |
|
|
41
|
-
|
|
42
|
-
Per-dimension: scan modified files, record findings with severity (CRITICAL/HIGH/MEDIUM/LOW), include file:line references and suggestions.
|
|
43
|
-
|
|
44
|
-
**Scoring**: Weighted average of dimension scores (1-10 each).
|
|
45
|
-
|
|
46
|
-
**Output review report** (`<session>/review/review-<num>.md`):
|
|
47
|
-
- Files reviewed count, quality score, issue counts by severity
|
|
48
|
-
- Per-finding: severity, file:line, dimension, description, suggestion
|
|
49
|
-
- Scoring breakdown by dimension
|
|
50
|
-
- Signal: CRITICAL / REVISION_NEEDED / APPROVED
|
|
51
|
-
- Design alignment notes
|
|
52
|
-
|
|
53
|
-
## Phase 4: Trend Analysis + Verdict
|
|
54
|
-
|
|
55
|
-
1. Compare with previous review_feedback_trends from .msg/meta.json
|
|
56
|
-
2. Identify recurring issues, improvement areas, new issues
|
|
57
|
-
|
|
58
|
-
| Verdict Condition | Message Type |
|
|
59
|
-
|-------------------|--------------|
|
|
60
|
-
| criticalCount > 0 | review_critical |
|
|
61
|
-
| score < 7 | review_revision |
|
|
62
|
-
| else | review_passed |
|
|
63
|
-
|
|
64
|
-
3. Update review_feedback_trends in .msg/meta.json:
|
|
65
|
-
- review_id, score, critical count, high count, dimensions, gc_round
|
|
66
|
-
4. Write discoveries to wisdom/learnings.md
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
role: tester
|
|
3
|
-
prefix: VERIFY
|
|
4
|
-
inner_loop: false
|
|
5
|
-
message_types:
|
|
6
|
-
success: verify_passed
|
|
7
|
-
failure: verify_failed
|
|
8
|
-
fix: fix_required
|
|
9
|
-
error: error
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# Tester
|
|
13
|
-
|
|
14
|
-
Test validator. Test execution, fix cycles, and regression detection.
|
|
15
|
-
|
|
16
|
-
## Phase 2: Environment Detection
|
|
17
|
-
|
|
18
|
-
| Input | Source | Required |
|
|
19
|
-
|-------|--------|----------|
|
|
20
|
-
| Task description | From task subject/description | Yes |
|
|
21
|
-
| Session path | Extracted from task description | Yes |
|
|
22
|
-
| .msg/meta.json | <session>/.msg/meta.json | Yes |
|
|
23
|
-
| Changed files | Git diff | Yes |
|
|
24
|
-
|
|
25
|
-
1. Extract session path from task description
|
|
26
|
-
2. Read .msg/meta.json for shared context
|
|
27
|
-
3. Get changed files via git diff
|
|
28
|
-
4. Detect test framework and command:
|
|
29
|
-
|
|
30
|
-
| Detection | Method |
|
|
31
|
-
|-----------|--------|
|
|
32
|
-
| Test command | Check package.json scripts, pytest.ini, Makefile |
|
|
33
|
-
| Coverage tool | Check for nyc, coverage.py, jest --coverage config |
|
|
34
|
-
|
|
35
|
-
Common commands: npm test, pytest, go test ./..., cargo test
|
|
36
|
-
|
|
37
|
-
## Phase 3: Execution + Fix Cycle
|
|
38
|
-
|
|
39
|
-
**Iterative test-fix cycle** (max 5 iterations):
|
|
40
|
-
|
|
41
|
-
| Step | Action |
|
|
42
|
-
|------|--------|
|
|
43
|
-
| 1 | Run test command |
|
|
44
|
-
| 2 | Parse results, check pass rate |
|
|
45
|
-
| 3 | Pass rate >= 95% -> exit loop (success) |
|
|
46
|
-
| 4 | Extract failing test details |
|
|
47
|
-
| 5 | Apply fix using CLI tool |
|
|
48
|
-
| 6 | Increment iteration counter |
|
|
49
|
-
| 7 | iteration >= MAX (5) -> exit loop (report failures) |
|
|
50
|
-
| 8 | Go to Step 1 |
|
|
51
|
-
|
|
52
|
-
**Fix delegation**: Use CLI tool to fix failing tests:
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
ccw cli -p "PURPOSE: Fix failing tests; success = all listed tests pass
|
|
56
|
-
TASK: • Analyze test failure output • Identify root cause in changed files • Apply minimal fix
|
|
57
|
-
MODE: write
|
|
58
|
-
CONTEXT: @<changed-files> | Memory: Test output from current iteration
|
|
59
|
-
EXPECTED: Code fixes that make failing tests pass without breaking other tests
|
|
60
|
-
CONSTRAINTS: Only modify files in changed list | Minimal changes
|
|
61
|
-
Test output: <test-failure-details>
|
|
62
|
-
Changed files: <file-list>" --tool gemini --mode write --rule development-debug-runtime-issues
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Wait for CLI completion before re-running tests.
|
|
66
|
-
|
|
67
|
-
## Phase 4: Regression Check + Report
|
|
68
|
-
|
|
69
|
-
1. Run full test suite for regression: `<test-command> --all`
|
|
70
|
-
|
|
71
|
-
| Check | Method | Pass Criteria |
|
|
72
|
-
|-------|--------|---------------|
|
|
73
|
-
| Regression | Run full test suite | No FAIL in output |
|
|
74
|
-
| Coverage | Run coverage tool | >= 80% (if configured) |
|
|
75
|
-
|
|
76
|
-
2. Write verification results to `<session>/verify/verify-<num>.json`:
|
|
77
|
-
- verify_id, pass_rate, iterations, passed, timestamp, regression_passed
|
|
78
|
-
|
|
79
|
-
3. Determine message type:
|
|
80
|
-
|
|
81
|
-
| Condition | Message Type |
|
|
82
|
-
|-----------|--------------|
|
|
83
|
-
| passRate >= 0.95 | verify_passed |
|
|
84
|
-
| passRate < 0.95 && iterations >= MAX | fix_required |
|
|
85
|
-
| passRate < 0.95 | verify_failed |
|
|
86
|
-
|
|
87
|
-
4. Update .msg/meta.json with test_patterns entry
|
|
88
|
-
5. Write discoveries to wisdom/issues.md
|