opencode-dispatcher 0.3.1 → 0.3.2
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/README.md +33 -528
- package/package.json +1 -1
- package/workflow/agents/model-config.md +7 -1
package/README.md
CHANGED
|
@@ -1,358 +1,8 @@
|
|
|
1
1
|
# OpenCode Dispatcher
|
|
2
2
|
|
|
3
|
-
OpenCode Dispatcher is a workflow pack for OpenCode that adds specialist development agents coordinated through file-based task artifacts.
|
|
3
|
+
OpenCode Dispatcher is a workflow pack for OpenCode that adds specialist development agents coordinated through file-based task artifacts. It is designed for substantial coding work where you want the agent workflow to be easier to inspect, resume, and validate.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Instead of relying on long chat history, Dispatcher keeps durable task state in your project:
|
|
8
|
-
|
|
9
|
-
```text
|
|
10
|
-
.ai/context.md
|
|
11
|
-
.ai/tasks/<NNN>-<task-id>/task-spec.md
|
|
12
|
-
.ai/tasks/<NNN>-<task-id>/implementation-report.md
|
|
13
|
-
.ai/tasks/<NNN>-<task-id>/validation-report.md
|
|
14
|
-
.ai/tasks/<NNN>-<task-id>/documentation-report.md
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
For tiny one-off edits or quick questions, plain OpenCode is often enough.
|
|
18
|
-
|
|
19
|
-
## What Dispatcher Changes
|
|
20
|
-
|
|
21
|
-
Plain OpenCode is usually a general-purpose agent workflow.
|
|
22
|
-
|
|
23
|
-
OpenCode Dispatcher adds a user-facing orchestrator and a set of specialist agents. The orchestrator talks with you, clarifies the request, decides how complex the work is, and routes to the smallest safe workflow.
|
|
24
|
-
|
|
25
|
-
Not every agent runs every time.
|
|
26
|
-
|
|
27
|
-
```mermaid
|
|
28
|
-
flowchart TD
|
|
29
|
-
User[User] --> Orchestrator[Orchestrator]
|
|
30
|
-
|
|
31
|
-
Orchestrator -->|Question or review| Direct[Direct answer]
|
|
32
|
-
Orchestrator -->|Exact mechanical edit| Executor[Executor]
|
|
33
|
-
Orchestrator -->|Substantial task| Planner[Task Planner]
|
|
34
|
-
Orchestrator -->|External facts needed| Research[Research]
|
|
35
|
-
Orchestrator -->|Commit or push requested| Shipper[Shipper]
|
|
36
|
-
|
|
37
|
-
Research --> Orchestrator
|
|
38
|
-
Executor --> Orchestrator
|
|
39
|
-
|
|
40
|
-
Planner --> Spec[Task Spec]
|
|
41
|
-
Spec --> TestWriter{Test-first useful?}
|
|
42
|
-
TestWriter -->|Yes| Tests[Test Writer]
|
|
43
|
-
TestWriter -->|No| Implementer[Implementer]
|
|
44
|
-
Tests --> Implementer
|
|
45
|
-
Implementer --> Validator[Validator]
|
|
46
|
-
Validator --> Orchestrator
|
|
47
|
-
|
|
48
|
-
Shipper --> Orchestrator
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
The chat is used for coordination. The `.ai/` files become the source of truth for scoped work.
|
|
52
|
-
|
|
53
|
-
## Why Use It?
|
|
54
|
-
|
|
55
|
-
Dispatcher is useful when you want agent work to be:
|
|
56
|
-
|
|
57
|
-
* easier to inspect
|
|
58
|
-
* easier to resume later
|
|
59
|
-
* easier to validate against an approved scope
|
|
60
|
-
* less dependent on chat history
|
|
61
|
-
* separated by role boundaries
|
|
62
|
-
* safer for multi-step development work
|
|
63
|
-
* more suitable for git-tracked project artifacts
|
|
64
|
-
|
|
65
|
-
It helps answer questions like:
|
|
66
|
-
|
|
67
|
-
* What exactly was the agent asked to build?
|
|
68
|
-
* What files were relevant?
|
|
69
|
-
* What was explicitly out of scope?
|
|
70
|
-
* What tests or checks were expected?
|
|
71
|
-
* What did the implementer change?
|
|
72
|
-
* Did the validator check the result against the approved task?
|
|
73
|
-
|
|
74
|
-
## Compared to Plain OpenCode
|
|
75
|
-
|
|
76
|
-
| Dimension | Plain OpenCode | OpenCode Dispatcher |
|
|
77
|
-
| ------------ | --------------------------------- | --------------------------------------------- |
|
|
78
|
-
| Task scope | Usually carried in chat history | Stored in `.ai/tasks/<NNN>-<id>/task-spec.md` |
|
|
79
|
-
| Agent model | General-purpose agent | Specialist agents with role boundaries |
|
|
80
|
-
| Validation | Often implicit | Explicit validation against the task spec |
|
|
81
|
-
| Resumability | Requires reading chat history | Read the task spec and reports |
|
|
82
|
-
| Audit trail | Chat log | Git-trackable `.ai/` artifacts |
|
|
83
|
-
| Best for | Quick edits and one-off questions | Substantial features and multi-step work |
|
|
84
|
-
|
|
85
|
-
## Core Idea
|
|
86
|
-
|
|
87
|
-
Dispatcher separates live conversation from durable project state.
|
|
88
|
-
|
|
89
|
-
```mermaid
|
|
90
|
-
flowchart LR
|
|
91
|
-
Chat[Live chat] -->|Clarify and coordinate| Orchestrator[Orchestrator]
|
|
92
|
-
Orchestrator -->|Writes durable scope through agents| Artifacts[.ai task artifacts]
|
|
93
|
-
Artifacts --> Spec[task-spec.md]
|
|
94
|
-
Artifacts --> Reports[implementation / validation / documentation reports]
|
|
95
|
-
Artifacts --> Context[context.md]
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
The orchestrator stays user-facing. Specialist agents do the scoped work.
|
|
99
|
-
|
|
100
|
-
## Workflow Layers
|
|
101
|
-
|
|
102
|
-
Dispatcher installs several agents, but they are grouped by when they are used.
|
|
103
|
-
|
|
104
|
-
### Always Active
|
|
105
|
-
|
|
106
|
-
| Agent | Role | Used When |
|
|
107
|
-
| ------------ | ------------------------------------------------ | ------------- |
|
|
108
|
-
| Orchestrator | User-facing coordinator and state-machine router | Always active |
|
|
109
|
-
|
|
110
|
-
The orchestrator is the main entry point. It talks with you, clarifies the request, decides whether work is simple or substantial, delegates to the right specialist, and summarizes results.
|
|
111
|
-
|
|
112
|
-
### Fast Path
|
|
113
|
-
|
|
114
|
-
| Agent | Role | Used When |
|
|
115
|
-
| -------- | -------------------------------------- | --------------------------------------- |
|
|
116
|
-
| Executor | Performs exact, mechanical, low-risk edits | For edits where a task spec would not improve safety |
|
|
117
|
-
|
|
118
|
-
The executor is used when the edit is exact, mechanical, and low-risk — a task spec would not improve safety.
|
|
119
|
-
|
|
120
|
-
Example:
|
|
121
|
-
|
|
122
|
-
```text
|
|
123
|
-
Change the button label in src/components/SubmitButton.tsx from "Submit" to "Save".
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
If the edit turns out to need multiple files, a new pattern, a dependency, or an architecture decision, the orchestrator escalates the work into the full task workflow.
|
|
127
|
-
|
|
128
|
-
### Full Task Workflow
|
|
129
|
-
|
|
130
|
-
| Agent | Role | Used When |
|
|
131
|
-
| ------------ | ---------------------------------------------------- | --------------------------------- |
|
|
132
|
-
| Task Planner | Creates task specs and decomposes multi-unit work | Before substantial implementation |
|
|
133
|
-
| Implementer | Edits source code according to an approved task spec | After planning |
|
|
134
|
-
| Validator | Checks completed work against the task spec | After non-trivial implementation |
|
|
135
|
-
|
|
136
|
-
This is the main route for substantial development work.
|
|
137
|
-
|
|
138
|
-
```mermaid
|
|
139
|
-
sequenceDiagram
|
|
140
|
-
participant U as User
|
|
141
|
-
participant O as Orchestrator
|
|
142
|
-
participant P as Task Planner
|
|
143
|
-
participant I as Implementer
|
|
144
|
-
participant V as Validator
|
|
145
|
-
|
|
146
|
-
U->>O: Describe feature or fix
|
|
147
|
-
O->>U: Clarify scope if needed
|
|
148
|
-
O->>P: Create task spec
|
|
149
|
-
P-->>O: task-spec.md
|
|
150
|
-
O->>I: Implement approved spec
|
|
151
|
-
I-->>O: implementation-report.md
|
|
152
|
-
O->>V: Validate against task spec
|
|
153
|
-
V-->>O: validation-report.md
|
|
154
|
-
O-->>U: Summary and next step
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
The task planner creates the approved scope:
|
|
158
|
-
|
|
159
|
-
```text
|
|
160
|
-
.ai/tasks/<NNN>-<task-id>/task-spec.md
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
The implementer makes the smallest correct change according to that scope.
|
|
164
|
-
|
|
165
|
-
The validator checks the completed work against the approved scope and writes:
|
|
166
|
-
|
|
167
|
-
```text
|
|
168
|
-
.ai/tasks/<NNN>-<task-id>/validation-report.md
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### Conditional Agents
|
|
172
|
-
|
|
173
|
-
| Agent | Role | Used When |
|
|
174
|
-
| ------------- | ----------------------------------------------------------- | ------------------------------------- |
|
|
175
|
-
| Test Writer | Writes tests from testable acceptance criteria | When a test-first flow is useful |
|
|
176
|
-
| Documentation | Updates docs, context, decisions, and documentation reports | When documentation work is needed |
|
|
177
|
-
| Research | Gathers external facts, comparisons, and best practices | When source-backed evidence is needed |
|
|
178
|
-
|
|
179
|
-
These agents are not part of every task.
|
|
180
|
-
|
|
181
|
-
The test writer is used when the task has clear testable acceptance criteria and writing tests first would improve correctness.
|
|
182
|
-
|
|
183
|
-
The documentation agent is used when the task needs README updates, project context updates, decision notes, changelog entries, or documentation reports.
|
|
184
|
-
|
|
185
|
-
The research agent is used when a decision depends on external facts such as official documentation, vendor behaviour, pricing, APIs, or current best practices.
|
|
186
|
-
|
|
187
|
-
### Bootstrap, Configuration, and Shipping
|
|
188
|
-
|
|
189
|
-
| Agent | Role | Used When |
|
|
190
|
-
| ------------ | --------------------------------------------------- | ---------------------------------------------- |
|
|
191
|
-
| Init | Bootstraps `.ai/context.md` | First use in a project |
|
|
192
|
-
| Model Config | Assigns models to specific agents in project config | When per-agent model overrides are needed |
|
|
193
|
-
| Shipper | Handles git commit and push only | When explicitly requested |
|
|
194
|
-
|
|
195
|
-
The init agent is used when a project does not yet have `.ai/context.md`.
|
|
196
|
-
|
|
197
|
-
The model config agent configures per-agent models in `opencode.jsonc`.
|
|
198
|
-
|
|
199
|
-
The shipper is never used automatically. It only commits or pushes when you explicitly ask for git shipping work.
|
|
200
|
-
|
|
201
|
-
## Common Routes
|
|
202
|
-
|
|
203
|
-
### Ask a Question
|
|
204
|
-
|
|
205
|
-
```mermaid
|
|
206
|
-
flowchart LR
|
|
207
|
-
User --> Orchestrator --> Answer[Direct answer]
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
Used for explanations, reviews, comparisons, and planning advice.
|
|
211
|
-
|
|
212
|
-
### Tiny Edit
|
|
213
|
-
|
|
214
|
-
```mermaid
|
|
215
|
-
flowchart LR
|
|
216
|
-
User --> Orchestrator --> Executor --> Orchestrator --> Summary[Summary]
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
Used for exact, mechanical, low-risk edits that do not need task planning or acceptance criteria.
|
|
220
|
-
|
|
221
|
-
### Substantial Feature or Fix
|
|
222
|
-
|
|
223
|
-
```mermaid
|
|
224
|
-
flowchart LR
|
|
225
|
-
User --> Orchestrator --> Planner[Task Planner]
|
|
226
|
-
Planner --> Spec[task-spec.md]
|
|
227
|
-
Spec --> Implementer
|
|
228
|
-
Implementer --> Report[implementation-report.md]
|
|
229
|
-
Report --> Validator
|
|
230
|
-
Validator --> Validation[validation-report.md]
|
|
231
|
-
Validation --> Orchestrator --> Summary[Summary]
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
Used for substantial implementation work with task artifacts and validation.
|
|
235
|
-
|
|
236
|
-
### Test-First Feature
|
|
237
|
-
|
|
238
|
-
```mermaid
|
|
239
|
-
flowchart LR
|
|
240
|
-
User --> Orchestrator --> Planner[Task Planner]
|
|
241
|
-
Planner --> Spec[task-spec.md]
|
|
242
|
-
Spec --> TestWriter[Test Writer]
|
|
243
|
-
TestWriter --> Tests[Test files]
|
|
244
|
-
Tests --> Implementer
|
|
245
|
-
Implementer --> Validator
|
|
246
|
-
Validator --> Orchestrator --> Summary[Summary]
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
Used when acceptance criteria can be encoded as tests before implementation.
|
|
250
|
-
|
|
251
|
-
### Research-Backed Change
|
|
252
|
-
|
|
253
|
-
```mermaid
|
|
254
|
-
flowchart LR
|
|
255
|
-
User --> Orchestrator --> Research
|
|
256
|
-
Research --> Findings[Findings and recommendation]
|
|
257
|
-
Findings --> Orchestrator
|
|
258
|
-
Orchestrator --> Planner[Task Planner]
|
|
259
|
-
Planner --> Implementer
|
|
260
|
-
Implementer --> Validator
|
|
261
|
-
Validator --> Orchestrator --> Summary[Summary]
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
Used when implementation depends on external facts or source-backed technical decisions.
|
|
265
|
-
|
|
266
|
-
### Documentation Task
|
|
267
|
-
|
|
268
|
-
```mermaid
|
|
269
|
-
flowchart LR
|
|
270
|
-
User --> Orchestrator --> Planner[Task Planner]
|
|
271
|
-
Planner --> Documentation
|
|
272
|
-
Documentation --> DocReport[documentation-report.md]
|
|
273
|
-
DocReport --> Validator
|
|
274
|
-
Validator --> Orchestrator --> Summary[Summary]
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
Used for substantial documentation work that should be scoped and validated.
|
|
278
|
-
|
|
279
|
-
### Commit or Push
|
|
280
|
-
|
|
281
|
-
```mermaid
|
|
282
|
-
flowchart LR
|
|
283
|
-
User --> Orchestrator --> Shipper --> Orchestrator --> Summary[Summary]
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
Used only when explicitly requested.
|
|
287
|
-
|
|
288
|
-
## Project Artifacts
|
|
289
|
-
|
|
290
|
-
Dispatcher stores durable project and task state under `.ai/`.
|
|
291
|
-
|
|
292
|
-
### Project Context
|
|
293
|
-
|
|
294
|
-
```text
|
|
295
|
-
.ai/context.md
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
Stores durable project facts such as:
|
|
299
|
-
|
|
300
|
-
* test framework
|
|
301
|
-
* test runner command
|
|
302
|
-
* test file patterns
|
|
303
|
-
* UI framework
|
|
304
|
-
* styling conventions
|
|
305
|
-
* naming conventions
|
|
306
|
-
* file layout
|
|
307
|
-
* project-specific rules
|
|
308
|
-
* stable decisions
|
|
309
|
-
|
|
310
|
-
### Task Scope
|
|
311
|
-
|
|
312
|
-
```text
|
|
313
|
-
.ai/tasks/<NNN>-<task-id>/task-spec.md
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
Stores the approved task scope, including:
|
|
317
|
-
|
|
318
|
-
* scope
|
|
319
|
-
* non-goals
|
|
320
|
-
* testable acceptance criteria (includes test file path hints)
|
|
321
|
-
* inspectable acceptance criteria
|
|
322
|
-
* relevant files
|
|
323
|
-
* validation plan
|
|
324
|
-
|
|
325
|
-
### Task Reports
|
|
326
|
-
|
|
327
|
-
```text
|
|
328
|
-
.ai/tasks/<NNN>-<task-id>/implementation-report.md
|
|
329
|
-
.ai/tasks/<NNN>-<task-id>/validation-report.md
|
|
330
|
-
.ai/tasks/<NNN>-<task-id>/documentation-report.md
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
Reports capture what changed, what was verified, and what remains open.
|
|
334
|
-
|
|
335
|
-
## First Use in a Project
|
|
336
|
-
|
|
337
|
-
1. Install Dispatcher.
|
|
338
|
-
2. Restart OpenCode.
|
|
339
|
-
3. Open your project in OpenCode.
|
|
340
|
-
4. If the project does not already have `.ai/context.md`, the orchestrator will initialize project context before substantial work.
|
|
341
|
-
5. For substantial work, ask the orchestrator to create a task spec first.
|
|
342
|
-
6. Review or approve the task spec.
|
|
343
|
-
7. Ask the orchestrator to implement and validate the approved task.
|
|
344
|
-
|
|
345
|
-
Example:
|
|
346
|
-
|
|
347
|
-
```text
|
|
348
|
-
Create a task spec for improving the settings page, then wait for approval.
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
After approving the spec:
|
|
352
|
-
|
|
353
|
-
```text
|
|
354
|
-
Implement the approved task spec at .ai/tasks/001-settings-page/task-spec.md and run validation.
|
|
355
|
-
```
|
|
5
|
+
Instead of relying on long chat history, Dispatcher keeps durable task state in your project under `.ai/tasks/` (task specs, implementation reports, validation reports, documentation reports). For tiny one-off edits or quick questions, plain OpenCode is often enough.
|
|
356
6
|
|
|
357
7
|
## Installation
|
|
358
8
|
|
|
@@ -362,198 +12,53 @@ Install from the npm registry:
|
|
|
362
12
|
npx opencode-dispatcher install
|
|
363
13
|
```
|
|
364
14
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
```text
|
|
368
|
-
~/.config/opencode
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
## Install from Source
|
|
15
|
+
Or install from source:
|
|
372
16
|
|
|
373
17
|
```bash
|
|
374
18
|
npm run check
|
|
375
19
|
npm run install:local
|
|
376
20
|
```
|
|
377
21
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
```bash
|
|
381
|
-
node ./bin/install.js check
|
|
382
|
-
node ./bin/install.js install
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
The default installer command is `install`, so this is also valid:
|
|
386
|
-
|
|
387
|
-
```bash
|
|
388
|
-
node ./bin/install.js
|
|
389
|
-
```
|
|
390
|
-
|
|
391
|
-
## What Gets Installed
|
|
392
|
-
|
|
393
|
-
The installer copies Dispatcher's managed payload into:
|
|
394
|
-
|
|
395
|
-
```text
|
|
396
|
-
~/.config/opencode/agents/
|
|
397
|
-
```
|
|
398
|
-
|
|
399
|
-
Current payloads include agents for:
|
|
400
|
-
|
|
401
|
-
* orchestration
|
|
402
|
-
* initialization
|
|
403
|
-
* task planning
|
|
404
|
-
* test writing
|
|
405
|
-
* implementation
|
|
406
|
-
* documentation
|
|
407
|
-
* validation
|
|
408
|
-
* research
|
|
409
|
-
* shipping
|
|
410
|
-
* exact mechanical edits
|
|
411
|
-
|
|
412
|
-
The installer does **not** install or manage:
|
|
413
|
-
|
|
414
|
-
* provider configuration
|
|
415
|
-
* model settings
|
|
416
|
-
* secrets
|
|
417
|
-
* project dependencies
|
|
418
|
-
* git configuration
|
|
419
|
-
* `opencode.jsonc`
|
|
420
|
-
* `node_modules`
|
|
421
|
-
* global skills
|
|
422
|
-
* project templates
|
|
423
|
-
|
|
424
|
-
## Install Safety
|
|
425
|
-
|
|
426
|
-
Before copying a managed path, the installer backs up any existing path beside it using a timestamped `.bak-*` suffix.
|
|
427
|
-
|
|
428
|
-
Example backup:
|
|
429
|
-
|
|
430
|
-
```text
|
|
431
|
-
~/.config/opencode/agents.bak-2026-06-07T12-34-56-789Z
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
The installer then overlays the Dispatcher payload into the managed path.
|
|
22
|
+
After installing, restart OpenCode so it reloads your global configuration.
|
|
435
23
|
|
|
436
|
-
|
|
24
|
+
## First Use
|
|
437
25
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
26
|
+
1. Install Dispatcher and restart OpenCode.
|
|
27
|
+
2. Open your project and let the orchestrator initialize `.ai/context.md` if it does not exist.
|
|
28
|
+
3. For substantial work, ask the orchestrator to create a task spec:
|
|
441
29
|
|
|
442
|
-
|
|
30
|
+
```text
|
|
31
|
+
Create a task spec for improving the settings page, then wait for approval.
|
|
32
|
+
```
|
|
443
33
|
|
|
444
|
-
|
|
34
|
+
4. Review and approve the task spec.
|
|
35
|
+
5. Ask the orchestrator to implement and validate the approved task:
|
|
445
36
|
|
|
446
|
-
|
|
37
|
+
```text
|
|
38
|
+
Implement the approved task spec at .ai/tasks/001-settings-page/task-spec.md and run validation.
|
|
39
|
+
```
|
|
447
40
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
1. Stop OpenCode.
|
|
451
|
-
2. Remove or rename the current managed path.
|
|
452
|
-
3. Move the matching `.bak-*` path back to its original name.
|
|
453
|
-
4. Restart OpenCode.
|
|
454
|
-
|
|
455
|
-
Example:
|
|
456
|
-
|
|
457
|
-
```bash
|
|
458
|
-
mv ~/.config/opencode/agents ~/.config/opencode/agents.dispatcher
|
|
459
|
-
mv ~/.config/opencode/agents.bak-<timestamp> ~/.config/opencode/agents
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
To uninstall Dispatcher, restore your backups if you had pre-existing global agents.
|
|
463
|
-
|
|
464
|
-
Only remove managed paths outright if you do not need any current contents, including files that may have existed before Dispatcher was installed.
|
|
465
|
-
|
|
466
|
-
## Package Commands
|
|
467
|
-
|
|
468
|
-
From `package.json`:
|
|
469
|
-
|
|
470
|
-
```bash
|
|
471
|
-
npm run check # node ./bin/install.js check
|
|
472
|
-
npm run install:local # node ./bin/install.js install
|
|
473
|
-
```
|
|
474
|
-
|
|
475
|
-
When installed as an npm package, Dispatcher provides this binary:
|
|
476
|
-
|
|
477
|
-
```bash
|
|
478
|
-
opencode-dispatcher [install|check]
|
|
479
|
-
```
|
|
480
|
-
|
|
481
|
-
Invalid commands print usage and exit with a non-zero status.
|
|
482
|
-
|
|
483
|
-
## Publication Status
|
|
484
|
-
|
|
485
|
-
This package is published on the npm registry as:
|
|
486
|
-
|
|
487
|
-
```text
|
|
488
|
-
opencode-dispatcher
|
|
489
|
-
```
|
|
490
|
-
|
|
491
|
-
Install it from any project with:
|
|
492
|
-
|
|
493
|
-
```bash
|
|
494
|
-
npx opencode-dispatcher install
|
|
495
|
-
```
|
|
496
|
-
|
|
497
|
-
## Security & Permissions
|
|
498
|
-
|
|
499
|
-
Dispatcher enforces strict boundaries through OpenCode's permission model:
|
|
500
|
-
|
|
501
|
-
* The orchestrator cannot run arbitrary shell commands, scripts, or write to files. It uses a strict bash whitelist limited to read-only informational tools (`ls`, `git status`, `which`, etc.).
|
|
502
|
-
* Subagents only get the permissions they need (e.g. shipper is strictly gated around specific git operations).
|
|
503
|
-
* To reduce excessive permission prompts during standard development cycles, the `implementer` and `validator` agents are granted broad `bash` execution allowances so they can seamlessly run test, build, and dev commands.
|
|
504
|
-
* The `edit: deny` constraint is properly enforced because the shell escape hatch is sealed by the `bash` permission whitelist.
|
|
505
|
-
|
|
506
|
-
## Limitations
|
|
507
|
-
|
|
508
|
-
* Managed global agent paths are backed up, then overlaid with Dispatcher files.
|
|
509
|
-
* Unrelated pre-existing files in managed directories may remain.
|
|
510
|
-
* OpenCode must be restarted after install, restore, or uninstall so global config is reloaded.
|
|
511
|
-
* Providers, models, secrets, project dependencies, and git remotes are not configured by this package.
|
|
512
|
-
* Dispatcher is designed for substantial tasks with scope, artifacts, and validation.
|
|
513
|
-
* Dispatcher may be unnecessary overhead for tiny edits, quick questions, or exploratory coding.
|
|
41
|
+
## Why Use It?
|
|
514
42
|
|
|
515
|
-
|
|
43
|
+
- Task state is **durable and inspectable** — specs, reports, and scope are stored in `.ai/tasks/` files, not chat history.
|
|
44
|
+
- Work is **resumable** — any agent can pick up where another left off by reading the task artifacts.
|
|
45
|
+
- Artifacts are **git-tracked** — you can review what was planned, what changed, and what was validated.
|
|
46
|
+
- Each task is **validated against its approved scope** — the validator checks that the implementation matches the task spec.
|
|
516
47
|
|
|
517
|
-
|
|
48
|
+
## When Not to Use It
|
|
518
49
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
* casual code suggestions
|
|
523
|
-
* work where formal task artifacts would slow you down
|
|
50
|
+
- Quick explanations or one-off questions.
|
|
51
|
+
- Tiny mechanical edits that do not benefit from task planning.
|
|
52
|
+
- Exploratory prototyping where formal task artifacts would slow you down.
|
|
524
53
|
|
|
525
|
-
|
|
54
|
+
## Further Reading
|
|
526
55
|
|
|
527
|
-
|
|
56
|
+
- [CHANGELOG.md](CHANGELOG.md) — version history
|
|
57
|
+
- [docs/workflow.md](docs/workflow.md) — orchestrator/subagent flow and task artifacts
|
|
58
|
+
- [docs/agents.md](docs/agents.md) — subagent reference and permission model
|
|
59
|
+
- [docs/configuration.md](docs/configuration.md) — model config, agy, opencode config, install details
|
|
60
|
+
- [docs/development.md](docs/development.md) — validation, conventions, releases, publishing
|
|
528
61
|
|
|
529
|
-
|
|
530
|
-
* **Shipper Inspection & Release-Boundary Fixes**: Tightened shipper bash permission whitelist to eliminate pre-commit inspection prompts and fixed release-boundary routing so the shipper only commits and pushes explicitly intended changes.
|
|
531
|
-
* **v0.3.0**
|
|
532
|
-
* **Model-Config Groups**: Replaced per-agent model selection with two-tier group-based workflow (MED/LOW), excluding orchestrator and task-planner.
|
|
62
|
+
## License
|
|
533
63
|
|
|
534
|
-
|
|
535
|
-
* **Routing Clarity**: Clarified executor routing as exact, mechanical, low-risk edits rather than file-count-based; clarified planner auto-proceed behavior when no user-facing decisions are introduced.
|
|
536
|
-
* **Shipper Boundary**: Tightened shipper routing so it only commits and pushes existing intended changes.
|
|
537
|
-
* **CI Update**: Updated publish workflow to Node 24-compatible GitHub Actions (`actions/checkout@v6`, `actions/setup-node@v6`, `node-version: 24`).
|
|
538
|
-
* **v0.2.10**
|
|
539
|
-
* **Agent Context**: Shipper agent now reads `.ai/context.md` for project-specific conventions (commit format, version bump patterns, auto-publish). Added `read` permission to shipper. Updated `.ai/context.md` with publication and auto-publish conventions. Added CI workflow (`.github/workflows/publish.yml`) to auto-publish on version bump commits.
|
|
540
|
-
* **v0.2.8**
|
|
541
|
-
* **Agent Clarity**: Updated `init` and `orchestrator` agents to accurately describe `agy` as an Antigravity CLI integration for splitting quota across models. Removed "file count" from the orchestrator's executor and task-planner routing rules — routing decisions now key on risk, complexity, and clarity instead.
|
|
542
|
-
* **v0.2.7**
|
|
543
|
-
* **Agent Fixes**: Fixed the `model-config` agent so it writes valid JSON(C) (not YAML) into `opencode.jsonc`, added `find`/`echo`/`sort`/`git config`/`ls` bash permissions to the `shipper` agent to eliminate pre-commit inspection permission prompts, and updated `model-config` to skip the orchestrator when presenting agents for model selection (the orchestrator's model is chosen directly by the user).
|
|
544
|
-
* **v0.2.6**
|
|
545
|
-
* **Agent Improvements**: Added `agy` integration awareness to the `init` and `orchestrator` agents. Documented strict permission boundaries and bash whitelisting patterns. Added common request routing patterns to the orchestrator. Removed unnecessary `.ai` edit denials from the executor agent.
|
|
546
|
-
* **v0.2.5**
|
|
547
|
-
* **Model Configuration**: Added the `model-config` agent to seamlessly assign specific models to different agents in the project's `opencode.jsonc`.
|
|
548
|
-
* **Workflow Standardization**: Enforced sequential, zero-padded numeric prefixes for all task directories (e.g., `001-feature-name`) across all agents to ensure proper sorting and tracking.
|
|
549
|
-
* **Usability Fixes**: Granted `bash` execution allowances to `implementer` and `validator` agents to reduce excessive permission prompts during test and build cycles.
|
|
550
|
-
* **Artifact Improvements**: Split the task spec template into *Testable Acceptance Criteria* (with explicit test file path hints) and *Inspectable Acceptance Criteria* to better guide the `test-writer` and `validator`.
|
|
551
|
-
* **v0.2.4**
|
|
552
|
-
* Hardened security boundaries by applying explicit read-only bash whitelists to the `orchestrator` and sealing `edit: deny` escape hatches.
|
|
553
|
-
* **v0.2.1**
|
|
554
|
-
* Minor permission fixes to allow the orchestrator to cleanly delegate to the `executor` fast-path agent.
|
|
555
|
-
* **v0.2.0**
|
|
556
|
-
* **Major Overhaul**: Replaced the general conversational agents with a durable, stateful task workflow.
|
|
557
|
-
* Introduced the central `orchestrator` as a user-facing router.
|
|
558
|
-
* Shifted to explicit `.ai/tasks/` artifacts (task specs, implementation reports, validation reports) to make agent work inspectable, resumable, and git-trackable.
|
|
559
|
-
* Consolidated legacy roles into specialized agents (`task-planner`, `implementer`, `validator`, `test-writer`).
|
|
64
|
+
MIT. See [LICENSE](LICENSE) for details.
|
package/package.json
CHANGED
|
@@ -19,6 +19,8 @@ Own per-agent model assignment in the project's opencode config. When delegated
|
|
|
19
19
|
|
|
20
20
|
Responsibilities:
|
|
21
21
|
|
|
22
|
+
- Never write any model or variant config until the user has explicitly confirmed each group assignment.
|
|
23
|
+
|
|
22
24
|
- Run `opencode models --verbose` to list available models and their variants on the system.
|
|
23
25
|
- Check for an existing opencode config at `opencode.jsonc` or `.opencode/opencode.jsonc` (in that order of preference).
|
|
24
26
|
- Determine the set of configurable subagents by excluding **orchestrator** (whose model is chosen directly by the user in OpenCode itself) and **task-planner** (which is intended to use the same model as the orchestrator) from the full list of installed Dispatcher subagents.
|
|
@@ -29,7 +31,10 @@ Responsibilities:
|
|
|
29
31
|
| MED | `validator`, `test-writer`, `documentation`, `init` | DeepSeek Pro class |
|
|
30
32
|
| LOW | `implementer`, `research`, `executor`, `shipper`, `model-config` | Flash / cheap class |
|
|
31
33
|
|
|
32
|
-
-
|
|
34
|
+
- After running `opencode models --verbose`, parse the output and match available models to each group's intended tier (MED → DeepSeek Pro class, LOW → Flash/cheap class).
|
|
35
|
+
- Present recommendations to the user in a clear format: for each group, show the recommended model (best match from available models), the group's agents, and list available alternatives the user could pick instead.
|
|
36
|
+
- Ask the user to confirm or override each group's model choice, and wait for an explicit response before proceeding.
|
|
37
|
+
- Only after both groups are confirmed, proceed to the variant selection step and then write config.
|
|
33
38
|
- For the chosen model, parse its `variants` field from the verbose output. If the model has variants (non-empty object), present the available variant names and ask the user to pick one or skip. If the model has no variants (empty `{}`), skip silently without prompting. If the user skips, do not write a `variant` field for that group.
|
|
34
39
|
- Write `agent.<name>.model` and optionally `agent.<name>.variant` entries for every agent in each group into the project's opencode config, preserving all existing config content exactly as-is. Use the target format:
|
|
35
40
|
```jsonc
|
|
@@ -50,6 +55,7 @@ Boundaries:
|
|
|
50
55
|
- Do not modify code, tests, documentation, `.ai/` artifacts, or other agent definitions.
|
|
51
56
|
- Do not invent variant names — only use variant names shown in `opencode models --verbose` output.
|
|
52
57
|
- Do not write a `variant` field for models that have no variants (empty `{}`).
|
|
58
|
+
- Do not assume, infer, or default the user's model choices. If the user does not respond with a confirmed selection, stop and report back without writing any config.
|
|
53
59
|
|
|
54
60
|
Default report back:
|
|
55
61
|
|