subagent-cli 0.1.6__tar.gz → 0.1.7__tar.gz

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 (50) hide show
  1. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/PKG-INFO +15 -54
  2. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/README.ja.md +14 -53
  3. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/README.md +14 -53
  4. subagent_cli-0.1.7/config.example.yaml +97 -0
  5. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/docs/ARCHITECTURE.md +3 -3
  6. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/docs/examples/checkpoint.json +1 -2
  7. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/docs/examples/normalized-event.ndjson +1 -1
  8. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/docs/examples/worker-continue-flow.md +4 -4
  9. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/pyproject.toml +1 -1
  10. subagent_cli-0.1.7/skills/subagent-manager/SKILL.md +140 -0
  11. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/__init__.py +1 -1
  12. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/cli.py +56 -133
  13. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/config.py +89 -83
  14. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/handoff_service.py +7 -16
  15. subagent_cli-0.1.7/src/subagent/prompt_service.py +81 -0
  16. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/state.py +9 -14
  17. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/worker_service.py +20 -50
  18. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/tests/test_acp_backend_integration.py +10 -18
  19. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/tests/test_cli_commands.py +27 -39
  20. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/tests/test_daemon.py +7 -10
  21. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/tests/test_handoff_commands.py +6 -13
  22. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/tests/test_prompt_and_contracts.py +21 -27
  23. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/tests/test_turn_commands.py +13 -25
  24. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/tests/test_worker_lifecycle.py +7 -15
  25. subagent_cli-0.1.6/config.example.yaml +0 -104
  26. subagent_cli-0.1.6/src/subagent/prompt_service.py +0 -120
  27. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/.github/workflows/publish-pypi.yml +0 -0
  28. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/.gitignore +0 -0
  29. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/.python-version +0 -0
  30. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/CONTRIBUTING.md +0 -0
  31. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/LICENSE +0 -0
  32. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/docs/examples/handoff.md +0 -0
  33. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/acp_client.py +0 -0
  34. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/approval_utils.py +0 -0
  35. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/constants.py +0 -0
  36. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/controller_service.py +0 -0
  37. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/daemon.py +0 -0
  38. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/errors.py +0 -0
  39. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/hints.py +0 -0
  40. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/input_contract.py +0 -0
  41. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/launcher_service.py +0 -0
  42. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/output.py +0 -0
  43. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/paths.py +0 -0
  44. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/runtime_service.py +0 -0
  45. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/simple_yaml.py +0 -0
  46. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/turn_service.py +0 -0
  47. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/src/subagent/worker_runtime.py +0 -0
  48. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/tests/fixtures/fake_acp_agent.py +0 -0
  49. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/tests/test_paths.py +0 -0
  50. {subagent_cli-0.1.6 → subagent_cli-0.1.7}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: subagent-cli
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: Protocol-agnostic worker orchestration CLI
5
5
  Author: niitsuma-t
6
6
  License: MIT License
@@ -101,6 +101,10 @@ From local artifacts:
101
101
  pip install dist/subagent_cli-*.whl
102
102
  ```
103
103
 
104
+ ## Terminal Demo 🎬
105
+ Recorded asciinema session:
106
+ - [![asciicast](https://asciinema.org/a/Cxfk7i9wOOpZB17F.svg)](https://asciinema.org/a/Cxfk7i9wOOpZB17F)
107
+
104
108
  ## Quick Start ⚡
105
109
  1. Bootstrap your local config.
106
110
  ```bash
@@ -114,62 +118,19 @@ subagent config init --scope user
114
118
  subagent controller init --cwd .
