claude-code-workflow 7.2.20 → 7.2.22

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 (43) hide show
  1. package/.claude/commands/workflow/analyze-with-file.md +25 -12
  2. package/.codex/skills/analyze-with-file/SKILL.md +235 -497
  3. package/.codex/skills/brainstorm-with-file/SKILL.md +661 -751
  4. package/.codex/skills/csv-wave-pipeline/SKILL.md +192 -198
  5. package/.codex/skills/team-arch-opt/SKILL.md +24 -0
  6. package/.codex/skills/team-arch-opt/roles/coordinator/role.md +22 -0
  7. package/.codex/skills/team-brainstorm/SKILL.md +24 -0
  8. package/.codex/skills/team-brainstorm/roles/coordinator/role.md +20 -0
  9. package/.codex/skills/team-coordinate/SKILL.md +24 -0
  10. package/.codex/skills/team-coordinate/roles/coordinator/role.md +40 -12
  11. package/.codex/skills/team-frontend/SKILL.md +24 -0
  12. package/.codex/skills/team-frontend/roles/coordinator/role.md +20 -0
  13. package/.codex/skills/team-frontend-debug/SKILL.md +24 -0
  14. package/.codex/skills/team-frontend-debug/roles/coordinator/role.md +21 -0
  15. package/.codex/skills/team-issue/SKILL.md +24 -0
  16. package/.codex/skills/team-issue/roles/coordinator/role.md +19 -0
  17. package/.codex/skills/team-iterdev/SKILL.md +24 -0
  18. package/.codex/skills/team-iterdev/roles/coordinator/role.md +20 -0
  19. package/.codex/skills/team-lifecycle-v4/SKILL.md +24 -0
  20. package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +28 -2
  21. package/.codex/skills/team-perf-opt/SKILL.md +24 -0
  22. package/.codex/skills/team-perf-opt/roles/coordinator/role.md +20 -0
  23. package/.codex/skills/team-planex/SKILL.md +24 -0
  24. package/.codex/skills/team-planex/roles/coordinator/role.md +19 -0
  25. package/.codex/skills/team-quality-assurance/SKILL.md +24 -0
  26. package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +21 -0
  27. package/.codex/skills/team-review/SKILL.md +24 -0
  28. package/.codex/skills/team-review/roles/coordinator/role.md +21 -0
  29. package/.codex/skills/team-roadmap-dev/SKILL.md +24 -0
  30. package/.codex/skills/team-roadmap-dev/roles/coordinator/role.md +19 -0
  31. package/.codex/skills/team-tech-debt/SKILL.md +24 -0
  32. package/.codex/skills/team-tech-debt/roles/coordinator/role.md +19 -0
  33. package/.codex/skills/team-testing/SKILL.md +24 -0
  34. package/.codex/skills/team-testing/roles/coordinator/role.md +21 -0
  35. package/.codex/skills/team-uidesign/SKILL.md +24 -0
  36. package/.codex/skills/team-uidesign/roles/coordinator/role.md +20 -0
  37. package/.codex/skills/team-ultra-analyze/SKILL.md +24 -0
  38. package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +20 -0
  39. package/.codex/skills/team-ux-improve/SKILL.md +24 -0
  40. package/.codex/skills/team-ux-improve/roles/coordinator/role.md +20 -0
  41. package/package.json +1 -1
  42. package/.codex/skills/collaborative-plan-with-file/SKILL.md +0 -830
  43. package/.codex/skills/unified-execute-with-file/SKILL.md +0 -797
