opencode-onboard 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +303 -289
- package/content/.agents/agents/basic-engineer.md +4 -2
- package/content/.agents/skills/ob-global/SKILL.md +35 -0
- package/content/.opencode/commands/init.md +8 -0
- package/content/.opencode/commands/main.md +17 -0
- package/content/.opencode/commands/opsx-apply.md +131 -70
- package/content/.opencode/commands/plan.md +37 -0
- package/content/.opencode/skills/openspec-apply-change/SKILL.md +86 -64
- package/content/AGENTS.md +48 -22
- package/package.json +1 -1
- package/src/commands/join.js +43 -0
- package/src/commands/shared.js +12 -0
- package/src/commands/shared.test.js +56 -0
- package/src/commands/single.js +66 -0
- package/src/commands/wizard.js +113 -0
- package/src/index.js +25 -168
- package/src/presets/source.json +7 -1
- package/src/steps/browser/browser.test.js +1 -1
- package/src/steps/copy/agents.js +28 -0
- package/src/steps/copy/copy.test.js +1 -0
- package/src/steps/copy/index.js +2 -1
- package/src/steps/metadata/index.js +1 -0
- package/src/steps/metadata/metadata.test.js +8 -5
- package/src/steps/models/format.test.js +8 -7
- package/src/steps/models/write.test.js +11 -13
- package/src/steps/openspec/ensemble.js +30 -7
- package/src/steps/optimization/optimization.test.js +20 -0
- package/src/steps/platform/platform.test.js +1 -1
- package/src/steps/source/index.js +48 -0
- package/src/steps/source/source.test.js +38 -3
- package/src/utils/models-pricing.test.js +0 -1
|
@@ -21,10 +21,12 @@ permission:
|
|
|
21
21
|
|
|
22
22
|
When spawned by the lead:
|
|
23
23
|
1. Call `team_tasks_list` and verify your assigned task IDs and status before starting.
|
|
24
|
-
2. For each assigned task
|
|
24
|
+
2. For each assigned task: before calling `team_claim task_id:<id>`, check `team_tasks_list` to confirm every dependency of that task has status `done`. If any dependency is not done, skip to the next assigned task that IS unblocked. Only claim tasks whose dependencies are fully complete.
|
|
25
25
|
3. Load `@ob-global` first, then load mandatory ability `Guardrails`.
|
|
26
26
|
4. Load additional abilities from the `## Abilities` section as needed for the claimed task domain (for example: development, testing, infrastructure). Each ability can include one or more skills; load all relevant skills listed under each selected ability.
|
|
27
27
|
5. Send a short `team_message` to lead confirming claimed task ID and loaded skills.
|
|
28
28
|
6. Implement the task following all loaded skill rules.
|
|
29
29
|
7. Call `team_tasks_complete task_id:<id>` after finishing that task.
|
|
30
|
-
8. Repeat until all assigned tasks are completed or blocked
|
|
30
|
+
8. Repeat until all currently assigned tasks are completed or blocked.
|
|
31
|
+
9. Message lead with results via `team_message`. Lead may assign more tasks, do NOT stop working or shut down until lead confirms no more tasks for you.
|
|
32
|
+
10. If lead sends new task IDs via `team_message`, treat them as new assignments and go back to step 2.
|
|
@@ -38,6 +38,41 @@ If multiple roots are generated, each root is an independent git repository. Bra
|
|
|
38
38
|
- Keep changes small and focused
|
|
39
39
|
- Ask for clarification if unclear
|
|
40
40
|
|
|
41
|
+
## Ensemble Task Board Rules
|
|
42
|
+
|
|
43
|
+
When working as a spawned agent in an ensemble team, these rules are mandatory:
|
|
44
|
+
|
|
45
|
+
**Claim-first execution:**
|
|
46
|
+
- Your FIRST tool call after loading skills MUST be `team_claim task_id:<id>`. The dashboard must show your active task immediately.
|
|
47
|
+
- Do NOT spend more than 2 tool calls reading/planning before writing code. Claim first, then explore only what's needed for that specific task.
|
|
48
|
+
|
|
49
|
+
**One task at a time:**
|
|
50
|
+
- Claim → implement → build/verify → commit → `team_tasks_complete` → claim next.
|
|
51
|
+
- NEVER hold multiple claimed tasks simultaneously.
|
|
52
|
+
- NEVER batch completions. Mark done immediately after each commit.
|
|
53
|
+
|
|
54
|
+
**Dependency check before claiming:**
|
|
55
|
+
- Before calling `team_claim task_id:<id>`, call `team_tasks_list` and verify every dependency of that task has status `done`.
|
|
56
|
+
- If any dependency is not `done`, do NOT claim that task. Scan the board for another assigned task whose dependencies ARE all done and claim that one instead.
|
|
57
|
+
- If no assigned task is unblocked, report blocked to lead and STOP. Do NOT poll, sleep, or loop waiting for a dependency.
|
|
58
|
+
|
|
59
|
+
**Commit cadence:**
|
|
60
|
+
- After each task passes build: `git add -A && git commit -m "feat: <short description>"`
|
|
61
|
+
- ONE task = ONE commit. No multi-task commits.
|
|
62
|
+
|
|
63
|
+
**Communication discipline:**
|
|
64
|
+
- NEVER message lead with "I'm reading" or "I'm planning". Only message when BATCH DONE or BLOCKED.
|
|
65
|
+
- When BATCH DONE: report number of tasks completed + commit count. Lead may assign more tasks, stay active until lead confirms no more.
|
|
66
|
+
- When BLOCKED: report which task, what's blocking, what you tried.
|
|
67
|
+
- NEVER ask lead for permission to proceed, skip, or reorder tasks. Task sequencing and dependency resolution are YOUR responsibility. Only message lead when BATCH DONE or genuinely BLOCKED (no unblocked tasks remain).
|
|
68
|
+
- When lead sends new task IDs via team_message, treat them as new assignments and continue working.
|
|
69
|
+
|
|
70
|
+
**Stall prevention:**
|
|
71
|
+
- If a build fails, fix it immediately (max 3 attempts). Then report blocker.
|
|
72
|
+
- If you don't understand a task, message lead asking for clarification. Do NOT guess.
|
|
73
|
+
- If a file you need doesn't exist yet (dependency on another agent), report as blocked, don't create stubs.
|
|
74
|
+
- NEVER use sleep loops or polling to wait for a dependency. Waiting is always a blocker: report it and stop.
|
|
75
|
+
|
|
41
76
|
## Token Optimization Rules
|
|
42
77
|
|
|
43
78
|
<!-- OB-RTK-START -->
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Initialize the project, runs the bootstrap sequence defined in AGENTS.md if not yet initialized.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Check if `AGENTS.md` is in bootstrap mode (contains `<!-- AGENTS-TEMPLATE-START -->`).
|
|
6
|
+
|
|
7
|
+
- If yes: run the full initialization sequence defined in `AGENTS.md` now.
|
|
8
|
+
- If no: tell the user the project is already initialized.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Quick direct implementation, no OpenSpec, no ensemble, no PRs. Just do it.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Implement the task described after `/main` directly and immediately.
|
|
6
|
+
|
|
7
|
+
**Rules:**
|
|
8
|
+
- No OpenSpec artifacts (no proposal, no specs, no tasks.md)
|
|
9
|
+
- No ensemble team (no team_create, no team_spawn)
|
|
10
|
+
- No branches, no PRs
|
|
11
|
+
- Work directly in the current branch
|
|
12
|
+
- Keep changes minimal and focused on exactly what was asked
|
|
13
|
+
- Use Read/Glob/Grep to locate relevant files before editing
|
|
14
|
+
- After editing, run `pnpm run typecheck` to catch type errors; fix any that are caused by your changes
|
|
15
|
+
- Do NOT run lint or tests unless the user asks
|
|
16
|
+
|
|
17
|
+
**Input**: Everything after `/main` is the task. Execute it now.
|
|
@@ -86,79 +86,134 @@ Implement tasks from an OpenSpec change using the ensemble agent team.
|
|
|
86
86
|
DO NOT call team_claim yourself, only agents claim tasks.
|
|
87
87
|
DO NOT proceed to 6d until team_tasks_add succeeds.
|
|
88
88
|
|
|
89
|
-
**Step 6d.** Discover available agents, assign
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
89
|
+
**Step 6d.** Discover available agents, assign an INITIAL BATCH of tasks, then spawn workers.
|
|
90
|
+
|
|
91
|
+
**CONCURRENCY LIMIT: Maximum {{MAX_CONCURRENT_AGENTS}} truly concurrent agents at a time.**
|
|
92
|
+
All agents in a wave MUST be spawned and running simultaneously, not one-at-a-time sequentially.
|
|
93
|
+
|
|
94
|
+
**ROLLING BATCH MODEL:**
|
|
95
|
+
Agents do NOT receive all their tasks upfront. Instead:
|
|
96
|
+
- Assign each agent an initial batch of up to 3 tasks (respecting dependencies).
|
|
97
|
+
- When an agent completes its batch and messages back, the lead assigns the next batch of up to 3 unassigned tasks from the board that match the agent's domain.
|
|
98
|
+
- Repeat until no pending tasks remain on the board.
|
|
99
|
+
- Only shut down an agent when the board has no more tasks for its domain.
|
|
100
|
+
|
|
101
|
+
This prevents agents from idling after one task, avoids overloading spawn prompts, and lets the lead adapt assignments based on progress.
|
|
102
|
+
|
|
103
|
+
**FILE DOMAIN SEPARATION (mandatory):**
|
|
104
|
+
Each agent MUST own a non-overlapping set of files/directories. Examples:
|
|
105
|
+
- Agent A owns `src/backend/Application/Commands/`, Agent B owns `src/backend/Application/Queries/`
|
|
106
|
+
- Agent A owns `src/frontend/app/(auth)/events/`, Agent B owns `src/frontend/app/(auth)/admin/`
|
|
107
|
+
Never assign two agents tasks that touch the same file or controller.
|
|
108
|
+
|
|
109
|
+
Agent discovery and assignment rule:
|
|
110
|
+
- Read `.agents/agents/*.md` and use each agent's `description` and `## Abilities` to understand specialization.
|
|
111
|
+
- For each task ID, choose the best-fit agent based on task domain (backend, frontend, infra, testing, etc.).
|
|
112
|
+
- Prefer specialized agents when available; use `basic-engineer` as fallback only.
|
|
113
|
+
- Only spawn agents that have assigned task IDs.
|
|
114
|
+
|
|
115
|
+
REQUIRED assignment algorithm (do not skip):
|
|
116
|
+
1. Build candidate list from `.agents/agents/*.md` excluding `devops-manager`.
|
|
117
|
+
2. Classify each task by domain using task text (api/backend, ui/frontend, infra/devops, testing/qa).
|
|
118
|
+
3. For each task, score every candidate agent:
|
|
119
|
+
- +3 if agent description explicitly matches domain
|
|
120
|
+
- +2 if agent `## Abilities` include domain-relevant skills
|
|
121
|
+
- +1 if prior tasks of same domain already assigned to that agent (cohesion)
|
|
122
|
+
4. Assign task to highest-score agent.
|
|
123
|
+
5. Use `basic-engineer` ONLY when no specialized agent has positive score.
|
|
124
|
+
6. If all tasks go to `basic-engineer`, you MUST explain why no specialist matched.
|
|
125
|
+
|
|
126
|
+
HARD RULES:
|
|
127
|
+
- NEVER assign a task to `basic-engineer` if a specialized agent has higher score.
|
|
128
|
+
- NEVER skip agent discovery from `.agents/agents/*.md`.
|
|
129
|
+
- ALWAYS include assignment rationale in spawn prompt: "Selected because <domain match>".
|
|
130
|
+
|
|
131
|
+
Skill loading is worker-driven:
|
|
132
|
+
- The spawned agent MUST load `@ob-global` first.
|
|
133
|
+
- Then it MUST load skills from its own `## Abilities` for the claimed task domain.
|
|
134
|
+
|
|
135
|
+
Each team_spawn MUST include the agent field (required, causes NOT NULL error if omitted).
|
|
136
|
+
|
|
137
|
+
**Spawn prompt format (strict, max 400 tokens):**
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
You are {name}, {role}. Your file domain: {list of directories you own exclusively}.
|
|
141
|
+
|
|
142
|
+
Initial tasks (claim each with team_claim before starting, team_tasks_complete after commit):
|
|
143
|
+
- {task_id_1}: {one-line description}
|
|
144
|
+
- {task_id_2}: {one-line description}
|
|
145
|
+
- {task_id_3}: {one-line description}
|
|
146
|
+
|
|
147
|
+
Context: {2-3 sentences of essential context from the specs, NOT full file contents}
|
|
148
|
+
|
|
149
|
+
Build command: {e.g., "dotnet build TechEvents.slnx" or "pnpm build"}
|
|
150
|
+
After each task: git add -A && git commit -m "feat: <description>"
|
|
151
|
+
|
|
152
|
+
IMPORTANT: After completing all tasks above, message lead with results.
|
|
153
|
+
Lead may assign you more tasks. Do NOT shut down until lead confirms no more tasks.
|
|
154
|
+
Start with team_claim on your first task NOW. Do not read files or plan first.
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
DO NOT include:
|
|
158
|
+
- Full file contents or code snippets in the prompt
|
|
159
|
+
- Descriptions of how ensemble works
|
|
160
|
+
- Lists of available tools (the agent already knows from its agent.md)
|
|
161
|
+
- Instructions to "message lead when planning", agents should only message when DONE or BLOCKED
|
|
162
|
+
|
|
163
|
+
Spawn workers:
|
|
164
|
+
```
|
|
165
|
+
team_spawn name:"eng-1" agent:"backend-engineer" prompt:"..."
|
|
166
|
+
team_spawn name:"eng-2" agent:"frontend-engineer" prompt:"..."
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Then immediately send each spawned worker a start message:
|
|
170
|
+
```
|
|
171
|
+
team_message to:"eng-1" text:"Start now. First action: team_claim {first_task_id}. Go."
|
|
172
|
+
team_message to:"eng-2" text:"Start now. First action: team_claim {first_task_id}. Go."
|
|
173
|
+
```
|
|
145
174
|
|
|
146
175
|
**Step 6e.** After sending start messages, tell the user what is running, then STOP and wait.
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
176
|
+
Do NOT call team_results, team_status, or team_broadcast in a loop.
|
|
177
|
+
Teammates will message you when done or blocked. Wait for those messages.
|
|
178
|
+
|
|
179
|
+
Tell the user: "Agents spawned. Check dashboard at http://localhost:4747/. I'll report when they finish."
|
|
180
|
+
|
|
181
|
+
**Step 6f.** When a teammate messages back (rolling re-assignment loop):
|
|
182
|
+
1. Call `team_results from:"<name>"` to read full message.
|
|
183
|
+
2. Call `team_tasks_list` to check remaining pending/unassigned tasks on the board.
|
|
184
|
+
3. **If there are more unassigned tasks matching this agent's domain:**
|
|
185
|
+
- Pick up to 3 unassigned, unblocked tasks for this agent's domain.
|
|
186
|
+
- Send them via `team_message to:"<name>" text:"Next tasks: [task-<id1>] <desc>, [task-<id2>] <desc>, [task-<id3>] <desc>. Claim each with team_claim before starting."`
|
|
187
|
+
- Do NOT shut down the agent. Go back to waiting (step 6e).
|
|
188
|
+
4. **If no more tasks for this agent:**
|
|
189
|
+
- `team_shutdown member:"<name>"`
|
|
190
|
+
- `team_merge member:"<name>"`
|
|
191
|
+
- If team_merge blocks on local changes: `git stash`, retry merge, `git stash pop`
|
|
192
|
+
5. **If ALL agents are shut down and tasks remain unassigned** (new domain, dependencies unblocked):
|
|
193
|
+
- Spawn new agents for the remaining tasks (back to step 6d).
|
|
194
|
+
6. **If ALL tasks are done:** proceed to step 7.
|
|
195
|
+
|
|
196
|
+
**IMMEDIATE SHUTDOWN RULE:** Never leave a finished agent running when there are no more tasks for it. But DO keep agents alive if more tasks in their domain are pending.
|
|
197
|
+
|
|
198
|
+
**ZERO PENDING TASKS GUARANTEE:** Before proceeding to step 7, call `team_tasks_list` and verify EVERY task is either `done` or `blocked`. If any task is `pending` and unassigned, assign it to an agent or spawn a new one. Never leave pending tasks orphaned.
|
|
199
|
+
|
|
200
|
+
**Step 6g. Stall detection (if agent has no commits after 5 minutes):**
|
|
201
|
+
1. `team_message to:"<name>" text:"Status? If stuck, report blocker. If not started, run team_claim {task_id} now."`
|
|
202
|
+
2. Wait 2 more minutes
|
|
203
|
+
3. If still no response: `team_shutdown member:"<name>" force:true`
|
|
204
|
+
4. Respawn with same tasks, fresh prompt
|
|
205
|
+
5. Log stall in session-log for post-mortem
|
|
154
206
|
|
|
155
207
|
7. **Verification check**
|
|
156
208
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
209
|
+
After ALL agents are merged, run verification on the lead branch directly:
|
|
210
|
+
```bash
|
|
211
|
+
# Backend
|
|
212
|
+
dotnet build <solution>
|
|
213
|
+
# Frontend
|
|
214
|
+
pnpm build
|
|
215
|
+
```
|
|
216
|
+
Fix any errors yourself (small fixes only). If large fixes needed, spawn one more agent.
|
|
162
217
|
|
|
163
218
|
8. **Mark tasks complete in openspec**
|
|
164
219
|
|
|
@@ -183,12 +238,18 @@ Implement tasks from an OpenSpec change using the ensemble agent team.
|
|
|
183
238
|
- NEVER call team_spawn before team_tasks_add, tasks must exist before agents are spawned
|
|
184
239
|
- NEVER poll team_results or team_status in a loop, wait for teammates to message you
|
|
185
240
|
- NEVER call team_claim or team_tasks_complete as lead, only agents call these tools
|
|
186
|
-
- ALWAYS pass the task IDs returned by team_tasks_add to each agent's spawn prompt
|
|
187
241
|
- NEVER edit files between team_spawn and team_merge, team_merge blocks on overlapping local changes
|
|
242
|
+
- NEVER leave pending tasks orphaned, always verify board is empty before proceeding to step 7
|
|
188
243
|
- ALWAYS add every task to the board with team_tasks_add before spawning
|
|
244
|
+
- ALWAYS assign initial batch of up to 3 tasks per agent in spawn prompt
|
|
245
|
+
- ALWAYS re-assign next batch (up to 3) via team_message when agent reports done, if more tasks exist for its domain
|
|
246
|
+
- ALWAYS call team_tasks_list after each agent reports done to check for remaining unassigned tasks
|
|
189
247
|
- ALWAYS spawn workers based on dependencies: parallel when safe, sequential when required
|
|
190
248
|
- ALWAYS instruct agents to call team_claim before each task and team_tasks_complete after
|
|
191
|
-
-
|
|
249
|
+
- ALWAYS enforce max {{MAX_CONCURRENT_AGENTS}} truly concurrent agents (all running simultaneously, not sequentially)
|
|
250
|
+
- ALWAYS enforce non-overlapping file domains per agent
|
|
251
|
+
- ALWAYS shut down + merge agents only when no more tasks remain for their domain
|
|
252
|
+
- If teammates are stuck, use team_message to nudge, then stall detection (step 6g)
|
|
192
253
|
- Mark tasks complete in openspec AFTER worker implementation and verification finish, not before
|
|
193
254
|
- Pause on errors, blockers, or unclear requirements. Do not guess
|
|
194
255
|
- Use contextFiles from CLI output, do not assume specific file paths
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Parse a user story URL and produce a plan, proposal, specs, and tasks. Stops before implementation.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Parse the work item at the URL provided after `/plan` and produce a full implementation plan.
|
|
6
|
+
|
|
7
|
+
**Input**: A GitHub Issue URL or Azure DevOps work item URL. Example: `/plan https://github.com/org/repo/issues/42`
|
|
8
|
+
|
|
9
|
+
**Steps:**
|
|
10
|
+
|
|
11
|
+
1. **Load baseline**
|
|
12
|
+
|
|
13
|
+
Load `@ob-global` first.
|
|
14
|
+
|
|
15
|
+
2. **Detect URL type and load matching skill**
|
|
16
|
+
|
|
17
|
+
- GitHub Issue URL → load `ob-userstory-gh` skill
|
|
18
|
+
- Azure DevOps URL → load `ob-userstory-az` skill
|
|
19
|
+
|
|
20
|
+
Follow the skill steps exactly: fetch the issue/work item via CLI and create an OpenSpec change.
|
|
21
|
+
|
|
22
|
+
3. **Propose**
|
|
23
|
+
|
|
24
|
+
Run `/opsx-propose` to generate `proposal.md`, specs, and `tasks.md`.
|
|
25
|
+
|
|
26
|
+
4. **Show the plan**
|
|
27
|
+
|
|
28
|
+
Display:
|
|
29
|
+
- Change name
|
|
30
|
+
- Total number of tasks
|
|
31
|
+
- Full task list summary
|
|
32
|
+
|
|
33
|
+
5. **Stop**
|
|
34
|
+
|
|
35
|
+
Ask the user: "Ready to implement? Type `/opsx-apply` to start."
|
|
36
|
+
|
|
37
|
+
Do NOT proceed to implementation. Do NOT run `/opsx-apply` automatically.
|
|
@@ -92,71 +92,90 @@ Implement tasks from an OpenSpec change using the ensemble agent team.
|
|
|
92
92
|
DO NOT call team_claim yourself, only agents claim tasks.
|
|
93
93
|
DO NOT proceed to 6d until team_tasks_add succeeds.
|
|
94
94
|
|
|
95
|
-
**Step 6d.** Discover available agents, assign
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
95
|
+
**Step 6d.** Discover available agents, assign an INITIAL BATCH of tasks, then spawn workers.
|
|
96
|
+
|
|
97
|
+
**ROLLING BATCH MODEL:**
|
|
98
|
+
Agents do NOT receive all their tasks upfront. Instead:
|
|
99
|
+
- Assign each agent an initial batch of up to 3 unblocked tasks.
|
|
100
|
+
- When an agent completes its batch and messages back, the lead assigns the next batch of up to 3 unassigned tasks from the board that match the agent's domain.
|
|
101
|
+
- Repeat until no pending tasks remain on the board.
|
|
102
|
+
- Only shut down an agent when the board has no more tasks for its domain.
|
|
103
|
+
|
|
104
|
+
Agent discovery and assignment rule:
|
|
105
|
+
- Read `.agents/agents/*.md` and use each agent's `description` and `## Abilities` to understand specialization.
|
|
106
|
+
- For each task ID, choose the best-fit agent based on task domain (backend, frontend, infra, testing, etc.).
|
|
107
|
+
- Prefer specialized agents when available; use `basic-engineer` as fallback only.
|
|
108
|
+
- Only spawn agents that have assigned task IDs.
|
|
109
|
+
|
|
110
|
+
REQUIRED assignment algorithm (do not skip):
|
|
111
|
+
1. Build candidate list from `.agents/agents/*.md` excluding `devops-manager`.
|
|
112
|
+
2. Classify each task by domain using task text (api/backend, ui/frontend, infra/devops, testing/qa).
|
|
113
|
+
3. For each task, score every candidate agent:
|
|
114
|
+
- +3 if agent description explicitly matches domain
|
|
115
|
+
- +2 if agent `## Abilities` include domain-relevant skills
|
|
116
|
+
- +1 if prior tasks of same domain already assigned to that agent (cohesion)
|
|
117
|
+
4. Assign task to highest-score agent.
|
|
118
|
+
5. Use `basic-engineer` ONLY when no specialized agent has positive score.
|
|
119
|
+
6. If all tasks go to `basic-engineer`, you MUST explain why no specialist matched.
|
|
120
|
+
|
|
121
|
+
HARD RULES:
|
|
122
|
+
- NEVER assign a task to `basic-engineer` if a specialized agent has higher score.
|
|
123
|
+
- NEVER skip agent discovery from `.agents/agents/*.md`.
|
|
124
|
+
- ALWAYS include assignment rationale in spawn prompt: "Selected because <domain match>".
|
|
125
|
+
|
|
126
|
+
Skill loading is worker-driven:
|
|
127
|
+
- The spawned agent MUST load `@ob-global` first.
|
|
128
|
+
- Then it MUST load skills from its own `## Abilities` for the claimed task domain.
|
|
129
|
+
|
|
130
|
+
Each team_spawn MUST include the agent field (required, causes NOT NULL error if omitted).
|
|
131
|
+
|
|
132
|
+
The spawn prompt must contain exactly:
|
|
133
|
+
1. Their name and role on this team
|
|
134
|
+
1.1 Why they were selected for those tasks (domain/abilities match)
|
|
135
|
+
2. Their initial batch of tasks (up to 3): list the LITERAL task IDs and content from the board.
|
|
136
|
+
3. Key context they need (summarized from context files, do NOT tell them to read files themselves)
|
|
137
|
+
4. The 6 OpenCode tools they have available (these are OpenCode tools, NOT shell commands, call them directly as tools, never via bash):
|
|
138
|
+
team_claim, team_tasks_complete, team_tasks_list, team_tasks_add, team_message, team_broadcast
|
|
139
|
+
5. How to proceed: call team_claim tool with the task_id to claim a task before starting it, call team_tasks_complete tool after finishing it, repeat until all listed tasks are done, then call team_message tool to notify lead with results. Lead may assign more tasks, do NOT shut down until lead confirms no more tasks.
|
|
140
|
+
6. Which skills to load: list the skill names and paths they MUST read before implementing. Example: "Before starting, read `.agents/skills/next-best-practices/SKILL.md` and follow its rules for all Next.js code."
|
|
141
|
+
|
|
142
|
+
Keep spawn prompts under 600 tokens. Do not describe team internals or how ensemble works.
|
|
143
|
+
Only spawn agents whose tasks are actually needed by this change. Skip agents with no tasks.
|
|
144
|
+
|
|
145
|
+
Spawn one or more best-fit workers (parallel when dependencies allow):
|
|
146
|
+
```
|
|
147
|
+
team_spawn name:"eng-1" agent:"backend-engineer" prompt:"..."
|
|
148
|
+
team_spawn name:"eng-2" agent:"frontend-engineer" prompt:"..."
|
|
149
|
+
team_spawn name:"eng-3" agent:"basic-engineer" prompt:"..."
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Then immediately send each spawned worker a start message with exact task IDs:
|
|
153
|
+
```
|
|
154
|
+
team_message to:"eng-1" text:"Start now. Load @ob-global first, then use your agent `## Abilities` for these tasks: [task-<id1>] ... Claim each task ID before starting."
|
|
155
|
+
team_message to:"eng-2" text:"Start now. Load @ob-global first, then use your agent `## Abilities` for these tasks: [task-<id2>] ... Claim each task ID before starting."
|
|
156
|
+
team_message to:"eng-3" text:"Start now. Load @ob-global first, then use your agent `## Abilities` for these tasks: [task-<id3>] ... Claim each task ID before starting."
|
|
157
|
+
```
|
|
151
158
|
|
|
152
159
|
**Step 6e.** After sending start messages, tell the user what is running, then STOP and wait.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
**Step 6f.** When a teammate messages back
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
+
Do NOT call team_results, team_status, or team_broadcast in a loop.
|
|
161
|
+
Teammates will message you when done or blocked. Wait for those messages.
|
|
162
|
+
|
|
163
|
+
**Step 6f.** When a teammate messages back (rolling re-assignment loop):
|
|
164
|
+
1. Call `team_results from:"<name>"` to read full message.
|
|
165
|
+
2. Call `team_tasks_list` to check remaining pending/unassigned tasks on the board.
|
|
166
|
+
3. **If there are more unassigned tasks matching this agent's domain:**
|
|
167
|
+
- Pick up to 3 unassigned, unblocked tasks for this agent's domain.
|
|
168
|
+
- Send them via `team_message to:"<name>" text:"Next tasks: [task-<id1>] <desc>, [task-<id2>] <desc>. Claim each with team_claim before starting."`
|
|
169
|
+
- Do NOT shut down the agent. Go back to waiting (step 6e).
|
|
170
|
+
4. **If no more tasks for this agent:**
|
|
171
|
+
- `team_shutdown member:"<name>"`
|
|
172
|
+
- `team_merge member:"<name>"`
|
|
173
|
+
- If team_merge blocks on local changes: `git stash`, retry merge, `git stash pop`.
|
|
174
|
+
5. **If ALL agents are shut down and tasks remain unassigned:**
|
|
175
|
+
- Spawn new agents for the remaining tasks (back to step 6d).
|
|
176
|
+
6. **If ALL tasks are done:** proceed to step 7.
|
|
177
|
+
|
|
178
|
+
**ZERO PENDING TASKS GUARANTEE:** Before proceeding to step 7, call `team_tasks_list` and verify EVERY task is either `done` or `blocked`. If any task is `pending` and unassigned, assign it to an agent or spawn a new one. Never leave pending tasks orphaned.
|
|
160
179
|
|
|
161
180
|
7. **Verification check**
|
|
162
181
|
|
|
@@ -189,11 +208,14 @@ Implement tasks from an OpenSpec change using the ensemble agent team.
|
|
|
189
208
|
- NEVER call team_spawn before team_tasks_add, tasks must exist before agents are spawned
|
|
190
209
|
- NEVER poll team_results or team_status in a loop, wait for teammates to message you
|
|
191
210
|
- NEVER call team_claim or team_tasks_complete as lead, only agents call these tools
|
|
192
|
-
-
|
|
211
|
+
- NEVER leave pending tasks orphaned, always verify board is empty before proceeding to step 7
|
|
212
|
+
- ALWAYS assign initial batch of up to 3 tasks per agent; re-assign next batch (up to 3) via team_message when agent reports done
|
|
213
|
+
- ALWAYS call team_tasks_list after each agent reports done to check for remaining unassigned tasks
|
|
193
214
|
- NEVER edit files between team_spawn and team_merge, team_merge blocks on overlapping local changes
|
|
194
215
|
- ALWAYS add every task to the board with team_tasks_add before spawning
|
|
195
216
|
- ALWAYS spawn workers based on dependencies: parallel when safe, sequential when required
|
|
196
217
|
- ALWAYS instruct agents to call team_claim before each task and team_tasks_complete after
|
|
218
|
+
- ALWAYS shut down + merge agents only when no more tasks remain for their domain
|
|
197
219
|
- If teammates are stuck, use team_message to resend tasks, then wait, never implement directly
|
|
198
220
|
- Mark tasks complete in openspec AFTER worker implementation and verification finish, not before
|
|
199
221
|
- Pause on errors, blockers, or unclear requirements. Do not guess
|