opencode-dispatcher 0.2.4 → 0.2.8
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 +41 -6
- package/package.json +1 -1
- package/workflow/agents/executor.md +0 -1
- package/workflow/agents/init.md +2 -1
- package/workflow/agents/model-config.md +16 -5
- package/workflow/agents/orchestrator.md +14 -3
- package/workflow/agents/shipper.md +6 -0
- package/workflow/agents/task-planner.md +7 -2
package/README.md
CHANGED
|
@@ -184,15 +184,18 @@ The documentation agent is used when the task needs README updates, project cont
|
|
|
184
184
|
|
|
185
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
186
|
|
|
187
|
-
### Bootstrap and Shipping
|
|
187
|
+
### Bootstrap, Configuration, and Shipping
|
|
188
188
|
|
|
189
|
-
| Agent
|
|
190
|
-
|
|
|
191
|
-
| Init
|
|
192
|
-
|
|
|
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 |
|
|
193
194
|
|
|
194
195
|
The init agent is used when a project does not yet have `.ai/context.md`.
|
|
195
196
|
|
|
197
|
+
The model config agent configures per-agent models in `opencode.jsonc`.
|
|
198
|
+
|
|
196
199
|
The shipper is never used automatically. It only commits or pushes when you explicitly ask for git shipping work.
|
|
197
200
|
|
|
198
201
|
## Common Routes
|
|
@@ -314,7 +317,7 @@ Stores the approved task scope, including:
|
|
|
314
317
|
|
|
315
318
|
* scope
|
|
316
319
|
* non-goals
|
|
317
|
-
* testable acceptance criteria
|
|
320
|
+
* testable acceptance criteria (includes test file path hints)
|
|
318
321
|
* inspectable acceptance criteria
|
|
319
322
|
* relevant files
|
|
320
323
|
* validation plan
|
|
@@ -491,6 +494,15 @@ Install it from any project with:
|
|
|
491
494
|
npx opencode-dispatcher install
|
|
492
495
|
```
|
|
493
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
|
+
|
|
494
506
|
## Limitations
|
|
495
507
|
|
|
496
508
|
* Managed global agent paths are backed up, then overlaid with Dispatcher files.
|
|
@@ -511,3 +523,26 @@ Dispatcher is probably unnecessary when you only need:
|
|
|
511
523
|
* work where formal task artifacts would slow you down
|
|
512
524
|
|
|
513
525
|
Use Dispatcher when the structure is worth it. Use the fast path or plain OpenCode when it is not.
|
|
526
|
+
|
|
527
|
+
## Version History
|
|
528
|
+
|
|
529
|
+
* **v0.2.8**
|
|
530
|
+
* **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.
|
|
531
|
+
* **v0.2.7**
|
|
532
|
+
* **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).
|
|
533
|
+
* **v0.2.6**
|
|
534
|
+
* **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.
|
|
535
|
+
* **v0.2.5**
|
|
536
|
+
* **Model Configuration**: Added the `model-config` agent to seamlessly assign specific models to different agents in the project's `opencode.jsonc`.
|
|
537
|
+
* **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.
|
|
538
|
+
* **Usability Fixes**: Granted `bash` execution allowances to `implementer` and `validator` agents to reduce excessive permission prompts during test and build cycles.
|
|
539
|
+
* **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`.
|
|
540
|
+
* **v0.2.4**
|
|
541
|
+
* Hardened security boundaries by applying explicit read-only bash whitelists to the `orchestrator` and sealing `edit: deny` escape hatches.
|
|
542
|
+
* **v0.2.1**
|
|
543
|
+
* Minor permission fixes to allow the orchestrator to cleanly delegate to the `executor` fast-path agent.
|
|
544
|
+
* **v0.2.0**
|
|
545
|
+
* **Major Overhaul**: Replaced the general conversational agents with a durable, stateful task workflow.
|
|
546
|
+
* Introduced the central `orchestrator` as a user-facing router.
|
|
547
|
+
* Shifted to explicit `.ai/tasks/` artifacts (task specs, implementation reports, validation reports) to make agent work inspectable, resumable, and git-trackable.
|
|
548
|
+
* Consolidated legacy roles into specialized agents (`task-planner`, `implementer`, `validator`, `test-writer`).
|
package/package.json
CHANGED
package/workflow/agents/init.md
CHANGED
|
@@ -21,7 +21,8 @@ Responsibilities:
|
|
|
21
21
|
- Naming conventions: casing, file and component naming (`## Conventions`).
|
|
22
22
|
- File layout: co-located tests, file-per-component, directory structure (`## Conventions`).
|
|
23
23
|
- Any project-specific rules: import style, hook ordering, error handling (`## Conventions`).
|
|
24
|
-
-
|
|
24
|
+
- Agy integration: ask if they want to enable Antigravity CLI integration (`agy: enabled` flag in `## Workflow`). When enabled, the implementer agent can offload work through `agy` to split quota usage across models.
|
|
25
|
+
- Create `.ai/context.md` with `## Test Setup`, `## Conventions`, and `## Workflow` sections using the user's exact answers.
|
|
25
26
|
- Do not invent project facts. Do not create any other files.
|
|
26
27
|
|
|
27
28
|
Default report back:
|
|
@@ -19,12 +19,21 @@ Own per-agent model assignment in the project's opencode config. When delegated
|
|
|
19
19
|
|
|
20
20
|
Responsibilities:
|
|
21
21
|
|
|
22
|
-
- Run `opencode models` to list available models on the system.
|
|
22
|
+
- Run `opencode models --verbose` to list available models and their variants on the system.
|
|
23
23
|
- Check for an existing opencode config at `opencode.jsonc` or `.opencode/opencode.jsonc` (in that order of preference).
|
|
24
|
-
- Present the user with the list of installed Dispatcher
|
|
24
|
+
- Present the user with the list of installed Dispatcher subagents (excluding the orchestrator, whose model is chosen directly by the user) and ask which agents they want to configure.
|
|
25
25
|
- For each selected agent, ask which model to assign (from the available models list).
|
|
26
|
-
-
|
|
27
|
-
-
|
|
26
|
+
- For each assigned 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 agent.
|
|
27
|
+
- Write `agent.<name>.model` and optionally `agent.<name>.variant` entries into the project's opencode config, preserving all existing config content exactly as-is. Use the target format:
|
|
28
|
+
```jsonc
|
|
29
|
+
"agent": {
|
|
30
|
+
"orchestrator": {
|
|
31
|
+
"model": "opencode-go/deepseek-v4-pro",
|
|
32
|
+
"variant": "medium"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
- If no opencode config exists, create one with only the `agent.<name>.model` (and `agent.<name>.variant` where applicable) entries.
|
|
28
37
|
- Report back to the orchestrator with a summary of what was configured.
|
|
29
38
|
|
|
30
39
|
Boundaries:
|
|
@@ -32,11 +41,13 @@ Boundaries:
|
|
|
32
41
|
- Do not edit any files other than the project's opencode config (`opencode.jsonc` or `.opencode/opencode.jsonc`).
|
|
33
42
|
- Do not delegate to other agents (no `task` permission).
|
|
34
43
|
- Do not modify code, tests, documentation, `.ai/` artifacts, or other agent definitions.
|
|
44
|
+
- Do not invent variant names — only use variant names shown in `opencode models --verbose` output.
|
|
45
|
+
- Do not write a `variant` field for models that have no variants (empty `{}`).
|
|
35
46
|
|
|
36
47
|
Default report back:
|
|
37
48
|
|
|
38
49
|
- Path of the config file edited (or created).
|
|
39
|
-
- List of agents configured and their assigned models.
|
|
50
|
+
- List of agents configured and their assigned models (and variants, when assigned).
|
|
40
51
|
- Any issues encountered (e.g., config conflicts, missing models).
|
|
41
52
|
|
|
42
53
|
(End of file - total 37 lines)
|
|
@@ -59,7 +59,7 @@ Hard boundary: do not implement substantial code, UI, docs, or config changes yo
|
|
|
59
59
|
Artifact source-of-truth rules:
|
|
60
60
|
|
|
61
61
|
- Do not rely on chat-only artifacts for substantial work.
|
|
62
|
-
- Project `.ai/context.md` captures durable project truth: shared language, architecture facts, conventions, constraints, and
|
|
62
|
+
- Project `.ai/context.md` captures durable project truth: shared language, architecture facts, conventions, constraints, stable decisions, and workflow flags (like `agy: enabled`).
|
|
63
63
|
- `.ai/tasks/<NNN>-<task-id>/task-spec.md` captures task truth: approved scope, acceptance criteria, constraints, relevant files, and validation plan.
|
|
64
64
|
- Task reports live beside the task spec: `implementation-report.md`, `documentation-report.md`, and `validation-report.md`.
|
|
65
65
|
|
|
@@ -110,11 +110,14 @@ Ask one focused question only when the missing answer would change scope, safety
|
|
|
110
110
|
Choose the smallest safe path:
|
|
111
111
|
|
|
112
112
|
- Answer directly when no file changes are needed.
|
|
113
|
-
- Use executor when the edit is exact,
|
|
113
|
+
- Use executor when the edit is exact, low-risk, and unambiguous (file count is irrelevant).
|
|
114
114
|
- Use research when current facts, external docs, pricing, vendor behaviour, or source-backed confidence matter.
|
|
115
|
-
- Use task-planner when the work is
|
|
115
|
+
- Use task-planner when the work is behaviour-changing, risky, unclear, needs acceptance criteria, or benefits from a written plan before implementation.
|
|
116
116
|
- Use shipper only when the user explicitly asks to commit or push.
|
|
117
117
|
- Use model-config when the user wants to configure per-agent models for this project.
|
|
118
|
+
### Common Requests
|
|
119
|
+
|
|
120
|
+
- **Enable agy / enable antigravity**: Add `agy: enabled` to `.ai/context.md` under `## Workflow`. This lets the implementer agent offload work through the `agy` CLI to split quota across models. Route to executor.
|
|
118
121
|
|
|
119
122
|
### DELEGATE
|
|
120
123
|
|
|
@@ -132,6 +135,14 @@ Delegate to the specialist that owns the next action.
|
|
|
132
135
|
|
|
133
136
|
Always return control to yourself after each subagent result.
|
|
134
137
|
|
|
138
|
+
Execution pipeline for task specs:
|
|
139
|
+
|
|
140
|
+
- After task-planner returns a task spec, read the `## Execution` section.
|
|
141
|
+
- Spawn agents in the listed order, one at a time, waiting for each to complete before starting the next (sequential pipeline).
|
|
142
|
+
- After the pipeline completes, always spawn `validator` as the final agent.
|
|
143
|
+
- If the `## Execution` section is missing or empty, do not spawn any agents; report the gap to the user.
|
|
144
|
+
- Never assume a default agent sequence — always read the pipeline from the spec.
|
|
145
|
+
|
|
135
146
|
### REVIEW
|
|
136
147
|
|
|
137
148
|
After non-trivial implementation or documentation work, validate against the task spec.
|
|
@@ -15,6 +15,12 @@ permission:
|
|
|
15
15
|
"git add *": allow
|
|
16
16
|
"git commit *": allow
|
|
17
17
|
"git push*": allow
|
|
18
|
+
"find *": allow
|
|
19
|
+
"echo *": allow
|
|
20
|
+
"sort *": allow
|
|
21
|
+
"git config*": allow
|
|
22
|
+
"ls": allow
|
|
23
|
+
"ls *": allow
|
|
18
24
|
"git reset*": deny
|
|
19
25
|
"git rebase*": deny
|
|
20
26
|
"git clean*": deny
|
|
@@ -23,12 +23,17 @@ On every invocation, assess whether the work is a single-unit task or a multi-un
|
|
|
23
23
|
|
|
24
24
|
Single-unit workflow:
|
|
25
25
|
|
|
26
|
-
- Create `.ai/tasks/<NNN>-<task-id>/task-spec.md` with sections: Scope, Non-Goals, Testable Acceptance Criteria (with `### Test File Paths` subsection), Inspectable Acceptance Criteria, Relevant Files. `<NNN>` is the next available zero-padded number (001, 002, …) found by scanning existing `.ai/tasks/` directories.
|
|
26
|
+
- Create `.ai/tasks/<NNN>-<task-id>/task-spec.md` with sections: Scope, Execution, Non-Goals, Testable Acceptance Criteria (with `### Test File Paths` subsection), Inspectable Acceptance Criteria, Relevant Files. `<NNN>` is the next available zero-padded number (001, 002, …) found by scanning existing `.ai/tasks/` directories.
|
|
27
27
|
- Read `.ai/context.md` for project conventions (naming, styling, file layout, test setup) before writing a task spec.
|
|
28
28
|
- Read the files the orchestrator named as candidate files. Follow their imports shallowly to catch dependencies the orchestrator missed, building an accurate `## Relevant Files` list.
|
|
29
29
|
- Make real architectural decisions based on conventions: which patterns to use, where new files go, what to change in existing files.
|
|
30
30
|
- Add decision notes under `.ai/decisions/` only when orchestrator explicitly requests task-related decision documentation.
|
|
31
31
|
- Do not edit implementation files, project docs outside `.ai/`, or source code.
|
|
32
|
+
- Write an `## Execution` section in every task spec. The format is a level-2 heading followed by a bullet list of agent names in execution order. Valid agent names: `test-writer`, `implementer`, `documentation`. Never include `validator` — the orchestrator appends it automatically. Decision logic for choosing the pipeline:
|
|
33
|
+
- Feature/fix with testable acceptance criteria → `test-writer`, then `implementer`.
|
|
34
|
+
- Feature/fix with only inspectable acceptance criteria (no tests to write) → `implementer` only.
|
|
35
|
+
- Documentation task → `documentation` only.
|
|
36
|
+
- Follow-up documentation (implementation was handled by its own spec's Execution section) → `documentation` only.
|
|
32
37
|
|
|
33
38
|
Multi-unit decomposition:
|
|
34
39
|
|
|
@@ -48,7 +53,7 @@ Multi-unit decomposition:
|
|
|
48
53
|
|
|
49
54
|
- Wait for user approval before proceeding. Do not continue until the user explicitly approves the unit plan.
|
|
50
55
|
- After approval, create the parent manifest at `.ai/tasks/<NNN>-<task-id>/task-spec.md` containing the unit table and execution order.
|
|
51
|
-
- Create one child `task-spec.md` per unit under numeric-prefixed subdirectories. Each child task spec follows the standard spec format: Scope, Non-Goals, Testable Acceptance Criteria (with `### Test File Paths`), Inspectable Acceptance Criteria, Relevant Files.
|
|
56
|
+
- Create one child `task-spec.md` per unit under numeric-prefixed subdirectories. Each child task spec follows the standard spec format: Scope, Execution, Non-Goals, Testable Acceptance Criteria (with `### Test File Paths`), Inspectable Acceptance Criteria, Relevant Files.
|
|
52
57
|
|
|
53
58
|
```
|
|
54
59
|
.ai/tasks/<NNN>-<task-id>/
|