@@ -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`
@@ -2,6 +2,28 @@
2
2
 
3
3
  Orchestrate team-lifecycle-v4: 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
11
+ - `request_user_input` prompts
12
+
13
+ **FORBIDDEN actions** (even if the task seems trivial):
14
+ ```
15
+ WRONG: Read("src/...") — worker work
16
+ WRONG: Grep/Glob on project source — worker work
17
+ WRONG: Bash("ccw cli -p '...' --tool gemini") — worker work
18
+ WRONG: Edit/Write on project source files — worker work
19
+ WRONG: Bash("npm test"), Bash("tsc"), etc. — worker work
20
+ ```
21
+
22
+ **Self-check gate**: Before ANY tool call, ask:
23
+ > "Is this orchestration (session state, spawn, wait) or project work? If project work → STOP → spawn worker."
24
+
25
+ ---
26
+
5
27
  ## Identity
6
28
  - Name: coordinator | Tag: [coordinator]
7
29
  - Responsibility: Analyze task -> Create session -> Dispatch tasks -> Monitor progress -> Report results
@@ -19,10 +41,11 @@ Orchestrate team-lifecycle-v4: analyze -> dispatch -> spawn -> monitor -> report
19
41
 
20
42
  ### MUST NOT
21
43
  - Read source code or explore codebase (delegate to workers)
22
- - Execute task work directly
44
+ - Execute task work directly (even for single-role low-complexity tasks)
23
45
  - Modify task output artifacts
24
46
  - Spawn workers with general-purpose agent (MUST use tlv4_worker)
25
47
  - Generate more than 5 worker roles
48
+ - Call CLI tools (ccw cli) — only workers use CLI
26
49
 
27
50
  ## Command Execution Protocol
28
51
  When coordinator needs to execute a specific phase:
@@ -65,7 +88,10 @@ TEXT-LEVEL ONLY. No source code reading.
65
88
  2. Clarify if ambiguous (request_user_input: scope, deliverables, constraints)
66
89
  3. Delegate to @commands/analyze.md
67
90
  4. Output: task-analysis.json
68
- 5. CRITICAL: Always proceed to Phase 2, never skip team workflow
91
+ 5. **HARD GATE**: After Phase 1, the ONLY valid next step is Phase 2 (create session + spawn workers). There is NO path to "just do it directly."
92
+ - Complexity=Low → still spawn worker
93
+ - Single file task → still spawn worker
94
+ - "Seems trivial" → still spawn worker
69
95
 
70
96
  ## Phase 2: Create Session + Initialize
71
97
 
@@ -57,6 +57,30 @@ Parse `$ARGUMENTS`:
57
57
  - Has `--role <name>` → Read `roles/<name>/role.md`, execute Phase 2-4
58
58
  - No `--role` → `roles/coordinator/role.md`, execute entry router
59
59
 
60
+ ## Delegation Lock
61
+
62
+ **Coordinator is a PURE ORCHESTRATOR. It coordinates, it does NOT do.**
63
+
64
+ Before calling ANY tool, apply this check:
65
+
66
+ | Tool Call | Verdict | Reason |
67
+ |-----------|---------|--------|
68
+ | `spawn_agent`, `wait_agent`, `close_agent`, `send_input` | ALLOWED | Orchestration |
69
+ | `request_user_input` | ALLOWED | User interaction |
70
+ | `mcp__ccw-tools__team_msg` | ALLOWED | Message bus |
71
+ | `Read/Write` on `.workflow/.team/` files | ALLOWED | Session state |
72
+ | `Read` on `roles/`, `commands/`, `specs/` | ALLOWED | Loading own instructions |
73
+ | `Read/Grep/Glob` on project source code | BLOCKED | Delegate to worker |
74
+ | `Edit` on any file outside `.workflow/` | BLOCKED | Delegate to worker |
75
+ | `Bash("ccw cli ...")` | BLOCKED | Only workers call CLI |
76
+ | `Bash` running build/test/lint commands | BLOCKED | Delegate to worker |
77
+
78
+ **If a tool call is BLOCKED**: STOP. Create a task, spawn a worker.
79
+
80
+ **No exceptions for "simple" tasks.** Even a single-file read-and-report MUST go through spawn_agent.
81
+
82
+ ---
83
+
60
84
  ## Shared Constants
61
85
 
62
86
  - **Session prefix**: `PERF-OPT`
@@ -6,6 +6,24 @@
6
6
 
7
7
  Orchestrates the performance optimization pipeline: manages task chains, spawns team-worker agents, handles review-fix cycles, and drives the pipeline to completion.
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
  ## Boundaries
10
28
 
11
29
  ### MUST
@@ -16,6 +34,7 @@ Orchestrates the performance optimization pipeline: manages task chains, spawns
16
34
  - Stop after spawning workers -- wait for callbacks
17
35
  - Handle review-fix cycles with max 3 iterations per branch
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
 
@@ -24,6 +43,7 @@ Orchestrates the performance optimization pipeline: manages task chains, spawns
24
43
  - Skip checkpoints when configured
25
44
  - Force-advance pipeline past failed review/benchmark
26
45
  - Modify source code directly -- delegate to optimizer worker
46
+ - Call CLI tools (ccw cli) — only workers use CLI
27
47
 
28
48
  ---
29
49
 
@@ -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**: `PEX`
@@ -2,6 +2,24 @@
2
2
 
3
3
  Orchestrate team-planex: 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: Parse input -> Create team -> Dispatch PLAN-001 -> Spawn planner -> Monitor results -> Spawn executors -> Report
@@ -14,6 +32,7 @@ Orchestrate team-planex: analyze -> dispatch -> spawn -> monitor -> report.
14
32
  - Dispatch tasks via `commands/dispatch.md`
15
33
  - Monitor progress via `commands/monitor.md` with Spawn-and-Stop pattern
16
34
  - Maintain session state (.msg/meta.json)
35
+ - **Always proceed through full Phase 1-5 workflow, never skip to direct execution**
17
36
 
18
37
  ### MUST NOT
19
38
  - Execute planning or implementation work directly (delegate to workers)