Files
opencode-primer/specialized-agents/README.md
Wesam Abousaid b170bea020 feat(specialized-agents): seven drop-in role prompts with descriptions
Ready-to-copy prompts under specialized-agents/system-prompts/:
- code-reviewer-prompt.md (subagent, read-only)
- security-reviewer-prompt.md (subagent, read-only, CWE-aware)
- backend-engineer-prompt.md (primary or all)
- frontend-engineer-prompt.md (primary or all)
- tech-lead-prompt.md (primary, opus-tier)
- database-engineer-prompt.md (Postgres-first, adapts)
- ux-engineer-prompt.md (design-system-first)

Matching one-page descriptions in specialized-agents/descriptions/.

Every prompt opens with a "one defensible set of opinions, not the only
right answer" disclaimer so readers don't treat them as authoritative.
Stack-specific defaults (Tailwind, FastAPI, Postgres) are explicitly
overridable per project.

To install one:
  cp specialized-agents/system-prompts/code-reviewer-prompt.md \
     .opencode/agents/code-reviewer.md
or reference via {file:...} from opencode.json without copying.
2026-05-18 20:00:09 +02:00

4.3 KiB

Specialized Agents

Starting points, not authoritative wisdom. These are one set of defensible defaults for common engineering roles — copy them to .opencode/agents/<name>.md and 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.md if 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:

  1. Tech stack lines — the prompts mention "TypeScript, React, Tailwind" etc. Replace with your actual stack.
  2. Repo-specific conventions — point at your AGENTS.md and let it carry the conventions.
  3. Permission profiles — every role's permission map is conservative by default. Loosen bash patterns for commands your team runs constantly.

The prompts are MIT-licensed (same as the repo). Fork them.