A strict-orchestrator, multi-agent workflow for OpenCode — one router agent that never writes code, and a roster of specialists each pinned to the cheapest model that can do the job.
Most "AI does everything" setups burn tokens because one powerful model handles research, planning, coding, and review inside a single long-lived context. OpenCode Orchestrator Kit splits that into a routing layer and 14 specialists, so every step runs in the cheapest model capable of it — and the expensive model only ever sees the slice of work it actually needs.
It self-bootstraps on any repository, known or unknown: the profiler agent detects the stack (or interviews you for an empty repo), scaffolds a lightweight memory system (.context/) and a plan kanban (plan/), and reports back so the orchestrator can route correctly from the very first session.
Works with plain opencode CLI — no plugin required. Optional notes for OpenCode Studio users live in docs/SETUP-OPENCODE-STUDIO.md.
The orchestrator never touches application code. It only classifies, delegates, and checkpoints.
- 🔎 Bootstrap —
profilerfingerprints the repo (stack, CI, structure) and scaffolds.context/andplan/on first run. - 🧭 Route — the orchestrator reads the request and session memory, then picks the most specific specialist (or a small parallel/sequential subtask set).
- 🛠️ Delegate — each specialist gets a precise, RFC-2119-worded 9-section task spec (Goal, Success Criteria, Scope, Safety, Inputs, Outputs, Test Plan, Verification, Edge Cases) — never a vague prompt.
- ✅ Verify & checkpoint — results are validated against the spec,
.context/progress.mdis updated, and multi-phase plans advance one phase at a time with fresh context per phase.
"Add refresh-token rotation to the auth service."
| Step | Agent | What happens |
|---|---|---|
| 1 | explorer |
Reads the current auth flow, read-only. |
| 2 | planner |
Turns findings into a phased plan in plan/draft/. |
| 3 | developer-fixer |
Implements one phase at a time, fresh context each time — no compounding drift across a long session. |
| 4 | test-engineer |
Writes and runs tests for the new rotation logic. |
| 5 | security |
Reviews the auth-sensitive change before it reaches plan/complete/. |
The orchestrator itself never edits auth.ts — it only routes, checkpoints, and moves the plan file across the kanban.
- Routes, never executes —
agents/orchestrator.mdcan only classify and delegate; it cannot edit application code or run tests. - Matches model to task — cheap/local models for exploration and bootstrapping, stronger models reserved for design, implementation, and review.
- Keeps context small — session memory (
progress.md,decisions.md,issues.md) is bullet-point only and auto-archived past ~3k tokens. - Adapts to any repo —
profilerruns once per repo, detects the stack via manifest globbing (with Repomix as fallback for ambiguous/monorepo cases), and never touches application code.
This is the single table the README uses to answer "which agent handles X?". The six required concerns are pinned to one specialist each, plus the orchestrator and the helpers that exist for completeness:
| Concern | Primary agent | Notes |
|---|---|---|
| Orchestration (routing, checkpointing) | orchestrator |
Sole entry point — only mode: primary agent. Never writes application code. |
| Exploration (codebase, file, symbol research) | explorer |
Read-only. |
| Planning (turns exploration into phased plans) | planner |
Writes to plan/draft/ only. |
| Implementation (one phase at a time, TDD) | developer-fixer |
Follows the 9-section task spec. |
| Testing (test authoring, coverage, reproduction) | test-engineer |
|
| Review (general correctness / quality) | code-reviewer |
Optional distinct from security review. |
| Security (vulnerability, threat-model, hardening) | security |
Routed for auth, crypto, input-handling, secrets changes. |
Full contracts, permissions, and model fallbacks are defined in each agents/*.md file
(with the pc-doctor and writer specialists living in extras/*.md instead) and
summarized in AGENTS.md. The roster is partitioned by tier:
| Tier | Agents | Installed by default? |
|---|---|---|
| Core routing (always installed) | orchestrator, profiler, explorer, oracle, planner |
✅ Yes |
| Core delivery (always installed) | developer-fixer, test-engineer, code-reviewer, security |
✅ Yes |
| Operations helpers (always installed, routed only on matching failure) | build-helper, npm-helper, deploy-helper |
✅ Yes |
| Explicit opt-in extras | pc-doctor (Windows-local only), writer (docs generation) |
❌ --with-extras only |
| Optional, explicitly opt-in | librarian (docs lookups, remote examples) |
❌ Installed only if you add it yourself |
librarian, pc-doctor, and writer are explicit opt-in by design: most users do not
need a Windows-only pc-doctor, a docs-generation writer, or an internet-fetching
librarian on every project. Pass --with-extras to install pc-doctor and writer
when you want them. See Customizing for the exact flag and how to add
librarian if you want it.
Heads-up: this kit ships with a known-good model profile (
default) so it can be installed and validated without any provider setup, but to actually run agents you need at least one usable provider/model mapping of your own. The default profile references provider IDs that are not yours; switch to thegenericpreset and edit.opencode/models.config.jsonbefore your first/start-session— see Choose your model profile below.
- OpenCode installed and on
PATH(opencode --version). - Bash available on your shell —
install.shis a bash script. Supported: Linux, macOS, and Windows under Git Bash, MSYS, or Cygwin. Plaincmd.exe/ PowerShell are not supported. - A git checkout of this repo, or the files extracted locally.
- At least one usable provider account you can point at least one tier to. OpenCode does not bundle provider credentials. You will configure this in step 3.
From the repo root, run the scripted installer. The installer seeds
.opencode/models.config.json from the bundled template and runs the Phase 1
model-profile validator before any file is written to the target directory.
# Project-only — installs into ./.opencode/ and ./AGENTS.md in the current repo
./install.sh project
# Global — installs into ~/.config/opencode/ for every project on this machine
./install.sh globalThe installer also accepts:
| Flag | Effect |
|---|---|
--symlink |
Symlink instead of copy (so git pull in this repo updates every consumer). |
--with-extras |
Also install extras/ (pc-doctor, writer). Off by default. |
--with-examples |
Also install skills/examples/ (language-specific skill examples). Off by default. |
--skip-validation |
Skip the model-profile validator. Not recommended — only for emergency recovery. |
If you cannot use the installer, the manual path is the same five items it copies:
AGENTS.md, CONTRIBUTING.md, agents/, skills/, and command/. Place them where
OpenCode looks (project root for project-only, or ~/.config/opencode/ for global).
extras/ is not part of the manual default — copy it only if you want the
opt-in specialists.
The kit abstracts hardcoded model IDs into five logical tier tokens so you can
swap providers without editing any agent file. Tier tokens are written into agent
model: lines as {{TIER_*}}; the active profile resolves them at install/load
time. Edit the user-local copy, never agent frontmatter.
The five tiers, in canonical order:
| Tier token | Default agent(s) | Role | Required? |
|---|---|---|---|
TIER_ROUTER |
orchestrator |
Routing / checkpointing. | Optional (falls back to TIER_REASONING). |
TIER_REASONING |
oracle, security, planner |
Deep reasoning / architecture. | Required. |
TIER_CODE |
developer-fixer, test-engineer |
Implementation + test writing. | Required. |
TIER_FAST |
profiler, explorer, build-helper, npm-helper, deploy-helper |
Lightweight utility / high-throughput. | Required. |
TIER_REVIEW |
code-reviewer |
Correctness / quality review. | Optional (falls back to TIER_CODE). |
Two profiles are shipped in templates/models.config.json:
| Profile | Status | Use when |
|---|---|---|
default |
Ready to use out-of-the-box (known-good provider IDs). | You do not need to test your own setup yet. |
generic |
Editable — every tier is a placeholder/* sentinel. |
You want to point the kit at your own providers. |
To use your own providers:
- Set
default_presetto"generic"in.opencode/models.config.json(or run./install.sh --skip-validationafter copyingtemplates/models.config.json). - Replace every
placeholder/*value underpresets.generic.modelswith your real<provider>/<model>IDs (the same shape OpenCode consumes natively). - Validate before installing:
It must exit 0 and print
bash scripts/validate-models.sh
OK:for the validator to be satisfied.
Do not edit the model: field of any agent in agents/*.md or extras/*.md
directly. The five-tier abstraction is the supported extension point. If a tier
value is wrong, fix it in .opencode/models.config.json. Direct agent-frontmatter
edits survive git pull once and silently regress on the next update.
See docs/CONFIGURATION.md for the full tier-resolution rules, fallback chains,
and placeholder policy.
Inside the target repo:
opencodeInvoke the orchestrator (@orchestrator or set as your default agent), then run
/start-session at the start of every new session, before any other instruction.
It tells the orchestrator to run its bootstrap cycle explicitly: delegate to profiler
if there is no PROJECT-PROFILE.md/plan/ structure yet, load
.context/progress.md/decisions.md/issues.md, and reply with a 3–4 line
Italian summary of the stack, current status, and latest issue/decision before waiting
for your next instruction. See command/start-session.md.
If you manage OpenCode via opencode-studio profiles, point that profile's config directory at this kit (or symlink the folders into it). See docs/SETUP-OPENCODE-STUDIO.md for the exact steps and a known caveat around global AGENTS.md precedence.
- Swap providers per tier by editing
.opencode/models.config.json. Setdefault_presetto the profile you want active, and edit itsmodels.*values. Do not edit themodel:field in any agent's frontmatter — that path bypasses the tier system and breaks on the next kit update. - Opt into extras with
./install.sh --with-extrasto also installpc-doctorandwriter.librarianships inagents/but is treated as opt-in by the orchestrator's routing rules; copy it manually if you want it available everywhere. Operations helpers (build-helper,npm-helper,deploy-helper) are installed by default and only routed on a matching toolchain failure. - Add project-specific skills under
skills/<name>/SKILL.md; the orchestrator loads them on demand via theskilltool. - Engineering baseline (secrets hygiene, git hygiene, definition of done)
lives in
CONTRIBUTING.mdand applies globally unless a project overrides it.
MIT — see LICENSE.txt. Contributions welcome — see CONTRIBUTING.md.