This guide explains how the custom agents in this repo work, when to use each one, and how they fit into real OpenCode workflows.
Goal: keep execution fast, safe, and low-friction while preserving the current default (build). ⚡
| Agent | Type | Main job | Can edit code? | Best moment to use |
|---|---|---|---|---|
build |
primary (default) | Direct implementation | Yes | Small/clear tasks, quick fixes |
orchestrator |
primary | Lead complex multi-step delivery + delegate specialists | Yes | Medium/large tasks, end-to-end execution |
explore |
subagent | Internal codebase discovery and pattern finding | No | "Where is X?" / multi-module discovery |
librarian |
subagent | External docs and OSS evidence lookup | No | Framework/library behavior, upstream examples |
oracle |
subagent | High-signal architecture/debug review | No | Hard tradeoffs, repeated failed attempts |
verifier |
subagent | Run/interpret tests, lint, build | No | After meaningful code changes |
reviewer |
subagent | Risk/correctness/maintainability review | No | Before declaring done |
release-scribe |
subagent | PR/changelog/release notes drafting | No | Final communication and release prep |
buildremains the default for speed and familiarity.orchestratoris the execution lead for bigger flows.- Specialist subagents are intentionally read-only to reduce accidental drift.
- Completion should only happen after implementation + validation + review gates pass.
- Model allocation defaults and fallbacks are documented in
docs/model-allocation-policy.md.
Architecture and safety contracts:
docs/agent-architecture.mddocs/agent-tool-restrictions.md
Think of it as:
orchestrator -> delegates research/review tasks -> executes changes -> validates -> reports
In OpenCode prompt:
- Press
Tab - Pick agent (
build,plan, ororchestrator) - Run your prompt normally
Our custom specialist subagents are intentionally marked hidden, so they stay out of the Tab switcher and are used through delegation or explicit @agent mention instead.
You can verify available agents with:
opencode agent listValidate agent contract + runtime wiring with:
This now also verifies orchestration policy markers in the nearest AGENTS.md (quickplay + WT checklist + pressure defaults).
/agent-doctor
/agent-doctor --json
Runtime discoverability commands:
/agent-catalog list
/agent-catalog explain orchestrator
/agent-catalog doctor --json
When these hints appear automatically in execution flow:
- delegation router injects
/agent-catalog explain <subagent>when it infers or applies routing metadata - fallback orchestrator injects
/agent-catalog list+ explain hint when it rewrites a failed delegation path
Use when issue is isolated and file location is clear.
Example prompt:
Fix the null-check bug in auth token parsing and run relevant tests.
Why: minimal overhead, direct implementation is fastest.
Use when request spans multiple modules and requires verification/review.
Example prompt:
Implement end-to-end support for workspace profile presets, including docs and tests.
Keep iterating until done or a concrete blocker.
Expected flow:
orchestratormay askexploreto map impacted files- implements changes
- uses
verifierfor checks - uses
reviewerbefore final done claim
Example prompt:
Find official docs and upstream examples for OpenCode agent file format and summarize best practice for read-only subagents.
Expected output:
- sources with links
- concise recommendation
- tradeoffs/notes
Example prompt:
Review this plan: replace default build flow with orchestrator globally.
Assess risks, migration strategy, and rollback plan.
Expected output:
- one recommended path
- key risks
- concrete next steps + effort sizing
Example prompt:
Validate this branch and give me a ship/no-ship recommendation.
Run the fastest high-signal checks first, then broaden if needed.
Expected output:
- exact commands + results
- issue list by severity
- single best next action
Example prompt:
Draft PR summary + changelog bullets from this branch diff.
Include testing notes and user-facing impact.
Expected output:
- concise PR summary
- Adds/Changes/Fixes/Removals bullets
- release-note style blurb
Use build when:
- scope is clear
- <= 2 files touched
- no external research needed
Use orchestrator when:
- cross-module task
- unknown code ownership/locations
- non-trivial validation/review needed
- you want "continue iterating until done"
For non-trivial work:
orchestratorstartsexploreif 2+ modules or unclear ownershipstrategic-plannerwhen sequencing or milestone order is unclearambiguity-analystwhen assumptions, acceptance criteria, or scope boundaries are still fuzzylibrarianif external behavior matters- implementation by
orchestratorwith a single writer by default verifierfor checksreviewerfinal risk passrelease-scribeif PR/release text needed
Escalate to oracle when:
- 2+ failed fix attempts
- architecture/security/performance tradeoff is ambiguous
Planner bundle examples:
explore+strategic-planner: when you know work is large but need file/sequence mapping firstexplore+ambiguity-analyst: when requirements are incomplete and the main need is unknown surfacingstrategic-planner+plan-critic: when the plan exists but sequencing, feasibility, or testability still need stress-testing- after planner fan-out, return to one writer unless explicit reservations make parallel writers safe
Planner + reservation example:
git worktree add ../my_opencode-wt-planning -b feat/planning-slice HEAD
/reservation set --own-paths "docs/**" --active-paths "docs/**,agent/**" --writer-count 1
Select `orchestrator`
Delegate `explore` + `strategic-planner` to map docs and sequencing
If scope is still fuzzy, add `ambiguity-analyst`
Implement with one writer in the linked worktree
/reservation clear
Use this when planning work needs a real reserved path boundary before implementation starts.
| Agent | Avoid when |
|---|---|
orchestrator |
task is trivial and single-file with no delegation need |
explore |
external documentation research is primary |
librarian |
only internal code discovery is needed |
oracle |
straightforward implementation is already clear |
verifier |
design/architecture decisions are needed instead of command execution |
reviewer |
no meaningful diff exists to review |
release-scribe |
implementation/debugging is needed rather than communication output |
strategic-planner |
immediate coding is required and plan is already concrete |
ambiguity-analyst |
scope is already unambiguous and execution can proceed directly |
plan-critic |
task is too early for critique (no concrete plan exists yet) |
- Read-only subagents must not edit files.
- Runtime hook guard blocks delegated commit/PR/edit intents for read-only subagents; keep mutating operations on the primary agent.
- Do not declare done without validation evidence.
- If blocked, return exact blocker + evidence + next best action.
- Prefer practical outcomes over over-engineering.
- Agent files are stored in this repo under
agent/*.md. - Source-of-truth specs live in
agent/specs/*.jsonand generateagent/*.mdviascripts/build_agents.py. - Installer copies them to
~/.config/opencode/agent/. buildremains default viaopencode.json(default_agent: build).
Generation commands:
python3 scripts/build_agents.py --profile balanced
python3 scripts/build_agents.py --profile balanced --checkIf agents are not visible, run:
REPO_URL="/path/to/my_opencode" REPO_REF="main" ./install.sh
opencode agent list- Keep
buildfor quick tasks. - Use
orchestratorfor complex "keep going" execution. - Use specialist subagents for focused read-only discovery, validation, review, and release communication.