115
119
  ```
116
120
 
117
- 4. Hand off from here to your manager agent (Codex / Claude Code).
118
- Ask the manager agent to run `subagent prompt render --target manager` as its first step.
119
- Use this instruction template:
120
-
121
- ```text
122
- Act as the manager and product lead for this repository.
123
-
124
- Use subagent-cli as the control plane and progress this task by coordinating a small team of worker agents rather than acting as a solo implementer.
125
-
126
- Your role:
127
-
128
- * Define the objective, user value, constraints, scope, and success criteria.
129
- * Break the work into small chunks with clear owners.
130
- * Assign worker roles intentionally.
131
- * Coordinate handoffs, reviews, and validation.
132
- * Review worker proposals critically and give actionable feedback.
133
- * Make explicit decisions on whether to proceed, revise, compare options, or reject.
134
-
135
- Default behavior:
136
-
137
- * Delegate by default when useful.
138
- * Prefer small, verifiable increments.
139
- * Prevent over-engineering and keep the team focused on the smallest valuable outcome.
140
- * Do not accept worker output blindly; evaluate it for product fit, feasibility, scope, risk, and validation quality.
141
-
142
- Before execution:
143
-
144
- 1. Run `subagent prompt render --target manager` and follow that output.
145
- 2. Check command help before execution (`subagent worker --help`, `subagent send --help`, `subagent approve --help`).
146
- 3. State:
147
- * your role
148
- * planned worker roles
149
- * task breakdown
150
- * success criteria
151
- * validation plan
152
-
153
- During execution:
154
-
155
- 4. Start and coordinate workers with subagent-cli.
156
- 5. In every worker instruction, explicitly state which skills the worker should use for the task before implementation.
157
- 6. Use `send` as the default turn driver (`send` waits by default).
158
- 7. If `matchedEvent.type` is `approval.requested`, run `approve` and continue with `send`.
159
- 8. Use `watch` only when detailed event streaming or debugging is needed.
160
- 9. Use handoff/continue when context gets large.
161
- 10. Require workers to report: goal, findings, proposal, risks, validation, next step.
162
- 11. Respond to worker proposals with: decision, reason, what is good, what is missing, what should change, and next action.
163
-
164
- Before reporting completion:
121
+ 4. Install the recommended manager skill (after this repository is pushed to GitHub).
122
+ ```bash
123
+ npx skills add "github/otakumesi/subagent-cli"
124
+ ```
165
125
 
166
- 12. Verify results with tests or checks.
167
- 13. Confirm the final output is integrated, validated, and aligned with the task objective.
126
+ 5. Hand off from here to your manager agent (Codex / Claude Code).
127
+ Use an instruction like this:
168
128
 
169
- If worker startup or turn operations fail due to sandbox limits, request approval for out-of-sandbox execution and retry.
129
+ ```text
130
+ <what to do that you want>
170
131
 
171
- Task to execute:
172
- <your task here>
132
+ Use subagent commands to delegate tasks to a team of agents and coordinate their progress.
133
+ Use the "subagent-manager" skill.
173
134
  ```
174
135
 
175
136
  After handoff, the manager agent's standard lifecycle is:
@@ -58,6 +58,10 @@ pip install subagent-cli
58
58
  pip install dist/subagent_cli-*.whl
59
59
  ```
60
60
 
61
+ ## ターミナルデモ 🎬
62
+ 録画した asciinema セッション:
63
+ - [![asciicast](https://asciinema.org/a/Cxfk7i9wOOpZB17F.svg)](https://asciinema.org/a/Cxfk7i9wOOpZB17F)
64
+
61
65
  ## クイックスタート ⚡
62
66
  1. ローカル設定ファイルを初期化します。
63
67
  ```bash
@@ -71,62 +75,19 @@ subagent config init --scope user
71
75
  subagent controller init --cwd .
