Skip to content

Commit e708ebb

Browse files
committed
feat(plugin): add opencode permission block to all agents
Each agent under plugins/claude-code/agents/ now carries both: - Claude Code frontmatter: `tools:` and `disallowedTools:` (unchanged) - opencode frontmatter: `permission: { edit, bash, webfetch }` Each host reads only its own fields and ignores the other's. Because plugins/opencode/agents is symlinked to plugins/claude-code/agents, the opencode plugin now exposes proper opencode permission semantics from the same source files. Permission mapping mirrors the Claude Code tool list: - code-reviewer / context-scout: edit=deny, bash=deny, webfetch=deny - coder-agent / task-manager: edit=allow, bash=deny, webfetch=deny - context-manager: edit=allow, bash=allow, webfetch=deny - test-engineer: edit=allow, bash=allow, webfetch=deny - external-scout: edit=allow, bash=allow, webfetch=allow Updates plugins/opencode/AGENTS.md to reflect the dual-frontmatter approach.
1 parent c421033 commit e708ebb

8 files changed

Lines changed: 32 additions & 4 deletions

File tree

plugins/claude-code/agents/code-reviewer.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ description: |
1717
</example>
1818
tools: Read, Glob, Grep
1919
disallowedTools: Write, Edit, Bash, Task
20+
permission:
21+
edit: deny
22+
bash: deny
23+
webfetch: deny
2024
model: opus
2125
---
2226

plugins/claude-code/agents/coder-agent.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ description: |
1616
<commentary>A concrete implementation task with a specific file — coder-agent executes it.</commentary>
1717
</example>
1818
tools: Read, Write, Edit, Glob, Grep
19+
permission:
20+
edit: allow
21+
bash: deny
22+
webfetch: deny
1923
model: opus
2024
---
2125

plugins/claude-code/agents/context-manager.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
name: context-manager
33
description: Manages context files, discovers context roots, validates structure, and organizes project context
44
tools: Read, Write, Glob, Grep, Bash
5+
permission:
6+
edit: allow
7+
bash: allow
8+
webfetch: deny
59
model: sonnet
610
---
711

plugins/claude-code/agents/context-scout.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ description: |
1717
</example>
1818
tools: Read, Glob, Grep
1919
disallowedTools: Write, Edit, Bash, Task
20+
permission:
21+
edit: deny
22+
bash: deny
23+
webfetch: deny
2024
model: haiku
2125
---
2226

plugins/claude-code/agents/external-scout.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
name: external-scout
33
description: Fetches external library and framework documentation from Context7 API and other sources, caching results for offline use
44
tools: Read, Write, Bash, WebFetch
5+
permission:
6+
edit: allow
7+
bash: allow
8+
webfetch: allow
59
model: haiku
610
---
711

plugins/claude-code/agents/task-manager.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
name: task-manager
33
description: Break down complex features into atomic, verifiable subtasks with dependency tracking and JSON-based progress management
44
tools: Read, Write, Glob, Grep
5+
permission:
6+
edit: allow
7+
bash: deny
8+
webfetch: deny
59
model: sonnet
610
---
711

plugins/claude-code/agents/test-engineer.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
name: test-engineer
33
description: Test authoring and TDD specialist - writes comprehensive tests following project testing standards
44
tools: Read, Write, Edit, Bash
5+
permission:
6+
edit: allow
7+
bash: allow
8+
webfetch: deny
59
model: sonnet
610
---
711

plugins/opencode/AGENTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ truth — no copy drift.
2020

2121
## Known conversion gaps from Claude Code → opencode
2222

23-
- Agent frontmatter still uses Claude Code's `tools:` field. opencode prefers
24-
a `permission:` object (`edit`, `bash`, `read`, `task``allow|ask|deny`).
25-
Unknown fields are ignored, so this is non-fatal — but tighten permissions
26-
manually if you care.
23+
- Agent frontmatter carries both Claude Code's `tools:` / `disallowedTools:`
24+
fields and an opencode `permission:` block. Each host reads its own; the
25+
other ignores the unknown fields. If you adjust permissions, update both
26+
so the agents stay in sync across hosts.
2727
- Commands embed `${CLAUDE_PLUGIN_ROOT}` paths. opencode does not export that
2828
variable; the `oac-hooks.ts` plugin sets it for child processes when it
2929
spawns the session-start script, but inline command bodies that read the

0 commit comments

Comments
 (0)