Update the guide to the current release (v1.16.2, 2026-06-05), verified against opencode.ai/docs and github.com/anomalyco/opencode. Correctness fixes: - Plugins: tool.execute.before/after and shell.env are top-level hooks with an (input, output) signature, not event.type values. Rewrite both shipped example plugins plus the docs/migration examples so they fire. - Permissions: bash glob maps resolve last-matching-rule-wins (catch-all "*" first), not most-specific-wins. Fix prose, reorder examples, and fix the shipped opencode.json (rm -rf* deny was shadowed by a later rm *). - Drop non-existent permission keys repo_clone/repo_overview (15 keys, not 17); fix steps (integer), deprecate maxSteps/tools, move reasoningEffort into model options; fix the `mise` install command. Currency updates: - v1.15.4 -> v1.16.2; add v1.16 highlights and a changelog section. - Refresh OpenCode Zen lineup/pricing (Claude Opus 4.8, gpt-5.4, gemini-3.5-flash, qwen3.7, grok-build-0.1; correct free-tier IDs). - Add `opencode mcp add`, run --replay, extra skill paths, shift+tab, and native GitHub commands; correct the specialist-prompt count; bump dates. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Specialized Agents
Starting points, not authoritative wisdom. These are one set of defensible defaults for common engineering roles — copy them to
.opencode/agents/<name>.mdand edit them to match your stack, your conventions, and your taste. They encode opinions that a senior engineer on your team might disagree with, which is fine — the value is having a coherent starting point, not in any one rule being universally right.
When something in a prompt says "always X, never Y," read it as "by default, X — but override per project in your
AGENTS.mdif Y is correct for you."
How to use
Each role has:
- A system prompt under
system-prompts/— copy verbatim or as a starting point - A short description under
descriptions/— what the role focuses on and when to reach for it
To install one in your project:
mkdir -p .opencode/agents
cp specialized-agents/system-prompts/code-reviewer-prompt.md .opencode/agents/code-reviewer.md
The filename you choose becomes the agent's mention name (@code-reviewer).
You can also reference the prompt file from opencode.json without copying:
{
"agent": {
"code-reviewer": {
"description": "Senior code reviewer",
"mode": "subagent",
"model": "anthropic/claude-sonnet-4-5",
"prompt": "{file:./specialized-agents/system-prompts/code-reviewer-prompt.md}",
"permission": { "edit": "deny" }
}
}
}
Available roles
| Role | Mode | Reach for it when… | Prompt | Description |
|---|---|---|---|---|
| Code Reviewer | subagent | Surface bugs / security / perf / maintainability in a diff or branch | prompt | description |
| Security Reviewer | subagent | Audit code for OWASP-style vulnerabilities | prompt | description |
| Backend Engineer | primary | TypeScript/Go/Python API work, DB integration, REST/GraphQL | prompt | description |
| Frontend Engineer | primary | React/Tailwind/TypeScript UI work, accessibility, component design | prompt | description |
| Tech Lead | primary | Architectural decisions, cross-team trade-offs, sequencing work | prompt | description |
| UX Engineer | primary | Component-first UI work, design-system alignment | prompt | description |
| Database Engineer | primary | Schema design, migrations, query performance | prompt | description |
💡 These are starting points. Edit the prompts to match your stack — replace generic guidance with your actual conventions, technologies, and naming.
Patterns
Sequential review
[build] > implement the OAuth refresh endpoint
[build] > @code-reviewer review the changes
[build] > @security-reviewer audit the same files
[build] > address the high-severity findings
Parallel research
> @backend-engineer propose a migration plan for the payments service
> @database-engineer review the schema implications
> @tech-lead decide which proposal to ship
Persistent specialist primary
For ongoing work in a single area, install a role as a primary agent (mode: primary or mode: all) so it's a Tab target.
cp specialized-agents/system-prompts/frontend-engineer-prompt.md .opencode/agents/frontend.md
# Edit the frontmatter to `mode: primary`, then Tab in the TUI cycles
# [build] ↔ [plan] ↔ [frontend]
Customizing
Three things to adapt before using these in earnest:
- Tech stack lines — the prompts mention "TypeScript, React, Tailwind" etc. Replace with your actual stack.
- Repo-specific conventions — point at your
AGENTS.mdand let it carry the conventions. - Permission profiles — every role's permission map is conservative by default. Loosen
bashpatterns for commands your team runs constantly.
The prompts are MIT-licensed (same as the repo). Fork them.