72
76
  ```
73
77
 
74
- 4. ここからマネージャーエージェント(Codex / Claude Code)へ handoff します。
75
- マネージャー側の最初の手順として `subagent prompt render --target manager` を実行させてください。
76
- 以下のテンプレートを使えます:
77
-
78
- ```text
79
- Act as the manager and product lead for this repository.
80
-
81
- Use subagent-cli as the control plane and progress this task by coordinating a small team of worker agents rather than acting as a solo implementer.
82
-
83
- Your role:
84
-
85
- * Define the objective, user value, constraints, scope, and success criteria.
86
- * Break the work into small chunks with clear owners.
87
- * Assign worker roles intentionally.
88
- * Coordinate handoffs, reviews, and validation.
89
- * Review worker proposals critically and give actionable feedback.
90
- * Make explicit decisions on whether to proceed, revise, compare options, or reject.
91
-
92
- Default behavior:
93
-
94
- * Delegate by default when useful.
95
- * Prefer small, verifiable increments.
96
- * Prevent over-engineering and keep the team focused on the smallest valuable outcome.
97
- * Do not accept worker output blindly; evaluate it for product fit, feasibility, scope, risk, and validation quality.
98
-
99
- Before execution:
100
-
101
- 1. Run `subagent prompt render --target manager` and follow that output.
102
- 2. Check command help before execution (`subagent worker --help`, `subagent send --help`, `subagent approve --help`).
103
- 3. State:
104
- * your role
105
- * planned worker roles
106
- * task breakdown
107
- * success criteria
108
- * validation plan
109
-
110
- During execution:
111
-
112
- 4. Start and coordinate workers with subagent-cli.
113
- 5. In every worker instruction, explicitly state which skills the worker should use for the task before implementation.
114
- 6. Use `send` as the default turn driver (`send` waits by default).
115
- 7. If `matchedEvent.type` is `approval.requested`, run `approve` and continue with `send`.
116
- 8. Use `watch` only when detailed event streaming or debugging is needed.
117
- 9. Use handoff/continue when context gets large.
118
- 10. Require workers to report: goal, findings, proposal, risks, validation, next step.
119
- 11. Respond to worker proposals with: decision, reason, what is good, what is missing, what should change, and next action.
120
-
121
- Before reporting completion:
78
+ 4. (このリポジトリを GitHub push 後)推奨の manager スキルをインストールします。
79
+ ```bash
80
+ npx skills add "github/otakumesi/subagent-cli"
81
+ ```
122
82
 
123
- 12. Verify results with tests or checks.
124
- 13. Confirm the final output is integrated, validated, and aligned with the task objective.
83
+ 5. ここからマネージャーエージェント(Codex / Claude Code)へ handoff します。
84
+ 以下のような指示文を使えます:
125
85
 
126
- If worker startup or turn operations fail due to sandbox limits, request approval for out-of-sandbox execution and retry.
86
+ ```text
87
+ <what to do that you want>
127
88
 
128
- Task to execute:
129
- <your task here>
89
+ Use subagent commands to delegate tasks to a team of agents and coordinate their progress.
90
+ Use the "subagent-manager" skill.
130
91
  ```
131
92
 
132
93
  handoff 後のマネージャーエージェント標準ライフサイクル:
@@ -58,6 +58,10 @@ From local artifacts:
58
58
  pip install dist/subagent_cli-*.whl
59
59
  ```
60
60
 
61
+ ## Terminal Demo 🎬
62
+ Recorded asciinema session:
63
+ - [![asciicast](https://asciinema.org/a/Cxfk7i9wOOpZB17F.svg)](https://asciinema.org/a/Cxfk7i9wOOpZB17F)
64
+
61
65
  ## Quick Start ⚡
62
66
  1. Bootstrap your local config.
63
67
  ```bash
@@ -71,62 +75,19 @@ subagent config init --scope user
71
75
  subagent controller init --cwd .
72
76
  ```
73
77
 
74
- 4. Hand off from here to your manager agent (Codex / Claude Code).
75
- Ask the manager agent to run `subagent prompt render --target manager` as its first step.
76
- Use this instruction template:
77
-
78
- ```text
79
- Act as the manager and product lead for this repository.
80
-
81
- Use subagent-cli as the control plane and progress this task by coordinating a small team of worker agents rather than acting as a solo implementer.
82
-
83
- Your role:
84
-
85
- * Define the objective, user value, constraints, scope, and success criteria.
86
- * Break the work into small chunks with clear owners.
87
- * Assign worker roles intentionally.
88
- * Coordinate handoffs, reviews, and validation.
89
- * Review worker proposals critically and give actionable feedback.
90
- * Make explicit decisions on whether to proceed, revise, compare options, or reject.
91
-
92
- Default behavior:
93
-
94
- * Delegate by default when useful.
95
- * Prefer small, verifiable increments.
96
- * Prevent over-engineering and keep the team focused on the smallest valuable outcome.
97
- * Do not accept worker output blindly; evaluate it for product fit, feasibility, scope, risk, and validation quality.
98
-
99
- Before execution:
100
-
101
- 1. Run `subagent prompt render --target manager` and follow that output.
102
- 2. Check command help before execution (`subagent worker --help`, `subagent send --help`, `subagent approve --help`).
103
- 3. State:
104
- * your role
105
- * planned worker roles
106
- * task breakdown
107
- * success criteria
108
- * validation plan
109
-
110
- During execution:
111
-
112
- 4. Start and coordinate workers with subagent-cli.
113
- 5. In every worker instruction, explicitly state which skills the worker should use for the task before implementation.
114
- 6. Use `send` as the default turn driver (`send` waits by default).
115
- 7. If `matchedEvent.type` is `approval.requested`, run `approve` and continue with `send`.
116
- 8. Use `watch` only when detailed event streaming or debugging is needed.
117
- 9. Use handoff/continue when context gets large.
118
- 10. Require workers to report: goal, findings, proposal, risks, validation, next step.
119
- 11. Respond to worker proposals with: decision, reason, what is good, what is missing, what should change, and next action.
120
-
121
- Before reporting completion:
78
+ 4. Install the recommended manager skill (after this repository is pushed to GitHub).
79
+ ```bash
80
+ npx skills add "github/otakumesi/subagent-cli"
81
+ ```
122
82
 
