opencode-multiagent 0.2.0
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 +209 -0
- package/agents/advisor.md +57 -0
- package/agents/auditor.md +45 -0
- package/agents/critic.md +127 -0
- package/agents/deep-worker.md +65 -0
- package/agents/devil.md +36 -0
- package/agents/executor.md +141 -0
- package/agents/heavy-worker.md +68 -0
- package/agents/lead.md +155 -0
- package/agents/librarian.md +62 -0
- package/agents/planner.md +121 -0
- package/agents/qa.md +50 -0
- package/agents/quick.md +65 -0
- package/agents/reviewer.md +55 -0
- package/agents/scout.md +58 -0
- package/agents/scribe.md +78 -0
- package/agents/strategist.md +63 -0
- package/agents/ui-heavy-worker.md +62 -0
- package/agents/ui-worker.md +69 -0
- package/agents/validator.md +47 -0
- package/agents/worker.md +68 -0
- package/commands/execute.md +14 -0
- package/commands/init-deep.md +18 -0
- package/commands/init.md +18 -0
- package/commands/inspect.md +13 -0
- package/commands/plan.md +15 -0
- package/commands/quality.md +14 -0
- package/commands/review.md +14 -0
- package/commands/status.md +15 -0
- package/defaults/agent-settings.json +102 -0
- package/defaults/agent-settings.schema.json +25 -0
- package/defaults/flags.json +35 -0
- package/defaults/flags.schema.json +119 -0
- package/defaults/mcp-defaults.json +47 -0
- package/defaults/mcp-defaults.schema.json +38 -0
- package/defaults/profiles.json +53 -0
- package/defaults/profiles.schema.json +60 -0
- package/defaults/team-profiles.json +83 -0
- package/examples/opencode.json +4 -0
- package/examples/opencode.with-overrides.json +23 -0
- package/package.json +62 -0
- package/skills/advanced-evaluation/SKILL.md +454 -0
- package/skills/advanced-evaluation/manifest.json +20 -0
- package/skills/cek-context-engineering/SKILL.md +1261 -0
- package/skills/cek-context-engineering/manifest.json +17 -0
- package/skills/cek-prompt-engineering/SKILL.md +559 -0
- package/skills/cek-prompt-engineering/manifest.json +17 -0
- package/skills/cek-test-prompt/SKILL.md +714 -0
- package/skills/cek-test-prompt/manifest.json +17 -0
- package/skills/cek-thought-based-reasoning/SKILL.md +658 -0
- package/skills/cek-thought-based-reasoning/manifest.json +17 -0
- package/skills/context-degradation/SKILL.md +231 -0
- package/skills/context-degradation/manifest.json +17 -0
- package/skills/debate/SKILL.md +316 -0
- package/skills/debate/manifest.json +19 -0
- package/skills/design-first/SKILL.md +5 -0
- package/skills/design-first/manifest.json +20 -0
- package/skills/dispatching-parallel-agents/SKILL.md +180 -0
- package/skills/dispatching-parallel-agents/manifest.json +18 -0
- package/skills/drift-analysis/SKILL.md +324 -0
- package/skills/drift-analysis/manifest.json +19 -0
- package/skills/evaluation/SKILL.md +5 -0
- package/skills/evaluation/manifest.json +19 -0
- package/skills/executing-plans/SKILL.md +70 -0
- package/skills/executing-plans/manifest.json +17 -0
- package/skills/handoff-protocols/SKILL.md +5 -0
- package/skills/handoff-protocols/manifest.json +19 -0
- package/skills/parallel-investigation/SKILL.md +206 -0
- package/skills/parallel-investigation/manifest.json +18 -0
- package/skills/reflexion-critique/SKILL.md +477 -0
- package/skills/reflexion-critique/manifest.json +17 -0
- package/skills/reflexion-reflect/SKILL.md +650 -0
- package/skills/reflexion-reflect/manifest.json +17 -0
- package/skills/root-cause-analysis/SKILL.md +5 -0
- package/skills/root-cause-analysis/manifest.json +20 -0
- package/skills/sadd-judge-with-debate/SKILL.md +426 -0
- package/skills/sadd-judge-with-debate/manifest.json +17 -0
- package/skills/structured-code-review/SKILL.md +5 -0
- package/skills/structured-code-review/manifest.json +18 -0
- package/skills/task-decomposition/SKILL.md +5 -0
- package/skills/task-decomposition/manifest.json +20 -0
- package/skills/verification-before-completion/SKILL.md +5 -0
- package/skills/verification-before-completion/manifest.json +22 -0
- package/skills/verification-gates/SKILL.md +281 -0
- package/skills/verification-gates/manifest.json +19 -0
- package/src/control-plane.ts +21 -0
- package/src/index.ts +8 -0
- package/src/opencode-multiagent/compiler.ts +168 -0
- package/src/opencode-multiagent/constants.ts +178 -0
- package/src/opencode-multiagent/file-lock.ts +90 -0
- package/src/opencode-multiagent/hooks.ts +599 -0
- package/src/opencode-multiagent/log.ts +12 -0
- package/src/opencode-multiagent/mailbox.ts +287 -0
- package/src/opencode-multiagent/markdown.ts +99 -0
- package/src/opencode-multiagent/mcp.ts +35 -0
- package/src/opencode-multiagent/policy.ts +67 -0
- package/src/opencode-multiagent/quality.ts +140 -0
- package/src/opencode-multiagent/runtime.ts +55 -0
- package/src/opencode-multiagent/skills.ts +144 -0
- package/src/opencode-multiagent/supervision.ts +156 -0
- package/src/opencode-multiagent/task-manager.ts +148 -0
- package/src/opencode-multiagent/team-manager.ts +219 -0
- package/src/opencode-multiagent/team-tools.ts +359 -0
- package/src/opencode-multiagent/telemetry.ts +124 -0
- package/src/opencode-multiagent/utils.ts +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 vaur94
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# opencode-multiagent
|
|
2
|
+
|
|
3
|
+
`opencode-multiagent` is a TypeScript OpenCode plugin package for running a disciplined multi-agent control plane through the standard OpenCode plugin system.
|
|
4
|
+
|
|
5
|
+
- 4 primary agents: `lead`, `critic`, `planner`, `executor`
|
|
6
|
+
- 16 subagents for coding, review, research, docs, and repo mapping
|
|
7
|
+
- plugin-managed MCP defaults and MCP tool enforcement
|
|
8
|
+
- central agent settings, profiles, telemetry, file-lock, and QA reminder guards
|
|
9
|
+
- npm-loaded plugin model through `opencode.json`
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
For plugin consumers, the primary integration is `opencode.json`.
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"$schema": "https://opencode.ai/config.json",
|
|
18
|
+
"plugin": ["opencode-multiagent"]
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
OpenCode resolves the package from the plugin array and loads the plugin from the package export.
|
|
23
|
+
|
|
24
|
+
Example configs:
|
|
25
|
+
|
|
26
|
+
- `examples/opencode.json`
|
|
27
|
+
- `examples/opencode.with-overrides.json`
|
|
28
|
+
|
|
29
|
+
## Development
|
|
30
|
+
|
|
31
|
+
For working on this plugin package itself:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install
|
|
35
|
+
npm run ci:check
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Local OpenCode development can use a linked package or a local package path in `opencode.json` while iterating.
|
|
39
|
+
|
|
40
|
+
## Migration from the old setup
|
|
41
|
+
|
|
42
|
+
If your old `opencode.json` manually carried MCP servers, plugin-managed agents, or broad permission defaults, simplify it.
|
|
43
|
+
|
|
44
|
+
Recommended migration:
|
|
45
|
+
|
|
46
|
+
1. Add `"plugin": ["opencode-multiagent"]`
|
|
47
|
+
2. Remove duplicated `mcp` definitions unless you are intentionally overriding a bundled server
|
|
48
|
+
3. Remove duplicated bundled `agent` entries unless you are intentionally overriding a field like `steps`
|
|
49
|
+
4. Remove broad tool permission blocks that were only compensating for the old flat config
|
|
50
|
+
|
|
51
|
+
Minimal target:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"$schema": "https://opencode.ai/config.json",
|
|
56
|
+
"plugin": ["opencode-multiagent"]
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Override example:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"$schema": "https://opencode.ai/config.json",
|
|
65
|
+
"plugin": ["opencode-multiagent"],
|
|
66
|
+
"agent": {
|
|
67
|
+
"lead": {
|
|
68
|
+
"steps": 650
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Architecture
|
|
75
|
+
|
|
76
|
+
### Primary agents
|
|
77
|
+
|
|
78
|
+
- `lead` - single entry point, lifecycle owner, 4-tier triage
|
|
79
|
+
- `critic` - challenge mode plus inspection mode
|
|
80
|
+
- `planner` - durable plan authoring
|
|
81
|
+
- `executor` - task orchestration and validation tiers
|
|
82
|
+
|
|
83
|
+
### Subagents
|
|
84
|
+
|
|
85
|
+
- `scout`
|
|
86
|
+
- `worker`, `heavy-worker`, `deep-worker`, `ui-worker`, `ui-heavy-worker`, `quick`
|
|
87
|
+
- `reviewer`, `validator`, `qa`
|
|
88
|
+
- `advisor`, `strategist`, `auditor`, `devil`
|
|
89
|
+
- `scribe`
|
|
90
|
+
- `librarian`
|
|
91
|
+
|
|
92
|
+
### Lead triage
|
|
93
|
+
|
|
94
|
+
- `Tier 0` - trivial work -> `executor`
|
|
95
|
+
- `Tier 1` - bounded work -> `critic` then `executor`
|
|
96
|
+
- `Tier 2` - complex work -> `critic` then `planner` then `executor`
|
|
97
|
+
- `Tier 3` - investigation or repo-memory work -> `critic` inspection mode
|
|
98
|
+
|
|
99
|
+
## Plugin responsibilities
|
|
100
|
+
|
|
101
|
+
The plugin `config` hook:
|
|
102
|
+
|
|
103
|
+
- injects bundled markdown agents and commands
|
|
104
|
+
- applies central agent setting overrides from `defaults/agent-settings.json`
|
|
105
|
+
- injects plugin-managed MCP defaults from `defaults/mcp-defaults.json`
|
|
106
|
+
- blocks disallowed MCP tool usage using compiled per-agent permission rules
|
|
107
|
+
- disables native user-facing OpenCode agents when the plugin-managed replacements are active
|
|
108
|
+
- prefers `lead` as `default_agent`
|
|
109
|
+
|
|
110
|
+
The runtime hook layer also provides:
|
|
111
|
+
|
|
112
|
+
- telemetry JSONL logging
|
|
113
|
+
- file-lock protection for overlapping edits across sessions
|
|
114
|
+
- repeated QA handoff reminders
|
|
115
|
+
- quality reminders for verification-like follow-up
|
|
116
|
+
- supervision for child sessions
|
|
117
|
+
|
|
118
|
+
## Plugin-owned MCP behavior
|
|
119
|
+
|
|
120
|
+
Bundled MCP defaults:
|
|
121
|
+
|
|
122
|
+
- `code_index`
|
|
123
|
+
- `repo`
|
|
124
|
+
- `context7`
|
|
125
|
+
- `exa`
|
|
126
|
+
- `gh_grep`
|
|
127
|
+
- `github`
|
|
128
|
+
|
|
129
|
+
Behavior:
|
|
130
|
+
|
|
131
|
+
- if the host config does not define one of these servers, the plugin injects its bundled default
|
|
132
|
+
- if the host config already defines one of these servers, the plugin does not overwrite it
|
|
133
|
+
- agent access is shaped by bundled frontmatter permissions and re-checked in runtime hooks
|
|
134
|
+
|
|
135
|
+
That means the plugin owns the baseline MCP layer, while the host config remains the override layer.
|
|
136
|
+
|
|
137
|
+
## Runtime config
|
|
138
|
+
|
|
139
|
+
User overrides live under `~/.config/opencode/plugins/`:
|
|
140
|
+
|
|
141
|
+
- `opencode-multiagent.flags.json`
|
|
142
|
+
- `opencode-multiagent.agent-settings.json`
|
|
143
|
+
- `opencode-multiagent.profiles.json`
|
|
144
|
+
|
|
145
|
+
Bundled defaults live in `defaults/` and are merged conservatively at runtime.
|
|
146
|
+
|
|
147
|
+
## Scripts
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
npm run typecheck
|
|
151
|
+
npm run validate-config
|
|
152
|
+
npm run config-server
|
|
153
|
+
npm run telemetry-report
|
|
154
|
+
npm run ci:check
|
|
155
|
+
npm run pack:dry-run
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Release model
|
|
159
|
+
|
|
160
|
+
- CI is npm-based
|
|
161
|
+
- publish flow is npm trusted publishing ready
|
|
162
|
+
- plugin consumption stays `opencode.json -> plugin`
|
|
163
|
+
- the package is source-first TypeScript; OpenCode can load the exported TypeScript entry directly
|
|
164
|
+
|
|
165
|
+
## Publishing
|
|
166
|
+
|
|
167
|
+
This repository is set up for npm trusted publishing through GitHub Actions OIDC.
|
|
168
|
+
|
|
169
|
+
Before any release:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
npm run ci:check
|
|
173
|
+
npm run pack:dry-run
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### First publish
|
|
177
|
+
|
|
178
|
+
The first npm publish must be done manually from the repository root because trusted publishing cannot create a brand-new package on npm by itself.
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
npm whoami
|
|
182
|
+
npm publish --access public
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Do not use local provenance for the first publish. Provenance is generated later by the GitHub Actions publish workflow.
|
|
186
|
+
|
|
187
|
+
If npm requires browser or OTP confirmation, complete that locally first.
|
|
188
|
+
|
|
189
|
+
### Trusted publisher setup
|
|
190
|
+
|
|
191
|
+
After the first successful publish, create the npm trusted publisher mapping for this repository:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
npx -y npm@11.11.0 trust github opencode-multiagent --repo vaur94/opencode-multiagent --file publish.yml
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
The workflow filename must stay `publish.yml` on npm's side, not `.github/workflows/publish.yml`.
|
|
198
|
+
|
|
199
|
+
### Workflow behavior
|
|
200
|
+
|
|
201
|
+
- GitHub release `published` events perform a real `npm publish --provenance --access public`
|
|
202
|
+
- manual `workflow_dispatch` runs verification by default and only publish when the `publish` input is enabled
|
|
203
|
+
- release tags must match `v<package.json version>` before the publish step can run
|
|
204
|
+
|
|
205
|
+
## Notes
|
|
206
|
+
|
|
207
|
+
- no file-copy install or update workflow remains
|
|
208
|
+
- no bundled test suite remains; validation is static and structural by design
|
|
209
|
+
- this package is now aligned to the standard OpenCode plugin loading model instead of the old copied-global-file model
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Read-only coding advisor for workers that are blocked, low-confidence, or choosing between implementation paths
|
|
3
|
+
mode: subagent
|
|
4
|
+
model: openai/gpt-5.4
|
|
5
|
+
temperature: 0
|
|
6
|
+
steps: 20
|
|
7
|
+
permission:
|
|
8
|
+
"*": deny
|
|
9
|
+
read:
|
|
10
|
+
"*": allow
|
|
11
|
+
"*.env": deny
|
|
12
|
+
"*.env.*": deny
|
|
13
|
+
"*.env.example": allow
|
|
14
|
+
glob: allow
|
|
15
|
+
grep: allow
|
|
16
|
+
list: allow
|
|
17
|
+
lsp: allow
|
|
18
|
+
todoread: allow
|
|
19
|
+
todowrite: allow
|
|
20
|
+
code_index_set_project_path: allow
|
|
21
|
+
code_index_search_code_advanced: allow
|
|
22
|
+
code_index_find_files: allow
|
|
23
|
+
code_index_get_file_summary: allow
|
|
24
|
+
code_index_get_symbol_body: allow
|
|
25
|
+
repo_git_status: allow
|
|
26
|
+
repo_git_diff: allow
|
|
27
|
+
task: deny
|
|
28
|
+
skill:
|
|
29
|
+
"*": deny
|
|
30
|
+
task-decomposition: allow
|
|
31
|
+
root-cause-analysis: allow
|
|
32
|
+
design-first: allow
|
|
33
|
+
edit: deny
|
|
34
|
+
bash: allow
|
|
35
|
+
webfetch: deny
|
|
36
|
+
websearch: deny
|
|
37
|
+
codesearch: deny
|
|
38
|
+
external_directory: allow
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
You are `advisor`.
|
|
42
|
+
|
|
43
|
+
Role
|
|
44
|
+
- Help workers when they are stuck, low-confidence, or choosing between implementation paths.
|
|
45
|
+
- Inspect local code and return direction without editing.
|
|
46
|
+
- Prefer the narrowest answer that unblocks the worker's assigned task.
|
|
47
|
+
|
|
48
|
+
Caller contract
|
|
49
|
+
- Provide the task, the blocker, and the most relevant files or symbols.
|
|
50
|
+
- Ask one focused question.
|
|
51
|
+
|
|
52
|
+
Output
|
|
53
|
+
- `## Bottom Line`
|
|
54
|
+
- `## Diagnosis`
|
|
55
|
+
- `## Recommended Next Edits`
|
|
56
|
+
- `## Checks`
|
|
57
|
+
- `## Uncertainty`
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Aggressive read-only plan auditor that hunts missing steps, weak acceptance criteria, sequencing failures, and verification gaps
|
|
3
|
+
mode: subagent
|
|
4
|
+
model: openai/gpt-5.4
|
|
5
|
+
temperature: 0
|
|
6
|
+
steps: 24
|
|
7
|
+
permission:
|
|
8
|
+
"*": deny
|
|
9
|
+
read:
|
|
10
|
+
"*": allow
|
|
11
|
+
"*.env": deny
|
|
12
|
+
"*.env.*": deny
|
|
13
|
+
"*.env.example": allow
|
|
14
|
+
glob: allow
|
|
15
|
+
grep: allow
|
|
16
|
+
list: allow
|
|
17
|
+
lsp: allow
|
|
18
|
+
task: deny
|
|
19
|
+
edit: deny
|
|
20
|
+
bash: deny
|
|
21
|
+
webfetch: deny
|
|
22
|
+
websearch: deny
|
|
23
|
+
codesearch: deny
|
|
24
|
+
external_directory: allow
|
|
25
|
+
skill:
|
|
26
|
+
"*": deny
|
|
27
|
+
drift-analysis: allow
|
|
28
|
+
verification-gates: allow
|
|
29
|
+
evaluation: allow
|
|
30
|
+
structured-code-review: allow
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
You are `auditor`.
|
|
34
|
+
|
|
35
|
+
Role
|
|
36
|
+
- Attack plans for missing steps, weak criteria, hidden dependencies, unrealistic assumptions, and verification gaps.
|
|
37
|
+
- You are adversarial, compact, and evidence-based.
|
|
38
|
+
|
|
39
|
+
Output
|
|
40
|
+
- `## Summary`
|
|
41
|
+
- `## Critical Gaps`
|
|
42
|
+
- `## Medium Risks`
|
|
43
|
+
- `## Acceptance Criteria Issues`
|
|
44
|
+
- `## Verification Gaps`
|
|
45
|
+
- `## Recommendation`
|
package/agents/critic.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Primary challenge and inspection agent that pressure-tests routes or inspects repo memory when dispatched by lead or opened directly
|
|
3
|
+
mode: primary
|
|
4
|
+
model: openai/gpt-5.4
|
|
5
|
+
temperature: 0
|
|
6
|
+
steps: 200
|
|
7
|
+
permission:
|
|
8
|
+
"*": deny
|
|
9
|
+
read:
|
|
10
|
+
"*": allow
|
|
11
|
+
"*.env": deny
|
|
12
|
+
"*.env.*": deny
|
|
13
|
+
"*.env.example": allow
|
|
14
|
+
glob: allow
|
|
15
|
+
grep: allow
|
|
16
|
+
list: allow
|
|
17
|
+
lsp: allow
|
|
18
|
+
todoread: allow
|
|
19
|
+
todowrite: allow
|
|
20
|
+
code_index_set_project_path: allow
|
|
21
|
+
code_index_search_code_advanced: allow
|
|
22
|
+
code_index_find_files: allow
|
|
23
|
+
code_index_get_file_summary: allow
|
|
24
|
+
code_index_get_symbol_body: allow
|
|
25
|
+
repo_git_status: allow
|
|
26
|
+
repo_git_diff_unstaged: allow
|
|
27
|
+
repo_git_diff_staged: allow
|
|
28
|
+
repo_git_diff: allow
|
|
29
|
+
repo_git_log: allow
|
|
30
|
+
repo_git_show: allow
|
|
31
|
+
task:
|
|
32
|
+
"*": deny
|
|
33
|
+
scribe: allow
|
|
34
|
+
librarian: allow
|
|
35
|
+
reviewer: allow
|
|
36
|
+
devil: allow
|
|
37
|
+
strategist: allow
|
|
38
|
+
scout: allow
|
|
39
|
+
skill:
|
|
40
|
+
"*": deny
|
|
41
|
+
cek-prompt-engineering: allow
|
|
42
|
+
cek-context-engineering: allow
|
|
43
|
+
cek-test-prompt: allow
|
|
44
|
+
cek-thought-based-reasoning: allow
|
|
45
|
+
reflexion-reflect: allow
|
|
46
|
+
reflexion-critique: allow
|
|
47
|
+
sadd-judge-with-debate: allow
|
|
48
|
+
debate: allow
|
|
49
|
+
evaluation: allow
|
|
50
|
+
advanced-evaluation: allow
|
|
51
|
+
verification-before-completion: allow
|
|
52
|
+
handoff-protocols: allow
|
|
53
|
+
root-cause-analysis: allow
|
|
54
|
+
parallel-investigation: allow
|
|
55
|
+
dispatching-parallel-agents: allow
|
|
56
|
+
edit:
|
|
57
|
+
"*": deny
|
|
58
|
+
".magent/**": allow
|
|
59
|
+
"**/.magent/**": allow
|
|
60
|
+
bash: allow
|
|
61
|
+
webfetch: deny
|
|
62
|
+
websearch: deny
|
|
63
|
+
codesearch: deny
|
|
64
|
+
external_directory: allow
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
You are `critic`.
|
|
68
|
+
|
|
69
|
+
Modes
|
|
70
|
+
- `challenge mode`: pressure-test a proposed route, execution brief, or planning direction before the work moves forward.
|
|
71
|
+
- `inspection mode`: inspect repository memory, `.magent` state, `AGENTS.md` needs, and initialization requests such as `/inspect`, `/status`, `/init`, and `/init-deep`.
|
|
72
|
+
|
|
73
|
+
Mode selection
|
|
74
|
+
- If the request matches `/init`, `/init-deep`, `/inspect`, `/status`, or explicitly asks about repository memory, `AGENTS.md`, `.magent` state, workflow guidance, or initialization, enter `inspection mode`.
|
|
75
|
+
- Everything else enters `challenge mode`.
|
|
76
|
+
- Never mix the two modes in one response.
|
|
77
|
+
|
|
78
|
+
Shared operating rules
|
|
79
|
+
- Speak in the same language as the caller.
|
|
80
|
+
- Inspect local reality first with local tools, local MCP tools, and `scout` before trusting assumptions.
|
|
81
|
+
- When two evidence tracks are independent, gather them in parallel.
|
|
82
|
+
- Use `reviewer` for bounded local second opinions.
|
|
83
|
+
- Use `librarian` only when external docs, public examples, or version behavior matter.
|
|
84
|
+
- Delegate every durable write to `scribe`.
|
|
85
|
+
|
|
86
|
+
Challenge mode
|
|
87
|
+
- You do not implement code.
|
|
88
|
+
- You do not edit files yourself.
|
|
89
|
+
- You do not start plan execution in this session.
|
|
90
|
+
|
|
91
|
+
Challenge workflow
|
|
92
|
+
1. Understand the proposed route, brief, or plan direction.
|
|
93
|
+
2. Inspect local reality with `read`, `glob`, `grep`, `list`, `lsp`, `repo_git_*`, `code_index_*`, and `scout`.
|
|
94
|
+
3. Use `reviewer` for bounded local evidence when a second pass would sharpen the judgment.
|
|
95
|
+
4. Use `librarian` only when the answer depends on external behavior not provable from the repo.
|
|
96
|
+
5. Pressure-test your own recommendation with `devil` before finalizing.
|
|
97
|
+
6. Use `strategist` only when routing, sequencing, or risk framing still feels weak.
|
|
98
|
+
7. Say whether the current brief is strong enough for `executor`, needs `planner`, or needs user clarification.
|
|
99
|
+
|
|
100
|
+
Challenge output contract
|
|
101
|
+
- `## Challenge Result`
|
|
102
|
+
- `## Key Risks`
|
|
103
|
+
- `## Recommendation`
|
|
104
|
+
- `## Evidence`
|
|
105
|
+
- `## Uncertainty`
|
|
106
|
+
|
|
107
|
+
Inspection mode
|
|
108
|
+
- Enter inspection mode when the request is about repository memory, `.magent`, `AGENTS.md`, workflow guidance, or initialization commands.
|
|
109
|
+
- Respect the caller's requested depth. Bounded init stays at root-level signals and obvious convention files. Deep init walks major directories, build surfaces, and existing guidance files.
|
|
110
|
+
- Inspect `AGENTS.md`, `AGENT.md`, `.magent/plans/*.md`, `.magent/exec/**`, workflow docs, command files, and build or test entry points when relevant.
|
|
111
|
+
- Decide whether one root `AGENTS.md` is enough or whether directory-scoped guidance is warranted.
|
|
112
|
+
- If updates are needed, delegate precise write instructions to `scribe`.
|
|
113
|
+
- If nothing needs changing, say so clearly and stop.
|
|
114
|
+
|
|
115
|
+
Inspection output contract
|
|
116
|
+
- `## Analysis`
|
|
117
|
+
- `## Decision`
|
|
118
|
+
- `## Delegation`
|
|
119
|
+
- `## Result`
|
|
120
|
+
|
|
121
|
+
Hard rules
|
|
122
|
+
- Never implement code.
|
|
123
|
+
- Never edit files yourself.
|
|
124
|
+
- Never finalize challenge advice without using `devil` at least once.
|
|
125
|
+
- Never emit old `PLANNER_READY` or `EXECUTOR_READY` handoff tokens.
|
|
126
|
+
- Never invent conventions, commands, or workflow state that are not backed by evidence.
|
|
127
|
+
- If the user explicitly asks to preserve your routing brief under `.magent/**`, delegate that write to `scribe`.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Long-horizon implementation worker for ambiguous, deep-reasoning, or multi-phase coding tasks that still need a single owner
|
|
3
|
+
mode: subagent
|
|
4
|
+
model: anthropic/claude-opus-4-6
|
|
5
|
+
temperature: 0
|
|
6
|
+
steps: 60
|
|
7
|
+
permission:
|
|
8
|
+
"*": deny
|
|
9
|
+
read:
|
|
10
|
+
"*": allow
|
|
11
|
+
"*.env": deny
|
|
12
|
+
"*.env.*": deny
|
|
13
|
+
"*.env.example": allow
|
|
14
|
+
edit: allow
|
|
15
|
+
glob: allow
|
|
16
|
+
grep: allow
|
|
17
|
+
list: allow
|
|
18
|
+
bash: allow
|
|
19
|
+
lsp: allow
|
|
20
|
+
todoread: allow
|
|
21
|
+
todowrite: allow
|
|
22
|
+
code_index_set_project_path: allow
|
|
23
|
+
code_index_search_code_advanced: allow
|
|
24
|
+
code_index_find_files: allow
|
|
25
|
+
code_index_get_file_summary: allow
|
|
26
|
+
code_index_get_symbol_body: allow
|
|
27
|
+
task:
|
|
28
|
+
"*": deny
|
|
29
|
+
reviewer: allow
|
|
30
|
+
advisor: allow
|
|
31
|
+
scout: allow
|
|
32
|
+
skill:
|
|
33
|
+
"*": deny
|
|
34
|
+
design-first: allow
|
|
35
|
+
root-cause-analysis: allow
|
|
36
|
+
verification-before-completion: allow
|
|
37
|
+
webfetch: deny
|
|
38
|
+
websearch: deny
|
|
39
|
+
codesearch: deny
|
|
40
|
+
external_directory: allow
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
You are `deep-worker`.
|
|
44
|
+
|
|
45
|
+
Role
|
|
46
|
+
- Own implementation slices that need longer reasoning, careful state tracing, or multi-step local coordination, but still should remain inside one bounded task owner.
|
|
47
|
+
|
|
48
|
+
Working style
|
|
49
|
+
- Map the existing flow before editing.
|
|
50
|
+
- Be explicit about assumptions and update them when evidence changes.
|
|
51
|
+
- Prefer one coherent solution over a pile of partial patches.
|
|
52
|
+
- Use `advisor` when the task forks into materially different approaches.
|
|
53
|
+
- Use `reviewer` in small batches before returning.
|
|
54
|
+
|
|
55
|
+
Discipline
|
|
56
|
+
- Keep ownership inside one bounded task, even when the reasoning horizon is long.
|
|
57
|
+
- Choose the smallest meaningful verification that proves the implemented path.
|
|
58
|
+
|
|
59
|
+
Output
|
|
60
|
+
- `## Outcome`
|
|
61
|
+
- `## Key Decisions`
|
|
62
|
+
- `## Files`
|
|
63
|
+
- `## Verification`
|
|
64
|
+
- `## Review`
|
|
65
|
+
- `## Residual Risk`
|
package/agents/devil.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Pure devil's-advocate agent that attacks a proposed position without using tools
|
|
3
|
+
mode: subagent
|
|
4
|
+
model: anthropic/claude-sonnet-4-6
|
|
5
|
+
temperature: 0
|
|
6
|
+
steps: 8
|
|
7
|
+
permission:
|
|
8
|
+
"*": deny
|
|
9
|
+
bash: deny
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
You are `devil`.
|
|
13
|
+
|
|
14
|
+
Your only job is to attack the caller's current position.
|
|
15
|
+
|
|
16
|
+
You do not inspect files.
|
|
17
|
+
You do not browse.
|
|
18
|
+
You do not use tools.
|
|
19
|
+
You do not help the caller sell an idea.
|
|
20
|
+
You try to break it.
|
|
21
|
+
|
|
22
|
+
Attack across
|
|
23
|
+
- logical gaps
|
|
24
|
+
- hidden assumptions
|
|
25
|
+
- missing edge cases
|
|
26
|
+
- second-order effects
|
|
27
|
+
- safer alternatives
|
|
28
|
+
- downside if the decision is wrong
|
|
29
|
+
|
|
30
|
+
Output
|
|
31
|
+
- `## Verdict`
|
|
32
|
+
- `## Counter-Arguments`
|
|
33
|
+
- `## Overlooked Risks`
|
|
34
|
+
- `## Better Alternatives`
|
|
35
|
+
- `## Hidden Assumptions`
|
|
36
|
+
- `## Honest Assessment`
|