knowledge/opencode-agent-creator/SKILL.md
Design, build, and tune OpenCode CLI agents and multi-agent teams. Use when asked to create an OpenCode agent, a subagent, an orchestrator/supervisor, a roster of specialists, a swarm/parallel fan-out, or an agent .md / opencode.json config. Covers agent modes (primary/subagent/all), the built-in agents (build, plan, general, explore, scout), the native Task tool for hierarchical delegation, permission.task dispatch whitelists, per-agent model/cost routing (and the no-per-task-model constraint plus the background-agents plugin workaround), the supervisor/swarm/mesh/template topologies and which are natively supported, custom tools, plugins, and secrets. Not for AGENTS.md instruction files (use agent-md-creator), generic Agent Skills (use skill-creator), or Claude Code subagents (use agents-claude-creator).
npx skillsauth add aeondave/malskill opencode-agent-creatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build precise, functional, professional OpenCode agents and agent teams without re-researching the platform. The reference shape is one visible primary "supervisor" that plans and delegates, dispatching a roster of model-tiered subagents through the native task tool. This skill encodes the official OpenCode agent model plus field-tested orchestration, topology, and cost-routing patterns.
Scope: this skill creates OpenCode agents (the runtime actors). For repo instruction files use
agent-md-creator; for portable Agent Skills useskill-creator; for Claude Code subagents useagents-claude-creator. An OpenCode subagent often loads a Skill to get its methodology — the two compose via theskilltool.
OpenCode fixes the model per agent. The native task tool accepts only description, prompt, and subagent_type — there is no model parameter. A primary agent cannot pick a model per dispatch at runtime. Therefore:
model: into each agent), not something the supervisor does live.x-operator and x-operator-heavy) and let the supervisor route between them.Internalize this first — it is why the architecture looks the way it does.
A dispatched subagent starts cold. It sees only the dispatch prompt — not the conversation, the files the primary read, the skills the primary loaded, or the active agent mode. Any skill name, target context, constraint, or behavioral instruction must be written into the dispatch packet or it does not cross. Design each subagent prompt as if briefing a brand-new contractor who can read the repo but was in none of your meetings.
.md; skip the orchestration sections.Pick the topology by what the work needs (full catalog + native-support status: references/multi-agent-topologies.md):
| Topology | Shape | OpenCode support |
|---|---|---|
| Subagent | one specialist invoked by a primary or @mention | native (mode: subagent) |
| Supervisor / hierarchical | one primary plans → dispatches specialists, synthesizes | native, recommended (task tool + permission.task) |
| Swarm / parallel | primary fans out many task calls at once (dependency-batched) | native; synchronous unless background (experimental/plugin) |
| Mesh / peer-to-peer | subagents call each other directly | not reliably native — emulate hub-and-spoke via the supervisor |
| Template | reusable agent scaffolds you instantiate per project | opencode agent create + the skeletons in assets/ |
OpenCode ships agents — extend or route to them instead of cloning:
build (all tools), plan (edits + bash gated to ask). (compaction, title, summary are hidden system primaries.)general (full tools except todo; the docs' own answer to "run multiple units of work in parallel"), explore (fast read-only codebase search), scout (read-only external-docs/dependency research).Create a custom agent only when a focused role, tool boundary, or pinned model beats the built-ins.
~/.config/opencode/agents/<name>.md (global) or .opencode/agents/<name>.md (project). Filename = agent name (no name field in frontmatter). Frontmatter + system-prompt body.agent key in opencode.json (terse model/permission overrides).opencode agent create (interactive) or non-interactively with --path --description --mode --permissions --model. List with opencode agent list."default_agent": "<supervisor-name>" in opencode.json (must be a primary).Full field reference: references/agent-config-reference.md. Copy-ready skeletons: assets/.
Separate by independent decision boundary, not convenience:
mode: primary, the only CLI-visible agent. Plans, gates scope, decomposes, dispatches, reviews evidence, synthesizes. Does not execute noisy/destructive work itself.mode: subagent, hidden: true. One bounded domain each, pinned to a capable model.mode: subagent, hidden: true. Trivial/bulk/token-heavy work (summarize, parse, public lookup, boilerplate), pinned to cheap/free models.Keep each subagent to one bounded question with one deliverable. If you cannot state its success signal in one sentence, split it. A scout-first habit (dispatch a read-only explore/scout to gather context before any write) keeps expensive agents cheap — see the OpenAgentsControl-derived discipline in references/multi-agent-topologies.md.
| Tier | Agent(s) | Model class | Rationale |
|---|---|---|---|
| Brain | supervisor | strongest available, or leave model unset to inherit the user's /models pick | only agent worth premium tokens |
| Specialist | domain subagents | capable mid model with strong tool-calling | real reasoning + tool use |
| Utility | helper subagents | free/cheap models | bulk work at ~zero cost |
Model id is always provider/model-id (e.g. github-copilot/gpt-5.4, opencode/big-pickle). Leaving a subagent's model unset makes it inherit the primary that invoked it — the native "fallback" and the single dial for the whole team. The Zen catalog, free tier, inheritance-as-fallback, the per-call-model plugin workaround, and the free-model privacy caveat are in references/model-tiering.md.
* first):
permission:
task:
"*": deny
"specialist-*": allow
"utility-*": allow
If it should dispatch-and-inspect but never execute, add edit: deny and bash: deny (it keeps read/grep/glob/list to review results).permission: { task: deny }. OpenCode has no recursion depth guard (issue #18100), and subagent peer-delegation is unreliable anyway (issue #7296). Keep delegation strictly hierarchical: only the supervisor dispatches. Without task: deny, a subagent can spawn subagents and create runaway sessions.skill tool.The body shape, dispatch protocol, anti-loop/delegation rules, and parallel-batch discipline: references/orchestrator-pattern.md. Two prompt styles work — a lean imperative body (Claude-style) or the XML-structured <role>/<task>/<workflow> body OpenAgentsControl uses; pick by team convention, both are covered. Ready-to-adapt skeletons: assets/.
~/.config/opencode/tools/*.ts): TypeScript functions the agent calls like built-ins; can shell out to Python. Best for deterministic wrappers (recursive web research, output parsers, redaction) that beat an LLM on cost and reliability.plugin array or ~/.config/opencode/plugins/): npm or local; hook lifecycle events. High-value: opencode-background-agents (async read-only delegation that survives compaction), context pruning, persistent memory.APIs, the ecosystem plugin shortlist, experimental flags, and a worked deep-research tool: references/plugins-and-tools.md.
Never hardcode keys/tokens in opencode.json — use {env:VAR} or {file:~/.secrets/x}. OpenCode does not auto-load .env, and {env:} resolves at startup before plugins, so the variable must already exist in the environment. On Windows, a small launcher that loads a .env into the process then runs opencode is the reliable path — see references/plugins-and-tools.md.
---; name/filename match; model ids are real (opencode models). opencode.json parses if used.@mention a subagent directly (behavior), and give the supervisor a task that should fan out (routing). Verify it dispatches (not executes), respects the task whitelist, and that hidden agents stay out of the @ menu. Full method: references/triggering-and-testing.md.task: deny on subagents — invites recursive fan-out (no native depth guard).build/plan/general/explore/scout — extend or route to the built-ins.{env:}/{file:}.opencode.json field reference: mode, model, hidden, temperature, top_p, steps, reasoningEffort, color, disable, the full permission.* key list and permission.task globs, tools (legacy), default_agent, model variants, the built-in agents, opencode agent create/list CLI, and session navigation. Load when writing or debugging agent config.task tool: adaptable prompt skeletons (lean and XML-structured), dispatch protocol, wave parallelism, anti-loop guard, delegation discipline, cold-context packet rules. Load when building a team.opencode-background-agents, workspace, skillful, supermemory), experimental flags, a worked deep-research custom tool, and the secrets/.env handling pattern. Load when extending agents with tools, plugins, or env-based secrets.supervisor.md, code-reviewer.md (read-only), researcher.md (scout-style), summarizer.md (cheap utility). Read for concrete patterns.development
Auth/lab ref: Unicorn Engine CPU-only emulation for shellcode, decryptors, custom VM handlers, instruction tracing, memory hooks, and register-level experiments.
development
Auth/lab ref: Renode board and SoC simulation for MCU/RTOS firmware, UART/GPIO/peripheral modeling, GDB remote debugging, REPL platforms, and RESC scripts.
development
Auth/lab ref: Qiling OS-layer binary emulation for PE/ELF/Mach-O/UEFI/shellcode with rootfs, syscall/API hooks, filesystem mapping, and runtime patching.
databases
Auth/lab ref: QEMU user-mode and full-system emulation for cross-arch binaries, firmware, kernels, disks, serial consoles, networking, and GDB stubs.