123
- 12. Verify results with tests or checks.
124
- 13. Confirm the final output is integrated, validated, and aligned with the task objective.
83
+ 5. Hand off from here to your manager agent (Codex / Claude Code).
84
+ Use an instruction like this:
125
85
 
126
- If worker startup or turn operations fail due to sandbox limits, request approval for out-of-sandbox execution and retry.
86
+ ```text
87
+ <what to do that you want>
127
88
 
128
- Task to execute:
129
- <your task here>
89
+ Use subagent commands to delegate tasks to a team of agents and coordinate their progress.
90
+ Use the "subagent-manager" skill.
130
91
  ```
131
92
 
132
93
  After handoff, the manager agent's standard lifecycle is:
@@ -0,0 +1,97 @@
1
+ launchers:
2
+ codex:
3
+ backend:
4
+ kind: acp-stdio
5
+ command: npx
6
+ args:
7
+ - -y
8
+ - "@zed-industries/codex-acp"
9
+ env: {}
10
+
11
+ claude-code:
12
+ backend:
13
+ kind: acp-stdio
14
+ command: npx
15
+ args:
16
+ - -y
17
+ - "@zed-industries/claude-agent-acp"
18
+ env: {}
19
+
20
+ gemini:
21
+ backend:
22
+ kind: acp-stdio
23
+ command: npx
24
+ args:
25
+ - -y
26
+ - "@google/gemini-cli"
27
+ - "--experimental-acp"
28
+ env: {}
29
+
30
+ opencode:
31
+ backend:
32
+ kind: acp-stdio
33
+ command: opencode
34
+ args:
35
+ - acp
36
+ env: {}
37
+
38
+ cline:
39
+ backend:
40
+ kind: acp-stdio
41
+ command: npx
42
+ args:
43
+ - -y
44
+ - "cline"
45
+ - "--acp"
46
+ env: {}
47
+
48
+ github-copilot:
49
+ backend:
50
+ kind: acp-stdio
51
+ command: npx
52
+ args:
53
+ - -y
54
+ - "@github/copilot-language-server"
55
+ - "--acp"
56
+ env: {}
57
+
58
+ kiro:
59
+ backend:
60
+ kind: acp-stdio
61
+ command: npx
62
+ args:
63
+ - -y
64
+ - "@kirodotdev/cli"
65
+ - acp
66
+ env: {}
67
+
68
+ roleDefaults:
69
+ promptLanguage: en
70
+ responseLanguage: same_as_manager
71
+
72
+ roleHints:
73
+ developer:
74
+ preferredLauncher: codex
75
+ delegationHint: "State goal, constraints, done conditions, affected files, and test expectations."
76
+ # Optional: list skill names the agent should explicitly invoke for this role.
77
+ recommendedSkills: []
78
+ reviewer:
79
+ preferredLauncher: claude-code
80
+ delegationHint: "Review as a lead engineer; prioritize bugs, regressions, missing tests, and risk."
81
+ recommendedSkills: []
82
+ research_analyst:
83
+ preferredLauncher: gemini
84
+ delegationHint: "Gather primary sources first, then report with dates and source URLs."
85
+ recommendedSkills: []
86
+ ux_designer:
87
+ preferredLauncher: claude-code
88
+ delegationHint: "Provide user flows, alternatives, trade-offs, decision rationale, and validation metrics."
89
+ recommendedSkills: []
90
+ data_scientist:
91
+ preferredLauncher: codex
92
+ delegationHint: "Define hypothesis, required data, method, evaluation metrics, and reproducible steps."
93
+ recommendedSkills: []
94
+
95
+ defaults:
96
+ launcher: codex
97
+ role: developer
@@ -5,13 +5,13 @@
5
5
  - Local control plane: `subagentd` process for bootstrap/status, heartbeat, worker runtime health checks, and auto-restart attempts.
