claude-code-workflow 7.2.23 → 7.2.24
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/.codex/skills/team-arch-opt/SKILL.md +242 -175
- package/.codex/skills/team-arch-opt/roles/analyzer/role.md +78 -78
- package/.codex/skills/team-arch-opt/roles/coordinator/commands/analyze.md +57 -57
- package/.codex/skills/team-arch-opt/roles/coordinator/commands/monitor.md +246 -204
- package/.codex/skills/team-arch-opt/roles/coordinator/role.md +196 -184
- package/.codex/skills/team-arch-opt/roles/designer/role.md +115 -115
- package/.codex/skills/team-arch-opt/roles/refactorer/role.md +102 -102
- package/.codex/skills/team-arch-opt/roles/reviewer/role.md +111 -111
- package/.codex/skills/team-arch-opt/roles/validator/role.md +115 -115
- package/.codex/skills/team-arch-opt/specs/pipelines.md +102 -102
- package/.codex/skills/team-brainstorm/SKILL.md +72 -4
- package/.codex/skills/team-brainstorm/roles/challenger/role.md +61 -61
- package/.codex/skills/team-brainstorm/roles/coordinator/commands/analyze.md +58 -58
- package/.codex/skills/team-brainstorm/roles/coordinator/commands/monitor.md +212 -171
- package/.codex/skills/team-brainstorm/roles/coordinator/role.md +172 -160
- package/.codex/skills/team-brainstorm/roles/evaluator/role.md +56 -56
- package/.codex/skills/team-brainstorm/roles/ideator/role.md +69 -69
- package/.codex/skills/team-brainstorm/roles/synthesizer/role.md +57 -57
- package/.codex/skills/team-brainstorm/specs/pipelines.md +72 -72
- package/.codex/skills/team-coordinate/SKILL.md +71 -3
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +45 -5
- package/.codex/skills/team-coordinate/roles/coordinator/role.md +402 -389
- package/.codex/skills/team-coordinate/specs/knowledge-transfer.md +111 -111
- package/.codex/skills/team-coordinate/specs/pipelines.md +97 -97
- package/.codex/skills/team-coordinate/specs/quality-gates.md +112 -112
- package/.codex/skills/team-designer/SKILL.md +153 -153
- package/.codex/skills/team-designer/phases/01-requirements-analysis.md +250 -250
- package/.codex/skills/team-designer/phases/02-scaffold-generation.md +228 -228
- package/.codex/skills/team-designer/phases/03-content-generation.md +330 -330
- package/.codex/skills/team-designer/phases/04-validation.md +320 -320
- package/.codex/skills/team-executor/SKILL.md +29 -2
- package/.codex/skills/team-executor/roles/executor/commands/monitor.md +23 -15
- package/.codex/skills/team-frontend/SKILL.md +77 -3
- package/.codex/skills/team-frontend/roles/analyst/role.md +92 -92
- package/.codex/skills/team-frontend/roles/architect/role.md +86 -86
- package/.codex/skills/team-frontend/roles/coordinator/commands/analyze.md +52 -52
- package/.codex/skills/team-frontend/roles/coordinator/commands/monitor.md +222 -188
- package/.codex/skills/team-frontend/roles/coordinator/role.md +189 -177
- package/.codex/skills/team-frontend/roles/developer/role.md +93 -93
- package/.codex/skills/team-frontend/roles/qa/role.md +79 -79
- package/.codex/skills/team-frontend/specs/pipelines.md +76 -76
- package/.codex/skills/team-frontend-debug/SKILL.md +66 -3
- package/.codex/skills/team-frontend-debug/roles/analyzer/role.md +208 -208
- package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +174 -174
- package/.codex/skills/team-frontend-debug/roles/coordinator/commands/dispatch.md +198 -198
- package/.codex/skills/team-frontend-debug/roles/coordinator/commands/monitor.md +177 -143
- package/.codex/skills/team-frontend-debug/roles/coordinator/role.md +164 -152
- package/.codex/skills/team-frontend-debug/roles/fixer/role.md +147 -147
- package/.codex/skills/team-frontend-debug/roles/reproducer/role.md +147 -147
- package/.codex/skills/team-frontend-debug/roles/tester/role.md +231 -231
- package/.codex/skills/team-frontend-debug/roles/verifier/role.md +172 -172
- package/.codex/skills/team-frontend-debug/specs/debug-tools.md +215 -215
- package/.codex/skills/team-frontend-debug/specs/pipelines.md +94 -94
- package/.codex/skills/team-issue/SKILL.md +83 -4
- package/.codex/skills/team-issue/roles/coordinator/commands/analyze.md +64 -64
- package/.codex/skills/team-issue/roles/coordinator/commands/dispatch.md +273 -273
- package/.codex/skills/team-issue/roles/coordinator/commands/monitor.md +235 -194
- package/.codex/skills/team-issue/roles/coordinator/role.md +206 -194
- package/.codex/skills/team-issue/roles/explorer/role.md +94 -94
- package/.codex/skills/team-issue/roles/implementer/role.md +87 -87
- package/.codex/skills/team-issue/roles/integrator/role.md +84 -84
- package/.codex/skills/team-issue/roles/planner/role.md +81 -81
- package/.codex/skills/team-issue/roles/reviewer/role.md +86 -86
- package/.codex/skills/team-issue/specs/pipelines.md +124 -124
- package/.codex/skills/team-iterdev/SKILL.md +64 -3
- package/.codex/skills/team-iterdev/roles/architect/role.md +65 -65
- package/.codex/skills/team-iterdev/roles/coordinator/commands/analyze.md +62 -62
- package/.codex/skills/team-iterdev/roles/coordinator/commands/monitor.md +227 -186
- package/.codex/skills/team-iterdev/roles/coordinator/role.md +193 -181
- package/.codex/skills/team-iterdev/roles/developer/role.md +74 -74
- package/.codex/skills/team-iterdev/roles/reviewer/role.md +66 -66
- package/.codex/skills/team-iterdev/roles/tester/role.md +88 -88
- package/.codex/skills/team-iterdev/specs/pipelines.md +94 -94
- package/.codex/skills/team-lifecycle-v4/MIGRATION-PLAN.md +6 -6
- package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -242
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +1 -1
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +66 -24
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +13 -1
- package/.codex/skills/team-lifecycle-v4/roles/supervisor/role.md +1 -1
- package/.codex/skills/team-lifecycle-v4/templates/architecture.md +254 -254
- package/.codex/skills/team-lifecycle-v4/templates/epics.md +196 -196
- package/.codex/skills/team-lifecycle-v4/templates/product-brief.md +133 -133
- package/.codex/skills/team-lifecycle-v4/templates/requirements.md +224 -224
- package/.codex/skills/team-perf-opt/SKILL.md +68 -3
- package/.codex/skills/team-perf-opt/roles/benchmarker/role.md +89 -89
- package/.codex/skills/team-perf-opt/roles/coordinator/commands/analyze.md +61 -61
- package/.codex/skills/team-perf-opt/roles/coordinator/commands/monitor.md +35 -1
- package/.codex/skills/team-perf-opt/roles/coordinator/role.md +179 -167
- package/.codex/skills/team-perf-opt/roles/optimizer/role.md +97 -97
- package/.codex/skills/team-perf-opt/roles/profiler/role.md +73 -73
- package/.codex/skills/team-perf-opt/roles/reviewer/role.md +75 -75
- package/.codex/skills/team-perf-opt/roles/strategist/role.md +94 -94
- package/.codex/skills/team-perf-opt/specs/pipelines.md +65 -65
- package/.codex/skills/team-planex/SKILL.md +65 -3
- package/.codex/skills/team-planex/roles/coordinator/commands/analyze.md +52 -52
- package/.codex/skills/team-planex/roles/coordinator/commands/monitor.md +210 -164
- package/.codex/skills/team-planex/roles/coordinator/role.md +171 -159
- package/.codex/skills/team-planex/roles/executor/role.md +91 -91
- package/.codex/skills/team-planex/roles/planner/role.md +112 -112
- package/.codex/skills/team-planex/specs/pipelines.md +93 -93
- package/.codex/skills/team-quality-assurance/SKILL.md +60 -3
- package/.codex/skills/team-quality-assurance/roles/analyst/role.md +80 -80
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -72
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +108 -108
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +243 -209
- package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +176 -164
- package/.codex/skills/team-quality-assurance/roles/executor/role.md +66 -66
- package/.codex/skills/team-quality-assurance/roles/generator/role.md +68 -68
- package/.codex/skills/team-quality-assurance/roles/scout/role.md +67 -67
- package/.codex/skills/team-quality-assurance/roles/strategist/role.md +71 -71
- package/.codex/skills/team-quality-assurance/specs/pipelines.md +115 -115
- package/.codex/skills/team-review/SKILL.md +58 -3
- package/.codex/skills/team-review/roles/coordinator/commands/analyze.md +71 -71
- package/.codex/skills/team-review/roles/coordinator/commands/dispatch.md +90 -90
- package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +225 -185
- package/.codex/skills/team-review/roles/coordinator/role.md +175 -163
- package/.codex/skills/team-review/roles/fixer/role.md +76 -76
- package/.codex/skills/team-review/roles/reviewer/role.md +68 -68
- package/.codex/skills/team-review/roles/scanner/role.md +71 -71
- package/.codex/skills/team-review/specs/pipelines.md +102 -102
- package/.codex/skills/team-roadmap-dev/SKILL.md +55 -3
- package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/analyze.md +61 -61
- package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/monitor.md +502 -468
- package/.codex/skills/team-roadmap-dev/roles/coordinator/role.md +335 -322
- package/.codex/skills/team-roadmap-dev/roles/executor/role.md +71 -71
- package/.codex/skills/team-roadmap-dev/roles/planner/role.md +76 -76
- package/.codex/skills/team-roadmap-dev/roles/verifier/role.md +74 -74
- package/.codex/skills/team-roadmap-dev/specs/pipelines.md +93 -93
- package/.codex/skills/team-tech-debt/SKILL.md +56 -3
- package/.codex/skills/team-tech-debt/roles/assessor/role.md +69 -69
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -47
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +272 -231
- package/.codex/skills/team-tech-debt/roles/coordinator/role.md +172 -160
- package/.codex/skills/team-tech-debt/roles/executor/role.md +76 -76
- package/.codex/skills/team-tech-debt/roles/planner/role.md +69 -69
- package/.codex/skills/team-tech-debt/roles/scanner/role.md +82 -82
- package/.codex/skills/team-tech-debt/roles/validator/role.md +75 -75
- package/.codex/skills/team-tech-debt/specs/pipelines.md +47 -47
- package/.codex/skills/team-testing/SKILL.md +72 -3
- package/.codex/skills/team-testing/roles/analyst/role.md +95 -95
- package/.codex/skills/team-testing/roles/coordinator/commands/analyze.md +70 -70
- package/.codex/skills/team-testing/roles/coordinator/commands/dispatch.md +106 -106
- package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +283 -242
- package/.codex/skills/team-testing/roles/coordinator/role.md +184 -172
- package/.codex/skills/team-testing/roles/executor/role.md +96 -96
- package/.codex/skills/team-testing/roles/generator/role.md +95 -95
- package/.codex/skills/team-testing/roles/strategist/role.md +83 -83
- package/.codex/skills/team-testing/specs/pipelines.md +101 -101
- package/.codex/skills/team-uidesign/SKILL.md +65 -3
- package/.codex/skills/team-uidesign/roles/coordinator/commands/analyze.md +59 -59
- package/.codex/skills/team-uidesign/roles/coordinator/commands/dispatch.md +156 -156
- package/.codex/skills/team-uidesign/roles/coordinator/commands/monitor.md +234 -194
- package/.codex/skills/team-uidesign/roles/coordinator/role.md +211 -199
- package/.codex/skills/team-uidesign/roles/designer/role.md +69 -69
- package/.codex/skills/team-uidesign/roles/implementer/role.md +72 -72
- package/.codex/skills/team-uidesign/roles/researcher/role.md +82 -82
- package/.codex/skills/team-uidesign/roles/reviewer/role.md +67 -67
- package/.codex/skills/team-uidesign/specs/pipelines.md +76 -76
- package/.codex/skills/team-ultra-analyze/SKILL.md +73 -3
- package/.codex/skills/team-ultra-analyze/roles/analyst/role.md +90 -90
- package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/analyze.md +73 -73
- package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +50 -9
- package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +255 -243
- package/.codex/skills/team-ultra-analyze/roles/discussant/role.md +104 -104
- package/.codex/skills/team-ultra-analyze/roles/explorer/role.md +74 -74
- package/.codex/skills/team-ultra-analyze/roles/synthesizer/role.md +78 -78
- package/.codex/skills/team-ultra-analyze/specs/pipelines.md +64 -64
- package/.codex/skills/team-ux-improve/SKILL.md +64 -3
- package/.codex/skills/team-ux-improve/roles/coordinator/commands/analyze.md +62 -62
- package/.codex/skills/team-ux-improve/roles/coordinator/commands/dispatch.md +233 -233
- package/.codex/skills/team-ux-improve/roles/coordinator/commands/monitor.md +195 -160
- package/.codex/skills/team-ux-improve/roles/coordinator/role.md +170 -158
- package/.codex/skills/team-ux-improve/roles/designer/role.md +122 -122
- package/.codex/skills/team-ux-improve/roles/diagnoser/role.md +93 -93
- package/.codex/skills/team-ux-improve/roles/explorer/role.md +77 -77
- package/.codex/skills/team-ux-improve/roles/implementer/role.md +102 -102
- package/.codex/skills/team-ux-improve/roles/scanner/role.md +93 -93
- package/.codex/skills/team-ux-improve/roles/tester/role.md +84 -84
- package/.codex/skills/team-ux-improve/specs/pipelines.md +54 -54
- package/README.md +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: team-planex
|
|
3
3
|
description: Unified team skill for plan-and-execute pipeline. Pure router — coordinator always. Beat model is coordinator-only in monitor.md. Triggers on "team planex".
|
|
4
|
-
allowed-tools: spawn_agent(*), wait_agent(*),
|
|
4
|
+
allowed-tools: spawn_agent(*), wait_agent(*), send_message(*), assign_task(*), close_agent(*), list_agents(*), report_agent_job_result(*), request_user_input(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*), mcp__ccw-tools__team_msg(*)
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Team PlanEx
|
|
@@ -53,7 +53,8 @@ Before calling ANY tool, apply this check:
|
|
|
53
53
|
|
|
54
54
|
| Tool Call | Verdict | Reason |
|
|
55
55
|
|-----------|---------|--------|
|
|
56
|
-
| `spawn_agent`, `wait_agent`, `close_agent`, `
|
|
56
|
+
| `spawn_agent`, `wait_agent`, `close_agent`, `send_message`, `assign_task` | ALLOWED | Orchestration |
|
|
57
|
+
| `list_agents` | ALLOWED | Agent health check |
|
|
57
58
|
| `request_user_input` | ALLOWED | User interaction |
|
|
58
59
|
| `mcp__ccw-tools__team_msg` | ALLOWED | Message bus |
|
|
59
60
|
| `Read/Write` on `.workflow/.team/` files | ALLOWED | Session state |
|
|
@@ -83,6 +84,8 @@ Coordinator spawns workers using this template:
|
|
|
83
84
|
```
|
|
84
85
|
spawn_agent({
|
|
85
86
|
agent_type: "team_worker",
|
|
87
|
+
task_name: "<task-id>",
|
|
88
|
+
fork_context: false,
|
|
86
89
|
items: [
|
|
87
90
|
{ type: "text", text: `## Role Assignment
|
|
88
91
|
role: <role>
|
|
@@ -107,7 +110,27 @@ pipeline_phase: <pipeline-phase>` },
|
|
|
107
110
|
})
|
|
108
111
|
```
|
|
109
112
|
|
|
110
|
-
After spawning, use `wait_agent({
|
|
113
|
+
After spawning, use `wait_agent({ targets: [...], timeout_ms: 900000 })` to collect results, then `close_agent({ target })` each worker.
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### Model Selection Guide
|
|
117
|
+
|
|
118
|
+
| Role | model | reasoning_effort | Rationale |
|
|
119
|
+
|------|-------|-------------------|-----------|
|
|
120
|
+
| Planner (PLAN-*) | (default) | high | Solution planning requires deep code analysis |
|
|
121
|
+
| Executor (EXEC-*) | (default) | high | Code implementation needs precision |
|
|
122
|
+
|
|
123
|
+
Override model/reasoning_effort in spawn_agent when cost optimization is needed:
|
|
124
|
+
```
|
|
125
|
+
spawn_agent({
|
|
126
|
+
agent_type: "team_worker",
|
|
127
|
+
task_name: "<task-id>",
|
|
128
|
+
fork_context: false,
|
|
129
|
+
model: "<model-override>",
|
|
130
|
+
reasoning_effort: "<effort-level>",
|
|
131
|
+
items: [...]
|
|
132
|
+
})
|
|
133
|
+
```
|
|
111
134
|
|
|
112
135
|
## User Commands
|
|
113
136
|
|
|
@@ -140,6 +163,45 @@ After spawning, use `wait_agent({ ids: [...], timeout_ms: 900000 })` to collect
|
|
|
140
163
|
|
|
141
164
|
- [specs/pipelines.md](specs/pipelines.md) — Pipeline definitions, task metadata registry, execution method selection
|
|
142
165
|
|
|
166
|
+
## v4 Agent Coordination
|
|
167
|
+
|
|
168
|
+
### Message Semantics
|
|
169
|
+
|
|
170
|
+
| Intent | API | Example |
|
|
171
|
+
|--------|-----|---------|
|
|
172
|
+
| Send plan updates to running executor | `send_message` | Queue planner solution details to EXEC-* workers |
|
|
173
|
+
| Not used in this skill | `assign_task` | No resident agents -- planner and executor are one-shot |
|
|
174
|
+
| Check running agents | `list_agents` | Verify planner/executor health during resume |
|
|
175
|
+
|
|
176
|
+
### Two-Phase Pipeline Pattern
|
|
177
|
+
|
|
178
|
+
Plan-and-execute is a **Two-Phase pattern**: planner creates solution plans (PLAN-*), then coordinator spawns executors (EXEC-*) for each planned issue. The planner may dynamically create EXEC-* task entries in tasks.json.
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
// Phase 1: Planner runs, creates EXEC-* tasks in tasks.json
|
|
182
|
+
spawn_agent({ agent_type: "team_worker", task_name: "PLAN-001", ... })
|
|
183
|
+
wait_agent({ targets: ["PLAN-001"], timeout_ms: 900000 })
|
|
184
|
+
// Phase 2: Executors run per-issue, may run in sequence or parallel
|
|
185
|
+
// Inner loop: planner/executor handle multiple tasks internally
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Agent Health Check
|
|
189
|
+
|
|
190
|
+
Use `list_agents({})` in handleResume and handleComplete:
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
// Reconcile session state with actual running agents
|
|
194
|
+
const running = list_agents({})
|
|
195
|
+
// Compare with tasks.json active_agents
|
|
196
|
+
// Reset orphaned tasks (in_progress but agent gone) to pending
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Named Agent Targeting
|
|
200
|
+
|
|
201
|
+
Workers are spawned with `task_name: "<task-id>"` enabling direct addressing:
|
|
202
|
+
- `send_message({ target: "EXEC-001", items: [...] })` -- queue plan solution to running executor
|
|
203
|
+
- `close_agent({ target: "PLAN-001" })` -- cleanup by name after completion
|
|
204
|
+
|
|
143
205
|
## Error Handling
|
|
144
206
|
|
|
145
207
|
| Scenario | Resolution |
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
# Analyze Task
|
|
2
|
-
|
|
3
|
-
Parse plan-and-execute input -> detect input type -> determine execution method -> assess scope.
|
|
4
|
-
|
|
5
|
-
**CONSTRAINT**: Text-level analysis only. NO source code reading, NO codebase exploration.
|
|
6
|
-
|
|
7
|
-
## Signal Detection
|
|
8
|
-
|
|
9
|
-
| Input Pattern | Type | Action |
|
|
10
|
-
|--------------|------|--------|
|
|
11
|
-
| `ISS-\d{8}-\d{6}` pattern | Issue IDs | Use directly |
|
|
12
|
-
| `--text '...'` flag | Text requirement | Create issues via CLI |
|
|
13
|
-
| `--plan <path>` flag | Plan file | Read file, parse phases |
|
|
14
|
-
|
|
15
|
-
## Execution Method Selection
|
|
16
|
-
|
|
17
|
-
| Condition | Execution Method |
|
|
18
|
-
|-----------|-----------------|
|
|
19
|
-
| `--exec=codex` specified | Codex |
|
|
20
|
-
| `--exec=gemini` specified | Gemini |
|
|
21
|
-
| `-y` or `--yes` flag present | Auto (default Gemini) |
|
|
22
|
-
| No flags (interactive) | request_user_input -> user choice |
|
|
23
|
-
| Auto + task_count <= 3 | Gemini |
|
|
24
|
-
| Auto + task_count > 3 | Codex |
|
|
25
|
-
|
|
26
|
-
## Scope Assessment
|
|
27
|
-
|
|
28
|
-
| Factor | Complexity |
|
|
29
|
-
|--------|------------|
|
|
30
|
-
| Issue count 1-3 | Low |
|
|
31
|
-
| Issue count 4-10 | Medium |
|
|
32
|
-
| Issue count > 10 | High |
|
|
33
|
-
| Cross-cutting concern | +1 level |
|
|
34
|
-
|
|
35
|
-
## Output
|
|
36
|
-
|
|
37
|
-
Write <session>/task-analysis.json:
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"task_description": "<original>",
|
|
41
|
-
"input_type": "<issues|text|plan>",
|
|
42
|
-
"raw_input": "<original input>",
|
|
43
|
-
"execution_method": "<codex|gemini>",
|
|
44
|
-
"issue_count_estimate": 0,
|
|
45
|
-
"complexity": { "score": 0, "level": "Low|Medium|High" },
|
|
46
|
-
"pipeline_type": "plan-execute",
|
|
47
|
-
"roles": [
|
|
48
|
-
{ "name": "planner", "prefix": "PLAN", "inner_loop": true },
|
|
49
|
-
{ "name": "executor", "prefix": "EXEC", "inner_loop": true }
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
```
|
|
1
|
+
# Analyze Task
|
|
2
|
+
|
|
3
|
+
Parse plan-and-execute input -> detect input type -> determine execution method -> assess scope.
|
|
4
|
+
|
|
5
|
+
**CONSTRAINT**: Text-level analysis only. NO source code reading, NO codebase exploration.
|
|
6
|
+
|
|
7
|
+
## Signal Detection
|
|
8
|
+
|
|
9
|
+
| Input Pattern | Type | Action |
|
|
10
|
+
|--------------|------|--------|
|
|
11
|
+
| `ISS-\d{8}-\d{6}` pattern | Issue IDs | Use directly |
|
|
12
|
+
| `--text '...'` flag | Text requirement | Create issues via CLI |
|
|
13
|
+
| `--plan <path>` flag | Plan file | Read file, parse phases |
|
|
14
|
+
|
|
15
|
+
## Execution Method Selection
|
|
16
|
+
|
|
17
|
+
| Condition | Execution Method |
|
|
18
|
+
|-----------|-----------------|
|
|
19
|
+
| `--exec=codex` specified | Codex |
|
|
20
|
+
| `--exec=gemini` specified | Gemini |
|
|
21
|
+
| `-y` or `--yes` flag present | Auto (default Gemini) |
|
|
22
|
+
| No flags (interactive) | request_user_input -> user choice |
|
|
23
|
+
| Auto + task_count <= 3 | Gemini |
|
|
24
|
+
| Auto + task_count > 3 | Codex |
|
|
25
|
+
|
|
26
|
+
## Scope Assessment
|
|
27
|
+
|
|
28
|
+
| Factor | Complexity |
|
|
29
|
+
|--------|------------|
|
|
30
|
+
| Issue count 1-3 | Low |
|
|
31
|
+
| Issue count 4-10 | Medium |
|
|
32
|
+
| Issue count > 10 | High |
|
|
33
|
+
| Cross-cutting concern | +1 level |
|
|
34
|
+
|
|
35
|
+
## Output
|
|
36
|
+
|
|
37
|
+
Write <session>/task-analysis.json:
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"task_description": "<original>",
|
|
41
|
+
"input_type": "<issues|text|plan>",
|
|
42
|
+
"raw_input": "<original input>",
|
|
43
|
+
"execution_method": "<codex|gemini>",
|
|
44
|
+
"issue_count_estimate": 0,
|
|
45
|
+
"complexity": { "score": 0, "level": "Low|Medium|High" },
|
|
46
|
+
"pipeline_type": "plan-execute",
|
|
47
|
+
"roles": [
|
|
48
|
+
{ "name": "planner", "prefix": "PLAN", "inner_loop": true },
|
|
49
|
+
{ "name": "executor", "prefix": "EXEC", "inner_loop": true }
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
```
|
|
@@ -1,164 +1,210 @@
|
|
|
1
|
-
# Command: monitor
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
5
|
-
Event-driven pipeline coordination with Spawn-and-Stop pattern. Three wake-up sources: worker results, user `check`, user `resume`.
|
|
6
|
-
|
|
7
|
-
## Constants
|
|
8
|
-
|
|
9
|
-
| Constant | Value | Description |
|
|
10
|
-
|----------|-------|-------------|
|
|
11
|
-
| SPAWN_MODE | spawn_agent | All workers spawned via `spawn_agent` |
|
|
12
|
-
| ONE_STEP_PER_INVOCATION | true | Coordinator does one operation then STOPS |
|
|
13
|
-
| WORKER_AGENT | team_worker | All workers are team_worker agents |
|
|
14
|
-
|
|
15
|
-
## Phase 2: Context Loading
|
|
16
|
-
|
|
17
|
-
| Input | Source | Required |
|
|
18
|
-
|-------|--------|----------|
|
|
19
|
-
| Session file | `<session-folder>/.msg/meta.json` | Yes |
|
|
20
|
-
| Task list | Read tasks.json | Yes |
|
|
21
|
-
| Active workers | session.active_workers[] | Yes |
|
|
22
|
-
|
|
23
|
-
## Phase 3: Handler Routing
|
|
24
|
-
|
|
25
|
-
### Wake-up Source Detection
|
|
26
|
-
|
|
27
|
-
| Priority | Condition | Handler |
|
|
28
|
-
|----------|-----------|---------|
|
|
29
|
-
| 1 | Message contains `[planner]` or `[executor]` tag | handleCallback |
|
|
30
|
-
| 2 | Contains "check" or "status" | handleCheck |
|
|
31
|
-
| 3 | Contains "resume", "continue", or "next" | handleResume |
|
|
32
|
-
| 4 | None of the above (initial spawn) | handleSpawnNext |
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
### Handler: handleCallback
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
Receive result from wait_agent for [<role>]
|
|
40
|
-
+- Match role: planner or executor
|
|
41
|
-
+- Progress update (not final)?
|
|
42
|
-
| +- YES -> Update session -> STOP
|
|
43
|
-
+- Task status = completed?
|
|
44
|
-
| +- YES -> remove from active_workers -> update session
|
|
45
|
-
| | +- Close agent: close_agent({
|
|
46
|
-
| | +- role = planner?
|
|
47
|
-
| | | +- Check for new EXEC-* tasks in tasks.json (planner creates them)
|
|
48
|
-
| | | +- -> handleSpawnNext (spawn executor for new EXEC-* tasks)
|
|
49
|
-
| | +- role = executor?
|
|
50
|
-
| | +- Mark issue done
|
|
51
|
-
| | +- -> handleSpawnNext (check for more EXEC-* tasks)
|
|
52
|
-
| +- NO -> progress message -> STOP
|
|
53
|
-
+- No matching worker found
|
|
54
|
-
+- Scan all active workers for completed tasks
|
|
55
|
-
+- Found completed -> process -> handleSpawnNext
|
|
56
|
-
+- None completed -> STOP
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
### Handler: handleCheck
|
|
62
|
-
|
|
63
|
-
Read-only status report. No advancement.
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
[coordinator] PlanEx Pipeline Status
|
|
67
|
-
[coordinator] Progress: <completed>/<total> (<percent>%)
|
|
68
|
-
|
|
69
|
-
[coordinator] Task Graph:
|
|
70
|
-
PLAN-001: <status-icon> <summary>
|
|
71
|
-
EXEC-001: <status-icon> <issue-title>
|
|
72
|
-
EXEC-002: <status-icon> <issue-title>
|
|
73
|
-
...
|
|
74
|
-
|
|
75
|
-
done=completed >>>=running o=pending
|
|
76
|
-
|
|
77
|
-
[coordinator] Active Workers:
|
|
78
|
-
> <subject> (<role>) - running <elapsed>
|
|
79
|
-
|
|
80
|
-
[coordinator] Ready to spawn: <subjects>
|
|
81
|
-
[coordinator] Commands: 'resume' to advance | 'check' to refresh
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Then STOP.
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
### Handler: handleResume
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
role
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
1
|
+
# Command: monitor
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Event-driven pipeline coordination with Spawn-and-Stop pattern. Three wake-up sources: worker results, user `check`, user `resume`.
|
|
6
|
+
|
|
7
|
+
## Constants
|
|
8
|
+
|
|
9
|
+
| Constant | Value | Description |
|
|
10
|
+
|----------|-------|-------------|
|
|
11
|
+
| SPAWN_MODE | spawn_agent | All workers spawned via `spawn_agent` |
|
|
12
|
+
| ONE_STEP_PER_INVOCATION | true | Coordinator does one operation then STOPS |
|
|
13
|
+
| WORKER_AGENT | team_worker | All workers are team_worker agents |
|
|
14
|
+
|
|
15
|
+
## Phase 2: Context Loading
|
|
16
|
+
|
|
17
|
+
| Input | Source | Required |
|
|
18
|
+
|-------|--------|----------|
|
|
19
|
+
| Session file | `<session-folder>/.msg/meta.json` | Yes |
|
|
20
|
+
| Task list | Read tasks.json | Yes |
|
|
21
|
+
| Active workers | session.active_workers[] | Yes |
|
|
22
|
+
|
|
23
|
+
## Phase 3: Handler Routing
|
|
24
|
+
|
|
25
|
+
### Wake-up Source Detection
|
|
26
|
+
|
|
27
|
+
| Priority | Condition | Handler |
|
|
28
|
+
|----------|-----------|---------|
|
|
29
|
+
| 1 | Message contains `[planner]` or `[executor]` tag | handleCallback |
|
|
30
|
+
| 2 | Contains "check" or "status" | handleCheck |
|
|
31
|
+
| 3 | Contains "resume", "continue", or "next" | handleResume |
|
|
32
|
+
| 4 | None of the above (initial spawn) | handleSpawnNext |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
### Handler: handleCallback
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
Receive result from wait_agent for [<role>]
|
|
40
|
+
+- Match role: planner or executor
|
|
41
|
+
+- Progress update (not final)?
|
|
42
|
+
| +- YES -> Update session -> STOP
|
|
43
|
+
+- Task status = completed?
|
|
44
|
+
| +- YES -> remove from active_workers -> update session
|
|
45
|
+
| | +- Close agent: close_agent({ target: <agentId> })
|
|
46
|
+
| | +- role = planner?
|
|
47
|
+
| | | +- Check for new EXEC-* tasks in tasks.json (planner creates them)
|
|
48
|
+
| | | +- -> handleSpawnNext (spawn executor for new EXEC-* tasks)
|
|
49
|
+
| | +- role = executor?
|
|
50
|
+
| | +- Mark issue done
|
|
51
|
+
| | +- -> handleSpawnNext (check for more EXEC-* tasks)
|
|
52
|
+
| +- NO -> progress message -> STOP
|
|
53
|
+
+- No matching worker found
|
|
54
|
+
+- Scan all active workers for completed tasks
|
|
55
|
+
+- Found completed -> process -> handleSpawnNext
|
|
56
|
+
+- None completed -> STOP
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
### Handler: handleCheck
|
|
62
|
+
|
|
63
|
+
Read-only status report. No advancement.
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
[coordinator] PlanEx Pipeline Status
|
|
67
|
+
[coordinator] Progress: <completed>/<total> (<percent>%)
|
|
68
|
+
|
|
69
|
+
[coordinator] Task Graph:
|
|
70
|
+
PLAN-001: <status-icon> <summary>
|
|
71
|
+
EXEC-001: <status-icon> <issue-title>
|
|
72
|
+
EXEC-002: <status-icon> <issue-title>
|
|
73
|
+
...
|
|
74
|
+
|
|
75
|
+
done=completed >>>=running o=pending
|
|
76
|
+
|
|
77
|
+
[coordinator] Active Workers:
|
|
78
|
+
> <subject> (<role>) - running <elapsed>
|
|
79
|
+
|
|
80
|
+
[coordinator] Ready to spawn: <subjects>
|
|
81
|
+
[coordinator] Commands: 'resume' to advance | 'check' to refresh
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Then STOP.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### Handler: handleResume
|
|
89
|
+
|
|
90
|
+
**Agent Health Check** (v4):
|
|
91
|
+
```
|
|
92
|
+
// Verify actual running agents match session state
|
|
93
|
+
const runningAgents = list_agents({})
|
|
94
|
+
// For each active_agent in tasks.json:
|
|
95
|
+
// - If agent NOT in runningAgents -> agent crashed
|
|
96
|
+
// - Reset that task to pending, remove from active_agents
|
|
97
|
+
// This prevents stale agent references from blocking the pipeline
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
Load active_workers
|
|
102
|
+
+- No active workers -> handleSpawnNext
|
|
103
|
+
+- Has active workers -> check each:
|
|
104
|
+
+- completed -> mark done, log
|
|
105
|
+
+- in_progress -> still running
|
|
106
|
+
+- other -> worker failure -> reset to pending
|
|
107
|
+
After:
|
|
108
|
+
+- Some completed -> handleSpawnNext
|
|
109
|
+
+- All running -> report status -> STOP
|
|
110
|
+
+- All failed -> handleSpawnNext (retry)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
### Handler: handleSpawnNext
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
Collect task states from tasks.json
|
|
119
|
+
+- Filter tasks: PLAN-* and EXEC-* prefixes
|
|
120
|
+
+- readySubjects: pending + not blocked (no deps or all deps completed)
|
|
121
|
+
+- NONE ready + work in progress -> report waiting -> STOP
|
|
122
|
+
+- NONE ready + nothing running -> PIPELINE_COMPLETE -> Phase 5
|
|
123
|
+
+- HAS ready tasks -> for each:
|
|
124
|
+
+- Inner Loop role AND already has active_worker for that role?
|
|
125
|
+
| +- YES -> SKIP spawn (existing worker picks up via inner loop)
|
|
126
|
+
| +- NO -> spawn below
|
|
127
|
+
+- Determine role from task prefix:
|
|
128
|
+
| +- PLAN-* -> planner
|
|
129
|
+
| +- EXEC-* -> executor
|
|
130
|
+
+- Spawn team_worker:
|
|
131
|
+
const agentId = spawn_agent({
|
|
132
|
+
agent_type: "team_worker",
|
|
133
|
+
task_name: taskId, // e.g., "PLAN-001" — enables named targeting
|
|
134
|
+
items: [{ type: "text", text: `## Role Assignment
|
|
135
|
+
role: <role>
|
|
136
|
+
role_spec: ~ or <project>/.codex/skills/team-planex/roles/<role>/role.md
|
|
137
|
+
session: <session-folder>
|
|
138
|
+
session_id: <session-id>
|
|
139
|
+
team_name: <team-name>
|
|
140
|
+
requirement: <task-description>
|
|
141
|
+
inner_loop: true
|
|
142
|
+
execution_method: <method>` }]
|
|
143
|
+
})
|
|
144
|
+
// Collect results — use task_name for stable targeting (v4):
|
|
145
|
+
const result = wait_agent({ targets: [taskId], timeout_ms: 900000 })
|
|
146
|
+
if (result.timed_out) {
|
|
147
|
+
state.tasks[taskId].status = 'timed_out'
|
|
148
|
+
close_agent({ target: taskId })
|
|
149
|
+
// Report timeout, STOP
|
|
150
|
+
} else {
|
|
151
|
+
// Process result, update tasks.json
|
|
152
|
+
close_agent({ target: taskId }) // Use task_name, not agentId
|
|
153
|
+
}
|
|
154
|
+
+- Add to session.active_workers
|
|
155
|
+
Update session -> output summary -> STOP
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Cross-Agent Supplementary Context** (v4):
|
|
159
|
+
|
|
160
|
+
When spawning workers in a later pipeline phase, send upstream results as supplementary context to already-running workers:
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
// Example: Send planning results to running executors
|
|
164
|
+
send_message({
|
|
165
|
+
target: "<running-agent-task-name>",
|
|
166
|
+
items: [{ type: "text", text: `## Supplementary Context\n${upstreamFindings}` }]
|
|
167
|
+
})
|
|
168
|
+
// Note: send_message queues info without interrupting the agent's current work
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Use `send_message` (not `assign_task`) for supplementary info that enriches but doesn't redirect the agent's current task.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
### Pipeline Complete (PIPELINE_COMPLETE -> Phase 5)
|
|
176
|
+
|
|
177
|
+
**Cleanup Verification** (v4):
|
|
178
|
+
```
|
|
179
|
+
// Verify all agents are properly closed
|
|
180
|
+
const remaining = list_agents({})
|
|
181
|
+
// If any team agents still running -> close_agent each
|
|
182
|
+
// Ensures clean session shutdown
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
When all tasks are completed (no pending, no in_progress), transition to coordinator Phase 5.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Phase 4: Validation
|
|
190
|
+
|
|
191
|
+
| Check | Criteria |
|
|
192
|
+
|-------|----------|
|
|
193
|
+
| Session state consistent | active_workers matches in_progress tasks |
|
|
194
|
+
| No orphaned tasks | Every in_progress has active_worker |
|
|
195
|
+
| Pipeline completeness | All expected EXEC-* tasks accounted for |
|
|
196
|
+
|
|
197
|
+
## Worker Failure Handling
|
|
198
|
+
|
|
199
|
+
1. Reset task -> pending in tasks.json
|
|
200
|
+
2. Log via team_msg (type: error)
|
|
201
|
+
3. Report to user
|
|
202
|
+
|
|
203
|
+
## Error Handling
|
|
204
|
+
|
|
205
|
+
| Scenario | Resolution |
|
|
206
|
+
|----------|------------|
|
|
207
|
+
| Session file not found | Error, suggest re-initialization |
|
|
208
|
+
| Unknown role callback | Log, scan for other completions |
|
|
209
|
+
| All workers running on resume | Report status, suggest check later |
|
|
210
|
+
| Pipeline stall (no ready + no running + has pending) | Check deps chains, report |
|