claude-code-workflow 7.2.20 → 7.2.21

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 (38) hide show
  1. package/.claude/commands/workflow/analyze-with-file.md +25 -12
  2. package/.codex/skills/team-arch-opt/SKILL.md +24 -0
  3. package/.codex/skills/team-arch-opt/roles/coordinator/role.md +22 -0
  4. package/.codex/skills/team-brainstorm/SKILL.md +24 -0
  5. package/.codex/skills/team-brainstorm/roles/coordinator/role.md +20 -0
  6. package/.codex/skills/team-coordinate/SKILL.md +24 -0
  7. package/.codex/skills/team-coordinate/roles/coordinator/role.md +40 -12
  8. package/.codex/skills/team-frontend/SKILL.md +24 -0
  9. package/.codex/skills/team-frontend/roles/coordinator/role.md +20 -0
  10. package/.codex/skills/team-frontend-debug/SKILL.md +24 -0
  11. package/.codex/skills/team-frontend-debug/roles/coordinator/role.md +21 -0
  12. package/.codex/skills/team-issue/SKILL.md +24 -0
  13. package/.codex/skills/team-issue/roles/coordinator/role.md +19 -0
  14. package/.codex/skills/team-iterdev/SKILL.md +24 -0
  15. package/.codex/skills/team-iterdev/roles/coordinator/role.md +20 -0
  16. package/.codex/skills/team-lifecycle-v4/SKILL.md +24 -0
  17. package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +28 -2
  18. package/.codex/skills/team-perf-opt/SKILL.md +24 -0
  19. package/.codex/skills/team-perf-opt/roles/coordinator/role.md +20 -0
  20. package/.codex/skills/team-planex/SKILL.md +24 -0
  21. package/.codex/skills/team-planex/roles/coordinator/role.md +19 -0
  22. package/.codex/skills/team-quality-assurance/SKILL.md +24 -0
  23. package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +21 -0
  24. package/.codex/skills/team-review/SKILL.md +24 -0
  25. package/.codex/skills/team-review/roles/coordinator/role.md +21 -0
  26. package/.codex/skills/team-roadmap-dev/SKILL.md +24 -0
  27. package/.codex/skills/team-roadmap-dev/roles/coordinator/role.md +19 -0
  28. package/.codex/skills/team-tech-debt/SKILL.md +24 -0
  29. package/.codex/skills/team-tech-debt/roles/coordinator/role.md +19 -0
  30. package/.codex/skills/team-testing/SKILL.md +24 -0
  31. package/.codex/skills/team-testing/roles/coordinator/role.md +21 -0
  32. package/.codex/skills/team-uidesign/SKILL.md +24 -0
  33. package/.codex/skills/team-uidesign/roles/coordinator/role.md +20 -0
  34. package/.codex/skills/team-ultra-analyze/SKILL.md +24 -0
  35. package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +20 -0
  36. package/.codex/skills/team-ux-improve/SKILL.md +24 -0
  37. package/.codex/skills/team-ux-improve/roles/coordinator/role.md +20 -0
  38. package/package.json +1 -1
@@ -230,23 +230,37 @@ Do NOT write files.
230
230
  }
231
231
  ```
232
232
 
233
- **Phase B — Perspective Deep-Dive** (parallel, only for multi-perspective, max 4):
233
+ **Phase B — Perspective Deep-Dive** (PARALLEL, only for multi-perspective, max 4):
234
234
  Each perspective agent receives shared Layer 1 results, performs only Layer 2-3 on its relevant subset.
235
235
  Skip if single-perspective (single mode proceeds directly to Step 2 CLI analysis with Layer 1 results).
236
236
 
237
+ **CRITICAL — Parallel Execution**: Launch ALL perspective Agent() calls in the SAME response block so Claude Code executes them concurrently. Do NOT use a loop that waits for each agent before starting the next.
238
+
237
239
  ```javascript
238
240
  // Per-perspective Layer 2-3 — receives shared discovery, avoids re-scanning
239
241
  // Only runs in multi-perspective mode
242
+ // PARALLEL: All Agent() calls MUST appear in ONE response — Claude Code runs them concurrently
240
243
  const sharedDiscovery = readJSON(`${sessionFolder}/exploration-codebase.json`)
241
- const perspectiveFiles = sharedDiscovery.relevant_files
242
- .filter(f => f.dimensions.includes(perspective.dimension))
243
244
 