6
6
  - Runtime state: sqlite-backed `StateStore` for controllers, controller instances, workers, event journal, approval requests, and handoff snapshots.
7
7
  - Runtime adapter: per-worker ACP runtime process (`subagent.worker_runtime`) with unix-socket IPC (`runtime_service`).
8
- - Config registry: loader for `launchers` / `profiles` / `packs` / `defaults` from config.
8
+ - Config registry: loader for `launchers` / `roleHints` / `roleDefaults` / `defaults` from config.
9
9
 
10
10
  ## Current v1 Scope (Implemented)
11
11
  - `config`: `init` (user/project config template generation)
12
- - `launcher/profile/pack`: `list`, `show`
12
+ - `launcher/role`: `list`, `show`
13
13
  - `launcher`: `probe`
14
- - `prompt`: `render` (manager/worker)
14
+ - `prompt`: `render` (manager)
15
15
  - `controller`: `init`, `attach`, `status`, `recover`, `release`
16
16
  - `worker`: `start`, `list`, `show`, `inspect`, `stop`, `handoff`, `continue`
17
17
  - turn operations: `send`, `watch`, `wait`, `approve`, `cancel`
@@ -3,8 +3,7 @@
3
3
  "workerId": "w_123",
4
4
  "controllerId": "ctl_abc123",
5
5
  "launcher": "codex",
6
- "profile": "worker-default",
7
- "packs": ["repo-conventions"],
6
+ "role": "worker-default",
8
7
  "cwd": "/path/to/workspace",
9
8
  "state": "handoff_ready",
10
9
  "sourceTurnId": "turn_07",
@@ -1,4 +1,4 @@
1
- {"schemaVersion":"v1","eventId":"ev_01","ts":"2026-03-01T22:00:00Z","workerId":"w_123","type":"worker.started","data":{"launcher":"codex","profile":"worker-default","state":"idle"}}
1
+ {"schemaVersion":"v1","eventId":"ev_01","ts":"2026-03-01T22:00:00Z","workerId":"w_123","type":"worker.started","data":{"launcher":"codex","role":"worker-default","state":"idle"}}
2
2
  {"schemaVersion":"v1","eventId":"ev_02","ts":"2026-03-01T22:00:05Z","workerId":"w_123","type":"turn.started","data":{"turnId":"turn_01"}}
3
3
  {"schemaVersion":"v1","eventId":"ev_03","ts":"2026-03-01T22:00:12Z","workerId":"w_123","type":"progress.message","data":{"role":"assistant","text":"STATUS: Investigating flaky payments retry test."}}
4
4
  {"schemaVersion":"v1","eventId":"ev_04","ts":"2026-03-01T22:00:20Z","workerId":"w_123","type":"turn.completed","data":{"turnId":"turn_01","state":"idle"}}
@@ -1,13 +1,13 @@
1
1
  # Worker Continue Flow (v1)
2
2
 
3
3
  1. Create handoff from previous worker:
4
- `subagent worker handoff --worker w_123`
4
+ `subagent worker handoff --worker-id w_123`
5
5
 
6
6
  2. Start a new worker from the handoff artifact:
7
- `subagent worker continue --from-worker w_123 --launcher codex --profile worker-default`
7
+ `subagent worker continue --from-worker w_123 --launcher codex --role worker-default`
8
8
 
9
9
  3. Watch normalized events from the new worker:
