A collection of OpenCode agent configuration files. No code, no build, no tests — only .md files that define agent behavior via YAML frontmatter + prompt body. Hosted on Gitee at aerlee/opencode-agents.
agents/
*.md # 29 agent definitions (2 primary + 27 subagent)
plugins/
image-paste-saver.js # Auto-saves pasted images to /tmp/ for vision-dev
README.md # Chinese (outdated — lists 18 agents, actual count is 29)
README.en.md # English (same)
LICENSE # MIT
Every file in agents/ uses this structure:
---
description: <Chinese description — this is what OpenCode uses to decide when to invoke the agent>
mode: primary | subagent
model: <provider/model-name>
temperature: <0.0-1.0>
tools: # optional — omit keys to allow all
write: false
edit: false
bash: false
---
<System prompt in English or Chinese>descriptionis always in Chinese — this is the trigger text OpenCode matches against. Match the style: role name + capabilities + trigger scenarios.mode: primarymeans the agent can be a top-level session. OnlyZero.mdandErribaba.mdare primary agents.- Zero.md (
opencode-go/mimo-v2.5) — rapid prototyping, multimodal (image input), lightweight tasks - Erribaba.md (
Xianyu/mimo-v2.5-pro) — production code, complex algorithms, deep analysis
- Zero.md (
mode: subagentmeans the agent is only invoked via delegation from a primary agent.- Filename = agent name used in delegation (e.g.,
reviewer.md→ delegate asreviewer). - Model naming: provider prefix matters — models include
opencode-go/mimo-v2.5,opencode-go/mimo-v2.5-pro,opencode-go/deepseek-v4-pro,opencode-go/kimi-k2.6,opencode-go/qwen3.7-plus,opencode-go/minimax-m2.7,opencode-go/glm-5.1. Primary agents use different providers:opencode-go/vsXianyu/. - Tool access defaults to all tools allowed when
toolskey is omitted (primary agents). Subagents that need to write code must explicitly setwrite: true, edit: true. Read-only subagents set all three tofalse. Agents needing shell access addbash: true.
| File | Model | Role |
|---|---|---|
Zero.md |
opencode-go/mimo-v2.5 |
Rapid prototyping, multimodal input, quick iteration |
Erribaba.md |
Xianyu/mimo-v2.5-pro |
Production code, complex algorithms, full-stack engineering |
| File | Model | Role |
|---|---|---|
architect.md |
opencode-go/glm-5.1 |
System architecture design |
frontend-reviewer.md |
opencode-go/mimo-v2.5 |
Frontend code review |
git-assistant.md |
opencode-go/mimo-v2.5 |
Git workflow assistance |
research.md |
opencode-go/qwen3.7-plus |
Technical research |
reviewer.md |
opencode-go/deepseek-v4-pro |
Code quality review (Stage 2) |
security-auditor.md |
opencode-go/deepseek-v4-pro |
Security audit |
spec-reviewer.md |
opencode-go/deepseek-v4-pro |
Spec compliance review (Stage 1) |
Plus perf-optimizer and validator — read-only for file edits but have bash: true for running commands.
| File | Model | Has bash | Role |
|---|---|---|---|
api-designer.md |
opencode-go/mimo-v2.5-pro |
✗ | API endpoint design |
code-generator.md |
opencode-go/mimo-v2.5-pro |
✗ | Code generation |
db-engineer.md |
opencode-go/deepseek-v4-pro |
✓ | Database engineering |
debugger.md |
opencode-go/deepseek-v4-pro |
✓ | Bug debugging |
devops.md |
opencode-go/mimo-v2.5-pro |
✓ | DevOps/CI-CD |
doc-writer.md |
opencode-go/qwen3.7-plus |
✗ | Documentation |
e2e-tester.md |
opencode-go/mimo-v2.5-pro |
✗ | E2E testing |
executor.md |
opencode-go/minimax-m2.7 |
✓ | Command execution |
frontend-dev.md |
opencode-go/kimi-k2.6 |
✗ | Frontend development |
migration.md |
opencode-go/deepseek-v4-pro |
✓ | System migration |
plan-writer.md |
opencode-go/mimo-v2.5-pro |
✗ | Implementation planning |
project-manager.md |
opencode-go/qwen3.7-plus |
✗ | Project management |
refactorer.md |
opencode-go/mimo-v2.5-pro |
✗ | Code refactoring |
software-engineer.md |
opencode-go/mimo-v2.5 |
✓ | Full-stack implementation |
test-writer.md |
opencode-go/mimo-v2.5-pro |
✗ | Test writing |
ui-designer.md |
opencode-go/kimi-k2.6 |
✗ | UI design |
vision-dev.md |
opencode-go/mimo-v2.5 |
✗ | Visual development |
workflow-orchestrator.md |
opencode-go/mimo-v2.5-pro |
✓ | Workflow orchestration |
- Match the frontmatter field order:
description,mode,model,temperature, then optionaltools. - Write
descriptionin Chinese — start with the role name (e.g., "代码审查智能体"), then describe capabilities and trigger scenarios. - Keep system prompts concise and structured with
##sections. - Primary agents must list all available subagents in their body — update both
Zero.mdandErribaba.mdif adding a new subagent. - Do not add build/CI/tooling — this repo has none and needs none.
- After adding a new agent, update the tables in this file.
The agent system supports a structured development workflow inspired by MiMo Code's Compose pattern. This workflow is optional but recommended for complex, multi-step tasks.
User Request
↓
[Phase 1: Brainstorm] — architect, research
↓
[Phase 2: Plan] — plan-writer, project-manager
↓
[Phase 3: Execute] — test-writer, code-generator, executor
↓
[Phase 4: Review] — spec-reviewer (Stage 1), reviewer (Stage 2)
↓
[Phase 5: Merge] — validator, git-assistant
The review phase uses a two-stage process:
- Stage 1: Spec Compliance (
@spec-reviewer) — Verifies implementation matches requirements - Stage 2: Code Quality (
@reviewer) — Verifies code is well-built
Important: Stage 1 must pass before Stage 2 runs.
The execute phase follows Test-Driven Development:
- Write failing test (
@test-writer) - Verify test fails (
@executor) - Write minimal implementation (
@code-generator) - Verify test passes (
@executor) - Refactor if needed
- Commit (
@git-assistant)
For complex tasks, use @workflow-orchestrator to manage the full workflow. It coordinates other agents in the correct order and ensures quality gates are met.
| Task Type | Recommended Approach |
|---|---|
| Simple, single-step | Handle directly |
| 2-3 steps, clear requirements | Direct implementation with review |
| 3+ steps, complex | Full structured workflow |
| New feature, ambiguous | Full workflow with brainstorm |
| Bug fix, clear issue | Skip brainstorm, use plan + execute |
| Phase | Primary Agents | Supporting Agents |
|---|---|---|
| Brainstorm | architect, research |
project-manager |
| Plan | plan-writer, project-manager |
architect |
| Execute | test-writer, code-generator |
executor, git-assistant |
| Review | spec-reviewer, reviewer |
security-auditor, frontend-reviewer |
| Merge | validator |
git-assistant, devops |
Source: plugins/image-paste-saver.js
Install target: ~/.config/opencode/plugins/ (handled by install scripts)
Automatically detects pasted images in the TUI conversation, saves them to {project}/.opencode/tmp/, and injects file path references into the prompt. This enables text-only primary agents (Erribaba) to delegate image analysis to vision-dev.
How it works:
- User pastes an image in the OpenCode TUI
- Plugin intercepts via
chat.messagehook - Image is decoded from base64 and saved to
{project}/.opencode/tmp/ - A text reference
[Image saved to: .opencode/tmp/opencode-img-xxx.png]is injected into the prompt - Primary agent sees the file path and delegates to
@vision-dev
Cleanup:
- On plugin dispose (OpenCode exit): deletes all temp files created during the session
- On startup: cleans up stale files older than 1 hour (crash recovery)
Supported formats: PNG, JPEG, GIF, WebP, SVG, BMP (max 10MB)
Both primary agents use an async first-come-first-serve pattern for parallel subagent delegation.
在 shell 配置文件(~/.bashrc 或 ~/.zshrc)中添加:
export OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true或者在 Windows 中设置用户环境变量:
[Environment]::SetEnvironmentVariable("OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS", "true", "User")没有此配置,所有子代理任务将同步阻塞执行。
配置只是开启了功能,代理还必须主动使用 background=true 参数:
// ❌ 错误:同步阻塞,等待完成才继续
@code-generator (task A)
@ui-designer (task B)
@db-engineer (task C)
// ✅ 正确:异步并行,立即返回,按完成顺序处理
@code-generator (task A, background=true)
@ui-designer (task B, background=true)
@db-engineer (task C, background=true)
当执行多阶段工作流时,必须等待当前阶段所有任务完成才能进入下一阶段:
阶段 1:探索(并行启动)
├── @explore (模块A, background=true) ─┐
├── @explore (模块B, background=true) │ 全部完成
├── @explore (模块C, background=true) │ 才能进入
└── @explore (模块D, background=true) ─┘ 下一阶段
⛔ 屏障:等待所有探索任务完成
⛔ 不要启动修复任务
阶段 2:分析与计划
├── 综合所有探索结果
├── 识别跨模块依赖
└── 制定修复计划
阶段 3:执行修复(现在才能启动修复任务)
├── @debugger (修复1, background=true)
└── @software-engineer (修复2, background=true)
同一阶段内的并行任务使用先到先处理模式:
收到 code-generator 结果 → 立即验证并处理 → 继续等待同阶段其他任务
收到 db-engineer 结果 → 立即验证并处理 → 继续等待同阶段其他任务
收到 ui-designer 结果 → 立即验证并处理 → 所有任务完成 → 进入下一阶段
❌ 常见错误:
错误:启动探索 → 第一个探索返回 → 立即启动修复代理
正确:启动探索 → 等待所有探索完成 → 综合分析 → 启动修复代理
- 独立任务才用 background=true:有依赖关系的任务不要并行
- 不要轮询:系统会自动通知完成,不要主动查询状态
- 超时处理:复杂任务超过 30 分钟应考虑取消重试
- 冲突解决:多个子代理修改同一文件时,以高优先级为准(security-auditor > reviewer > validator > others)
⚠️ 阶段屏障:多阶段工作流必须等待当前阶段所有任务完成才能进入下一阶段
当主智能体派出多个子智能体并行处理任务时:
- 可能出现:5个子智能体派出,3个返回结果,2个仍在处理
- 错误行为:主智能体基于部分结果就输出"任务完成总结"
- 后果:用户关闭OpenCode会打断未完成的任务;不关闭则子代理完成后再次触发总结
主智能体必须遵循"任务完成检查协议":
- 跟踪已派出任务:记录所有派出的子智能体及其任务
- 验证完成状态:检查每个任务是否收到
Status: done的结果 - 输出决策:
- 所有任务完成 → 输出完整总结
- 有任务未完成 → 输出等待提示,列出已完成和仍在处理的任务
⏳ 任务进行中:我已派出 {N} 个子智能体处理此任务。
已完成:
- ✅ {agent1}: {已完成工作的简要描述}
- ✅ {agent2}: {已完成工作的简要描述}
仍在处理:
- 🔄 {agent3}: {任务描述}
- 🔄 {agent4}: {任务描述}
请稍等,我会在所有任务完成后提供完整的总结。您可以继续等待,或者稍后回来查看结果。
- 绝不在任何子代理仍在处理时输出"任务完成"
- 绝不仅因为收到部分结果就认为任务完成
- 必须在总结前显式检查所有任务状态
- 必须使用等待提示模板处理未完成任务
- Frontmatter
description: Chinese - System prompt body: English (most files) or Chinese (acceptable)
- README: Chinese primary, English secondary