244
- selectedPerspectives.forEach(perspective => {
245
- Agent({
246
- subagent_type: "cli-explore-agent",
247
- run_in_background: false,
248
- description: `Deep-dive: ${perspective.name}`,
249
- prompt: `
245
+ // Prepare per-perspective file lists
246
+ const perspectiveFileLists = Object.fromEntries(
247
+ selectedPerspectives.map(p => [
248
+ p.name,
249
+ sharedDiscovery.relevant_files.filter(f => f.dimensions.includes(p.dimension))
250
+ ])
251
+ )
252
+
253
+ // Launch ALL agents in a SINGLE response block (not sequentially):
254
+ // Agent({ ..perspective1.. }) ← call 1
255
+ // Agent({ ..perspective2.. }) ← call 2 (same response)
256
+ // Agent({ ..perspective3.. }) ← call 3 (same response)
257
+
258
+ // Each agent call follows this template:
259
+ Agent({
260
+ subagent_type: "cli-explore-agent",
261
+ run_in_background: false,
262
+ description: `Deep-dive: ${perspective.name}`,
263
+ prompt: `
250
264
  ## Analysis Context
251
265
  Topic: ${topic_or_question}
252
266
  Perspective: ${perspective.name} - ${perspective.focus}
@@ -254,7 +268,7 @@ Session: ${sessionFolder}
254
268
 
255
269
  ## SHARED DISCOVERY (Layer 1 already completed — DO NOT re-scan)
256
270
  Relevant files for this perspective:
257
- ${perspectiveFiles.map(f => `- ${f.path}: ${f.annotation}`).join('\n')}
271
+ ${perspectiveFileLists[perspective.name].map(f => `- ${f.path}: ${f.annotation}`).join('\n')}
258
272
  Patterns found: ${sharedDiscovery.patterns.join(', ')}
259
273
 
260
274
  ## Layer 2 — Structure Tracing (Depth)
@@ -270,7 +284,6 @@ Patterns found: ${sharedDiscovery.patterns.join(', ')}
270
284
  Write to: ${sessionFolder}/explorations/${perspective.name}.json
271
285
  Schema: {perspective, relevant_files, key_findings, code_anchors: [{file, lines, snippet, significance}], call_chains: [{entry, chain, files}], questions_for_user, _metadata}
272
286
  `
273
- })
274
287
  })
275
288
  ```
276
289
 
@@ -731,7 +744,7 @@ ${implScope.map((item, i) => `${i+1}. **${item.objective}** [${item.priority}]
731
744
  | **Business** | Codex | Value, ROI, stakeholder impact | Business implications |
732
745
  | **Domain Expert** | Gemini | Domain patterns, best practices, standards | Industry knowledge |
733
746
 
734
- User multi-selects up to 4 in Phase 1, default: single comprehensive view.
747
+ User multi-selects up to 4 in Phase 1. Default: if dimensions >= 2, pre-select Technical + Architectural; if dimensions == 1, single comprehensive view.
735
748
 
736
749
  ### Dimension-Direction Mapping
737
750
 
@@ -46,6 +46,30 @@ Parse `$ARGUMENTS`:
46
46
  - Has `--role <name>` -> Read `roles/<name>/role.md`, execute Phase 2-4
47
47
  - No `--role` -> `roles/coordinator/role.md`, execute entry router
48
48
 
49
+ ## Delegation Lock
50
+
51
+ **Coordinator is a PURE ORCHESTRATOR. It coordinates, it does NOT do.**
52
+
53
+ Before calling ANY tool, apply this check:
54
+
55
+ | Tool Call | Verdict | Reason |
56
+ |-----------|---------|--------|
57
+ | `spawn_agent`, `wait_agent`, `close_agent`, `send_input` | ALLOWED | Orchestration |
58
+ | `request_user_input` | ALLOWED | User interaction |
59
+ | `mcp__ccw-tools__team_msg` | ALLOWED | Message bus |
60
+ | `Read/Write` on `.workflow/.team/` files | ALLOWED | Session state |
61
+ | `Read` on `roles/`, `commands/`, `specs/` | ALLOWED | Loading own instructions |
62
+ | `Read/Grep/Glob` on project source code | BLOCKED | Delegate to worker |
63
+ | `Edit` on any file outside `.workflow/` | BLOCKED | Delegate to worker |
64
+ | `Bash("ccw cli ...")` | BLOCKED | Only workers call CLI |
65
+ | `Bash` running build/test/lint commands | BLOCKED | Delegate to worker |
66
+
67
+ **If a tool call is BLOCKED**: STOP. Create a task, spawn a worker.
68
+
69
+ **No exceptions for "simple" tasks.** Even a single-file read-and-report MUST go through spawn_agent.
70
+
71
+ ---
72
+
49
73
  ## Shared Constants
50
74
 
51
75
  - **Session prefix**: `TAO`
@@ -2,6 +2,25 @@
2
2
 
3
3
  Orchestrate team-arch-opt: analyze -> dispatch -> spawn -> monitor -> report.
4
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_input` 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
+ WRONG: Bash running build/test/lint commands — worker work
18
+ ```
19
+
20
+ **Self-check gate**: Before ANY tool call, ask: "Is this orchestration or project work? If project work → STOP → spawn worker."
21
+
22
+ ---
23
+
5
24
  ## Identity
6
25
  - Name: coordinator | Tag: [coordinator]
7
26
  - Responsibility: Analyze task -> Create session -> Dispatch tasks -> Monitor progress -> Report results
@@ -14,6 +33,7 @@ Orchestrate team-arch-opt: analyze -> dispatch -> spawn -> monitor -> report.
14
33
  - Respect pipeline stage dependencies (deps)
15
34
  - Handle review-fix cycles with max 3 iterations
16
35
  - Execute completion action in Phase 5
36
+ - **Always proceed through full Phase 1-5 workflow, never skip to direct execution**
17
37
 
18
38
  ### MUST NOT
19
39
  - Implement domain logic (analyzing, refactoring, reviewing) -- workers handle this
@@ -21,6 +41,8 @@ Orchestrate team-arch-opt: analyze -> dispatch -> spawn -> monitor -> report.
21
41
  - Skip checkpoints when configured
22
42
  - Force-advance pipeline past failed review/validation
23
43
  - Modify source code directly -- delegate to refactorer worker
44
+ - Call CLI tools (ccw cli) — only workers use CLI
45
+ - Read project source code — delegate to workers
24
46
 
25
47
  ## Command Execution Protocol
26
48
 
@@ -45,6 +45,30 @@ Parse `$ARGUMENTS`:
45
45
  - Has `--role <name>` -> Read `roles/<name>/role.md`, execute Phase 2-4
46
46
  - No `--role` -> `roles/coordinator/role.md`, execute entry router
47
47
 
48
+ ## Delegation Lock
49
+
50
+ **Coordinator is a PURE ORCHESTRATOR. It coordinates, it does NOT do.**
51
+
52
+ Before calling ANY tool, apply this check:
53
+
54
+ | Tool Call | Verdict | Reason |
55
+ |-----------|---------|--------|
56
+ | `spawn_agent`, `wait_agent`, `close_agent`, `send_input` | ALLOWED | Orchestration |
57
+ | `request_user_input` | ALLOWED | User interaction |
58
+ | `mcp__ccw-tools__team_msg` | ALLOWED | Message bus |
59
+ | `Read/Write` on `.workflow/.team/` files | ALLOWED | Session state |
60
+ | `Read` on `roles/`, `commands/`, `specs/` | ALLOWED | Loading own instructions |
61
+ | `Read/Grep/Glob` on project source code | BLOCKED | Delegate to worker |
62
+ | `Edit` on any file outside `.workflow/` | BLOCKED | Delegate to worker |
63
+ | `Bash("ccw cli ...")` | BLOCKED | Only workers call CLI |
64
+ | `Bash` running build/test/lint commands | BLOCKED | Delegate to worker |
65
+
66
+ **If a tool call is BLOCKED**: STOP. Create a task, spawn a worker.
67
+
68
+ **No exceptions for "simple" tasks.** Even a single-file read-and-report MUST go through spawn_agent.
69
+
70
+ ---
71
+
48
72
  ## Shared Constants
49
73
 
50
74
  - **Session prefix**: `BRS`
@@ -2,6 +2,24 @@
2
2
 
3
3
  Orchestrate team-brainstorm: topic clarify -> dispatch -> spawn -> monitor -> report.
4
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_input` 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
+
5
23
  ## Identity
6
24
  - Name: coordinator | Tag: [coordinator]
7
25
  - Responsibility: Topic clarification -> Create team -> Dispatch tasks -> Monitor progress -> Report results
@@ -15,6 +33,7 @@ Orchestrate team-brainstorm: topic clarify -> dispatch -> spawn -> monitor -> re
15
33
  - Stop after spawning workers -- wait for results via wait_agent
16
34
  - Manage Generator-Critic loop count (max 2 rounds)
17
35
  - Execute completion action in Phase 5
36
+ - **Always proceed through full Phase 1-5 workflow, never skip to direct execution**
18
37
 
19
38
  ### MUST NOT
20
39
  - Generate ideas, challenge assumptions, synthesize, or evaluate -- workers handle this
@@ -22,6 +41,7 @@ Orchestrate team-brainstorm: topic clarify -> dispatch -> spawn -> monitor -> re
22
41
  - Force-advance pipeline past GC loop decisions
23
42
  - Modify artifact files (ideas/*.md, critiques/*.md, etc.) -- delegate to workers
24
43
  - Skip GC severity check when critique arrives
44
+ - Call CLI tools (ccw cli) — only workers use CLI
25
45
 
26
46
  ## Command Execution Protocol
27
47
 
@@ -32,6 +32,30 @@ Universal team coordination skill: analyze task -> generate role-specs -> dispat
32
32
  ccw cli --mode write - code generation and modification
33
33
  ```
34
34
 
35
+ ## Delegation Lock
36
+
37
+ **Coordinator is a PURE ORCHESTRATOR. It coordinates, it does NOT do.**
38
+
39
+ Before calling ANY tool, apply this check:
40
+
41
+ | Tool Call | Verdict | Reason |
42
+ |-----------|---------|--------|
43
+ | `spawn_agent`, `wait_agent`, `close_agent`, `send_input` | ALLOWED | Orchestration |
44
+ | `request_user_input` | ALLOWED | User interaction |
45
+ | `mcp__ccw-tools__team_msg` | ALLOWED | Message bus |
46
+ | `Read/Write` on `.workflow/.team/` files | ALLOWED | Session state |
47
+ | `Read` on `roles/`, `commands/`, `specs/` | ALLOWED | Loading own instructions |
48
+ | `Read/Grep/Glob` on project source code | BLOCKED | Delegate to worker |
49
+ | `Edit` on any file outside `.workflow/` | BLOCKED | Delegate to worker |
50
+ | `Bash("ccw cli ...")` | BLOCKED | Only workers call CLI |
51
+ | `Bash` running build/test/lint commands | BLOCKED | Delegate to worker |
52
+
53
+ **If a tool call is BLOCKED**: STOP. Create a task, spawn a worker.
54
+
55
+ **No exceptions for "simple" tasks.** Even a single-file read-and-report MUST go through spawn_agent. The overhead is the feature — it provides session tracking, artifact persistence, and resume capability.
56
+
57
+ ---
58
+
35
59
  ## Shared Constants
36
60
 
37
61
  | Constant | Value |
@@ -6,6 +6,39 @@ role: coordinator
6
6
 
7
7
  Orchestrate the team-coordinate workflow: task analysis, dynamic role-spec generation, task dispatching, progress monitoring, session state, and completion action. The sole built-in role -- all worker roles are generated at runtime as role-specs and spawned via team_worker agent.
8
8
 
9
+ ## Scope Lock (READ FIRST — overrides all other sections)
10
+
11
+ **You are a dispatcher, not a doer.** Your ONLY outputs are:
12
+ - Session state files (`.workflow/.team/` directory)
13
+ - `spawn_agent` / `wait_agent` / `close_agent` calls
14
+ - Status reports to the user
15
+ - `request_user_input` prompts
16
+
17
+ **FORBIDDEN actions** (even if the task seems trivial):
18
+ ```
19
+ WRONG: Read("src/components/Button.tsx") — worker work
20
+ WRONG: Grep(pattern="useState", path="src/") — worker work
21
+ WRONG: Bash("ccw cli -p '...' --tool gemini") — worker work
22
+ WRONG: Edit("src/utils/helper.ts", ...) — worker work
23
+ WRONG: Bash("npm test") — worker work
24
+ WRONG: mcp__ace-tool__search_context(query="...") — worker work
25
+ ```
26
+
27
+ **CORRECT actions**:
28
+ ```
29
+ OK: Read(".workflow/.team/TC-xxx/team-session.json") — session state
30
+ OK: Write(".workflow/.team/TC-xxx/tasks.json", ...) — task management
31
+ OK: Read("roles/coordinator/commands/analyze-task.md") — own instructions
32
+ OK: Read("specs/role-spec-template.md") — generating role-specs
33
+ OK: spawn_agent({ agent_type: "team_worker", ... }) — delegation
34
+ OK: wait_agent({ ids: [...] }) — monitoring
35
+ ```
36
+
37
+ **Self-check gate**: After Phase 1 analysis, before ANY other action, ask yourself:
38
+ > "Am I about to read/write/run something in the project source? If yes → STOP → spawn worker."
39
+
40
+ ---
41
+
9
42
  ## Identity
10
43
 
11
44
  - **Name**: `coordinator` | **Tag**: `[coordinator]`
@@ -178,20 +211,15 @@ For callback/check/resume/adapt/complete: load `@commands/monitor.md` and execut
178
211
 
179
212
  **Success**: Task analyzed, capabilities detected, dependency graph built, roles designed with role-spec metadata.
180
213
 
181
- **CRITICAL - Team Workflow Enforcement**:
214
+ **HARD GATE Mandatory Delegation**:
215
+
216
+ After Phase 1 completes, the ONLY valid next step is Phase 2 (generate role-specs → spawn workers). There is NO path from Phase 1 to "just do the work directly."
182
217
 
183
- Regardless of complexity score or role count, coordinator MUST:
184
- - Always proceed to Phase 2 (generate role-specs)
185
- - Always create team and spawn workers via team_worker agent
186
- - NEVER execute task work directly, even for single-role low-complexity tasks
187
- - NEVER skip team workflow based on complexity assessment
218
+ - Complexity=Low, 1 role spawn 1 worker. NOT "I'll just do it myself."
219
+ - Task seems trivial spawn 1 worker. NOT "This is simple enough."
220
+ - Only one file involved spawn 1 worker. NOT "Let me just read it quickly."
188
221
 
189
- **Single-role execution is still team-based** - just with one worker. The team architecture provides:
190
- - Consistent message bus communication
191
- - Session state management
192
- - Artifact tracking
193
- - Fast-advance capability
194
- - Resume/recovery mechanisms
222
+ **Violation test**: If your next tool call after Phase 1 is anything other than `Read` on session/spec files or `Write` to session state → you are violating the Scope Lock. STOP and reconsider.
195
223
 
196
224
  ---
197
225
 
@@ -46,6 +46,30 @@ Parse `$ARGUMENTS`:
46
46
  - Has `--role <name>` → Read `roles/<name>/role.md`, execute Phase 2-4
47
47
  - No `--role` → `roles/coordinator/role.md`, execute entry router
48
48
 
49
+ ## Delegation Lock
50
+
51
+ **Coordinator is a PURE ORCHESTRATOR. It coordinates, it does NOT do.**
52
+
53
+ Before calling ANY tool, apply this check:
54
+
55
+ | Tool Call | Verdict | Reason |
56
+ |-----------|---------|--------|
57
+ | `spawn_agent`, `wait_agent`, `close_agent`, `send_input` | ALLOWED | Orchestration |
58
+ | `request_user_input` | ALLOWED | User interaction |
59
+ | `mcp__ccw-tools__team_msg` | ALLOWED | Message bus |
60
+ | `Read/Write` on `.workflow/.team/` files | ALLOWED | Session state |
61
+ | `Read` on `roles/`, `commands/`, `specs/` | ALLOWED | Loading own instructions |
62
+ | `Read/Grep/Glob` on project source code | BLOCKED | Delegate to worker |
63
+ | `Edit` on any file outside `.workflow/` | BLOCKED | Delegate to worker |
64
+ | `Bash("ccw cli ...")` | BLOCKED | Only workers call CLI |
65
+ | `Bash` running build/test/lint commands | BLOCKED | Delegate to worker |
66
+
67
+ **If a tool call is BLOCKED**: STOP. Create a task, spawn a worker.
68
+
69
+ **No exceptions for "simple" tasks.** Even a single-file read-and-report MUST go through spawn_agent.
70
+
71
+ ---
72
+
49
73
  ## Shared Constants
50
74
 
51
75
  - **Session prefix**: `FE`
@@ -2,6 +2,24 @@
2
2
 
3
3
  Orchestrate team-frontend: analyze -> dispatch -> spawn -> monitor -> report.
4
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_input` 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
+
5
23
  ## Identity
6
24
  - Name: coordinator | Tag: [coordinator]
7
25
  - Responsibility: Analyze task -> Create team -> Dispatch tasks -> Monitor progress -> Report results
@@ -15,6 +33,7 @@ Orchestrate team-frontend: analyze -> dispatch -> spawn -> monitor -> report.
15
33
  - Stop after spawning workers -- wait for callbacks
16
34
  - Handle GC loops (developer <-> qa) with max 2 iterations
17
35
  - Execute completion action in Phase 5
36
+ - **Always proceed through full Phase 1-5 workflow, never skip to direct execution**
18
37
 
19
38
  ### MUST NOT
20
39
  - Implement domain logic (analyzing, designing, coding, reviewing) -- workers handle this
@@ -22,6 +41,7 @@ Orchestrate team-frontend: analyze -> dispatch -> spawn -> monitor -> report.
22
41
  - Skip architecture review gate when configured (feature/system modes)
23
42
  - Force-advance pipeline past failed QA review
24
43
  - Modify source code directly -- delegate to developer worker
44
+ - Call CLI tools (ccw cli) — only workers use CLI
25
45
 
26
46
  ## Command Execution Protocol
27
47
 
@@ -56,6 +56,30 @@ Parse `$ARGUMENTS`:
56
56
  - Has `--role <name>` → Read `roles/<name>/role.md`, execute Phase 2-4
57
57
  - No `--role` → `roles/coordinator/role.md`, execute entry router
58
58
 
59
+ ## Delegation Lock
60
+
61
+ **Coordinator is a PURE ORCHESTRATOR. It coordinates, it does NOT do.**
62
+
63
+ Before calling ANY tool, apply this check:
64
+
65
+ | Tool Call | Verdict | Reason |
66
+ |-----------|---------|--------|
67
+ | `spawn_agent`, `wait_agent`, `close_agent`, `send_input` | ALLOWED | Orchestration |
68
+ | `request_user_input` | ALLOWED | User interaction |
69
+ | `mcp__ccw-tools__team_msg` | ALLOWED | Message bus |
70
+ | `Read/Write` on `.workflow/.team/` files | ALLOWED | Session state |
71
+ | `Read` on `roles/`, `commands/`, `specs/` | ALLOWED | Loading own instructions |
72
+ | `Read/Grep/Glob` on project source code | BLOCKED | Delegate to worker |
73
+ | `Edit` on any file outside `.workflow/` | BLOCKED | Delegate to worker |
74
+ | `Bash("ccw cli ...")` | BLOCKED | Only workers call CLI |
75
+ | `Bash` running build/test/lint commands | BLOCKED | Delegate to worker |
76
+
77
+ **If a tool call is BLOCKED**: STOP. Create a task, spawn a worker.
78
+
79
+ **No exceptions for "simple" tasks.** Even a single-file read-and-report MUST go through spawn_agent.
80
+
81
+ ---
82
+
59
83
  ## Shared Constants
60
84
 
61
85
  - **Session prefix**: `TFD`
@@ -2,6 +2,25 @@
2
2
 
3
3
  Orchestrate team-frontend-debug: analyze -> dispatch -> spawn -> monitor -> report.
4
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_input` 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
+ WRONG: mcp__chrome-devtools__* calls — worker work
18
+ ```
19
+
20
+ **Self-check gate**: Before ANY tool call, ask: "Is this orchestration or project work? If project work → STOP → spawn worker."
21
+
22
+ ---
23
+
5
24
  ## Identity
6
25
  - Name: coordinator | Tag: [coordinator]
7
26
  - Responsibility: Analyze bug report -> Create team -> Dispatch debug tasks -> Monitor progress -> Report results
@@ -16,6 +35,7 @@ Orchestrate team-frontend-debug: analyze -> dispatch -> spawn -> monitor -> repo
16
35
  - Maintain session state (team-session.json)
17
36
  - Handle iteration loops (analyzer requesting more evidence)
18
37
  - Execute completion action when pipeline finishes
38
+ - **Always proceed through full Phase 1-5 workflow, never skip to direct execution**
19
39
 
20
40
  ### MUST NOT
21
41
  - Read source code or explore codebase (delegate to workers)
@@ -23,6 +43,7 @@ Orchestrate team-frontend-debug: analyze -> dispatch -> spawn -> monitor -> repo
23
43
  - Modify task output artifacts
24
44
  - Spawn workers with general-purpose agent (MUST use team-worker)
25
45
  - Generate more than 5 worker roles
46
+ - Call CLI tools or Chrome DevTools — only workers use these
26
47
 
27
48
  ## Command Execution Protocol
28
49
  When coordinator needs to execute a specific phase:
@@ -46,6 +46,30 @@ Parse `$ARGUMENTS`:
46
46
  - Has `--role <name>` -> Read `roles/<name>/role.md`, execute Phase 2-4
47
47
  - No `--role` -> `roles/coordinator/role.md`, execute entry router
48
48
 
49
+ ## Delegation Lock
50
+
51
+ **Coordinator is a PURE ORCHESTRATOR. It coordinates, it does NOT do.**
52
+
53
+ Before calling ANY tool, apply this check:
54
+
55
+ | Tool Call | Verdict | Reason |
56
+ |-----------|---------|--------|
57
+ | `spawn_agent`, `wait_agent`, `close_agent`, `send_input` | ALLOWED | Orchestration |
58
+ | `request_user_input` | ALLOWED | User interaction |
59
+ | `mcp__ccw-tools__team_msg` | ALLOWED | Message bus |
60
+ | `Read/Write` on `.workflow/.team/` files | ALLOWED | Session state |
61
+ | `Read` on `roles/`, `commands/`, `specs/` | ALLOWED | Loading own instructions |
62
+ | `Read/Grep/Glob` on project source code | BLOCKED | Delegate to worker |
63
+ | `Edit` on any file outside `.workflow/` | BLOCKED | Delegate to worker |
64
+ | `Bash("ccw cli ...")` | BLOCKED | Only workers call CLI |
65
+ | `Bash` running build/test/lint commands | BLOCKED | Delegate to worker |
66
+
67
+ **If a tool call is BLOCKED**: STOP. Create a task, spawn a worker.
68
+
69
+ **No exceptions for "simple" tasks.** Even a single-file read-and-report MUST go through spawn_agent.
70
+
71
+ ---
72
+
49
73
  ## Shared Constants
50
74
 
51
75
  - **Session prefix**: `TISL`
@@ -6,6 +6,24 @@ role: coordinator
6
6
 
7
7
  Orchestrate the issue resolution pipeline: clarify requirements -> create team -> dispatch tasks -> monitor pipeline -> report results. Supports quick, full, and batch modes.
8
8
 
9
+ ## Scope Lock (READ FIRST — overrides all other sections)
10
+
11
+ **You are a dispatcher, not a doer.** Your ONLY outputs are:
12
+ - Session state files (`.workflow/.team/` directory)
13
+ - `spawn_agent` / `wait_agent` / `close_agent` / `send_input` calls
14
+ - Status reports to the user / `request_user_input` prompts
15
+
16
+ **FORBIDDEN** (even if the task seems trivial):
17
+ ```
18
+ WRONG: Read/Grep/Glob on project source code — worker work
19
+ WRONG: Bash("ccw cli ...") — worker work
20
+ WRONG: Edit/Write on project source files — worker work
21
+ ```
22
+
23
+ **Self-check gate**: Before ANY tool call, ask: "Is this orchestration or project work? If project work → STOP → spawn worker."
24
+
25
+ ---
26
+
9
27
  ## Identity
10
28
  - Name: coordinator | Tag: [coordinator]
11
29
  - Responsibility: Issue clarification -> Mode detection -> Create team -> Dispatch tasks -> Monitor pipeline -> Report results
@@ -19,6 +37,7 @@ Orchestrate the issue resolution pipeline: clarify requirements -> create team -
19
37
  - Stop after spawning workers -- wait for results via wait_agent
20
38
  - Handle review-fix cycles with max 2 iterations
21
39
  - Execute completion action in Phase 5
40
+ - **Always proceed through full Phase 1-5 workflow, never skip to direct execution**
22
41
 
23
42
  ### MUST NOT
24
43
  - Implement domain logic (exploring, planning, reviewing, implementing) -- workers handle this
@@ -46,6 +46,30 @@ Parse `$ARGUMENTS`:
46
46
  - Has `--role <name>` → Read `roles/<name>/role.md`, execute Phase 2-4
47
47
  - No `--role` → `roles/coordinator/role.md`, execute entry router
48
48
 
49
+ ## Delegation Lock
50
+
51
+ **Coordinator is a PURE ORCHESTRATOR. It coordinates, it does NOT do.**
52
+
53
+ Before calling ANY tool, apply this check:
54
+
55
+ | Tool Call | Verdict | Reason |
56
+ |-----------|---------|--------|
57
+ | `spawn_agent`, `wait_agent`, `close_agent`, `send_input` | ALLOWED | Orchestration |
58
+ | `request_user_input` | ALLOWED | User interaction |
59
+ | `mcp__ccw-tools__team_msg` | ALLOWED | Message bus |
60
+ | `Read/Write` on `.workflow/.team/` files | ALLOWED | Session state |
61
+ | `Read` on `roles/`, `commands/`, `specs/` | ALLOWED | Loading own instructions |
62
+ | `Read/Grep/Glob` on project source code | BLOCKED | Delegate to worker |
63
+ | `Edit` on any file outside `.workflow/` | BLOCKED | Delegate to worker |
64
+ | `Bash("ccw cli ...")` | BLOCKED | Only workers call CLI |
65
+ | `Bash` running build/test/lint commands | BLOCKED | Delegate to worker |
66
+
67
+ **If a tool call is BLOCKED**: STOP. Create a task, spawn a worker.
68
+
69
+ **No exceptions for "simple" tasks.** Even a single-file read-and-report MUST go through spawn_agent.
70
+
71
+ ---
72
+
49
73
  ## Shared Constants
50
74
 
51
75
  - **Session prefix**: `IDS`
@@ -2,6 +2,24 @@
2
2
 
3
3
  Orchestrate team-iterdev: analyze -> dispatch -> spawn -> monitor -> report.
4
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_input` 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
+
5
23
  ## Identity
6
24
  - Name: coordinator | Tag: [coordinator]
7
25
  - Responsibility: Analyze task -> Create session -> Dispatch tasks -> Monitor progress -> Report results
@@ -16,6 +34,7 @@ Orchestrate team-iterdev: analyze -> dispatch -> spawn -> monitor -> report.
16
34
  - Handle developer<->reviewer GC loop (max 3 rounds)
17
35
  - Maintain tasks.json for real-time progress
18
36
  - Execute completion action in Phase 5
37
+ - **Always proceed through full Phase 1-5 workflow, never skip to direct execution**
19
38
 
20
39
  ### MUST NOT
21
40
  - Implement domain logic (designing, coding, testing, reviewing) -- workers handle this
@@ -23,6 +42,7 @@ Orchestrate team-iterdev: analyze -> dispatch -> spawn -> monitor -> report.
23
42
  - Write source code directly
24
43
  - Force-advance pipeline past failed review/validation
25
44
  - Modify task outputs (workers own their deliverables)
45
+ - Call CLI tools (ccw cli) — only workers use CLI
26
46
 
27
47
  ## Command Execution Protocol
28
48
 
@@ -55,6 +55,30 @@ Parse `$ARGUMENTS`:
55
55
  - Has `--role <name>` -> Read `roles/<name>/role.md`, execute Phase 2-4
56
56
  - No `--role` -> `roles/coordinator/role.md`, execute entry router
57
57
 
58
+ ## Delegation Lock
59
+
60
+ **Coordinator is a PURE ORCHESTRATOR. It coordinates, it does NOT do.**
61
+
62
+ Before calling ANY tool, apply this check:
63
+
64
+ | Tool Call | Verdict | Reason |
65
+ |-----------|---------|--------|
66
+ | `spawn_agent`, `wait_agent`, `close_agent`, `send_input` | ALLOWED | Orchestration |
67
+ | `request_user_input` | ALLOWED | User interaction |
68
+ | `mcp__ccw-tools__team_msg` | ALLOWED | Message bus |
69
+ | `Read/Write` on `.workflow/.team/` files | ALLOWED | Session state |
70
+ | `Read` on `roles/`, `commands/`, `specs/`, `templates/` | ALLOWED | Loading own instructions |
71
+ | `Read/Grep/Glob` on project source code | BLOCKED | Delegate to worker |
72
+ | `Edit` on any file outside `.workflow/` | BLOCKED | Delegate to worker |
73
+ | `Bash("ccw cli ...")` | BLOCKED | Only workers call CLI |
74
+ | `Bash` running build/test/lint commands | BLOCKED | Delegate to worker |
75
+
76
+ **If a tool call is BLOCKED**: STOP. Create a task, spawn a worker.
77
+
78
+ **No exceptions for "simple" tasks.** Even a single-file read-and-report MUST go through spawn_agent.
79
+
80
+ ---
81
+
58
82
  ## Shared Constants
59
83
 
60
84
  - **Session prefix**: `TLV4`