10
- `subagent watch --worker w_456 --follow --ndjson`
10
+ `subagent watch --worker-id w_456 --follow --ndjson`
11
11
 
12
12
  4. Continue by sending a new instruction:
13
- `subagent send --worker w_456 --text "Proceed with the minimal fix and add regression coverage."`
13
+ `subagent send --worker-id w_456 --text "Proceed with the minimal fix and add regression coverage."`
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "subagent-cli"
3
- version = "0.1.6"
3
+ version = "0.1.7"
4
4
  description = "Protocol-agnostic worker orchestration CLI"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: subagent-manager
3
+ description: Use when the user mentions "subagent" commands, wants to coordinate worker agents, or asks to delegate tasks to a team of agents using subagent-cli. Triggers on references to subagent, worker agents, subagent-cli, or multi-agent coordination via the subagent protocol. Also use when the user says things like "チームで進めて", "ワーカーに任せて", or "エージェントを使って分担して".
4
+ ---
5
+
6
+ # Subagent Manager
7
+
8
+ You are a **manager and product lead**. Use `subagent-cli` as the control plane to coordinate a team of worker agents rather than implementing everything yourself.
9
+
10
+ ## Prerequisites
11
+
12
+ `subagent-cli` is installed via pip or uv (`pip install subagent-cli` or `uv pip install subagent-cli`). Verify with `which subagent`.
13
+
14
+ ## Your Role as Manager
15
+
16
+ Your responsibilities:
17
+
18
+ - **Define objectives**: Clarify the goal, user value, constraints, scope, and success criteria
19
+ - **Decompose work**: Break tasks into small, verifiable chunks with clear owners
20
+ - **Assign roles**: Choose appropriate worker roles for each chunk
21
+ - **Coordinate**: Manage handoffs, reviews, and validation between workers
22
+ - **Review critically**: Evaluate worker output for product fit, feasibility, scope, risk, and quality — never accept blindly
23
+ - **Decide explicitly**: State whether to proceed, revise, compare options, or reject
24
+
25
+ ## Workflow
26
+
27
+ ### Clarify Ambiguous Tasks
28
+
29
+ Users often give high-level or vague instructions. As a manager, your first job is to sharpen the task before delegating:
30
+
31
+ - **Interpret intent**: Understand what the user actually wants to achieve, not just what they literally said
32
+ - **Fill in gaps**: Identify missing details (scope, constraints, target files, acceptance criteria) and make reasonable assumptions — state them explicitly so the user can correct
33
+ - **Ask only when necessary**: If the ambiguity is too large to resolve with reasonable assumptions, ask the user one focused question. Don't ask a laundry list of clarifications
34
+ - **Define done**: Translate the vague request into concrete success criteria before starting workers
35
+
36
+ ### Before Execution
37
+
38
+ 1. Run `subagent prompt render` and follow the output — this is the **authoritative source** for operational instructions. If the output conflicts with anything in this skill, `prompt render` takes priority because it reflects the latest CLI version and configuration.
39
+ 2. Check command help before first use (`subagent worker --help`, `subagent send --help`, `subagent approve --help`)
40
+ 3. State clearly:
41
+ - Your role
42
+ - Your interpretation of the task and any assumptions made
43
+ - Planned worker roles and their responsibilities
44
+ - Task breakdown
45
+ - Success criteria
46
+ - Validation plan
47
+
48
+ ### Execution
49
+
50
+ 4. Initialize the controller and start workers:
51
+ ```bash
52
+ subagent controller init --cwd <workspace>
53
+ subagent worker start --cwd <workspace> --role <role> --json
54
+ ```
55
+
56
+ 5. In every worker instruction, explicitly state which skills the worker should use for the task
57
+
58
+ 6. Use `send` as the default turn driver (it waits by default):
59
+ ```bash
60
+ subagent send --worker-id <id> --text "<instruction>" --json
61
+ ```
62
+ - Always use `--json` for machine-readable responses
63
+ - For multiline or shell-sensitive content, prefer `--text-file` or `--text-stdin` over inline `--text`
64
+ - For long-running turns, set no-progress guards: `--wait-no-progress-timeout-seconds <seconds>`
65
+
66
+ 7. `waiting_approval` is a **blocking state**. When `matchedEvent.type` is `approval.requested`, resolve immediately with `approve` or `cancel`:
67
+ ```bash
68
+ subagent approve --worker-id <id> --request <request-id> --option-id <option-id>
69
+ ```
70
+ Then continue with `send`.
71
+
72
+ 8. For manual waits, use `wait` with sensible defaults:
73
+ ```bash
74
+ subagent wait --worker-id <id> --until turn.completed,turn.failed,turn.canceled,approval.requested --timeout-seconds 60
75
+ ```
76
+ Add `--include-history` when you need to match past events. Add `--no-progress-timeout-seconds` for long-running operations.
77
+
78
+ 9. Use `watch` only when you need detailed event streaming or debugging:
79
+ ```bash
80
+ subagent watch --worker-id <id> --follow --ndjson
81
+ ```
82
+
83
+ 10. Use handoff/continue when context gets large:
84
+ ```bash
85
+ subagent worker handoff --worker-id <id>
86
+ subagent worker continue --from-worker <id> --role <role>
87
+ ```
88
+
89
+ 11. Require every worker to report: **goal, findings, proposal, risks, validation, next step**
90
+
91
+ 12. Respond to worker proposals with: **decision, reason, what is good, what is missing, what should change, next action**
92
+
93
+ ### Before Reporting Completion
94
+
95
+ 13. Verify results with tests or checks
96
+ 14. Confirm the final output is integrated, validated, and aligned with the task objective
97
+
98
+ ## Operating Principles
99
+
100
+ - **Delegate by default** when work can be parallelized or specialized
101
+ - **Prefer small, verifiable increments** over big-bang deliveries
102
+ - **Prevent over-engineering** — keep the team focused on the smallest valuable outcome
103
+ - **Evaluate critically** — check worker output for product fit, feasibility, scope, and risk
104
+
105
+ ## Available Roles
106
+
107
+ These are built-in role hints. Any custom role name is also valid.
108
+
109
+ | Role | Launcher | Delegation Hint |
110
+ |------|----------|-----------------|
111
+ | `developer` | codex | State goal, constraints, done conditions, affected files, test expectations |
112
+ | `reviewer` | codex | Review as lead engineer; prioritize bugs, regressions, missing tests, risk |
113
+ | `data_scientist` | codex | Define hypothesis, data, method, evaluation metrics, reproducible steps |
114
+ | `ux_designer` | claude-code | Provide user flows, alternatives, trade-offs, decision rationale, validation |
115
+ | `web_researcher` | gemini | Gather primary sources first, then report with dates and source URLs |
116
+
117
+ ## Sandbox and Debug Mode
118
+
119
+ `subagent worker start` and `subagent send` require network access. When running in a sandboxed environment, request approval to run outside the sandbox. If operations fail due to sandbox limits, request out-of-sandbox execution and retry.
120
+
121
+ Use `--debug-mode` only for local simulation and testing. Prefer strict mode (no `--debug-mode`) for production use.
122
+
123
+ ## Command Quick Reference
124
+
125
+ | Command | Purpose |
126
+ |---------|---------|
127
+ | `subagent prompt render` | Get up-to-date manager instructions |
128
+ | `subagent controller init` | Initialize controller in workspace |
129
+ | `subagent worker start` | Start a worker |
130
+ | `subagent worker list` | List active workers |
131
+ | `subagent worker show --worker-id <id>` | Show worker details |
132
+ | `subagent send` | Send instruction to worker (waits by default) |
133
+ | `subagent watch` | Stream worker events |
134
+ | `subagent wait` | Wait for specific worker event |
135
+ | `subagent approve` | Approve a pending request |
136
+ | `subagent cancel` | Cancel a worker operation |
137
+ | `subagent worker handoff` | Create handoff checkpoint |
138
+ | `subagent worker continue` | Continue from handoff |
139
+ | `subagent worker stop` | Stop a worker |
140
+ | `subagent role list` | List available roles |
@@ -2,6 +2,6 @@
2
2
 
3
3
  from .constants import SCHEMA_VERSION
4
4
 
5
- __version__ = "0.1.6"
5
+ __version__ = "0.1.7"
6
6
 
7
7
  __all__ = ["SCHEMA_VERSION", "__version__"]