A production-ready, plan-first agent hierarchy configuration for OpenCode CLI with 15 specialized agents (2 primary + 13 subagents) and extensible architecture.
Quick Start • Installation • Agent Reference • Workflow Guide • Contributing
OpenCode Agent Team is a professional agent configuration system that transforms OpenCode CLI into a coordinated multi-agent development environment. It implements a proven plan-first workflow where strategic planning precedes implementation, enabling efficient parallel execution of specialized agents.
This configuration is designed for teams and individual developers who want to leverage AI-assisted development with clear separation of concerns, bounded execution, and fine-grained permission controls.
- Plan-First Workflow - Strategic analysis before implementation prevents costly mistakes
- 15 Specialized Agents - 2 primary agents (plan, build) + 13 subagents, each optimized for specific development tasks with appropriate models and permissions
- Parallel Execution - Independent tasks run simultaneously for faster development cycles
- Fine-Grained Permissions - Each agent has precisely scoped tool access (read, write, bash, web)
- Bounded Execution - Subagents limited to 15-30 steps to prevent runaway processes
- MCP Integration - Optional Exa (web search) and Ref (documentation) servers for enhanced capabilities
- Model Flexibility - Easily swap between Claude, GPT, Gemini, and other providers
- Production Ready - Battle-tested configuration with clear documentation and examples
# Clone the repository
git clone https://github.com/BrightEra/opencode-agent-team.git
cd opencode-agent-team
# Run the installer (copy mode - default)
./install.sh
# Or use symlink mode for easy updates
./install.sh --symlink# Required: Anthropic API key
export ANTHROPIC_API_KEY='your-api-key-here'
# Optional: Enhanced search capabilities
export EXA_API_KEY='your-exa-key' # Get at https://exa.ai
export REF_API_KEY='your-ref-key' # Get at https://ref.tools# Use the plan agent for strategic analysis
opencode --agent plan
@plan Analyze the codebase structure and suggest refactoring opportunities
# Use build for implementation
opencode --agent build
@build Implement the refactoring suggestions
# Use specialized agents for specific tasks
@scout Find all TypeScript files in src/
@tester Write unit tests for the new code
@reviewer Review the implementation for quality issuesThe installation script provides three modes:
Files are copied to ~/.config/opencode/ and are independent of the source repository.
git clone https://github.com/BrightEra/opencode-agent-team.git
cd opencode-agent-team
./install.sh --copyFiles are symlinked, allowing easy updates via git pull.
git clone https://github.com/BrightEra/opencode-agent-team.git
cd opencode-agent-team
./install.sh --symlink
# Update later with:
git pull origin mainRemove the installation (creates a backup first).
./install.sh --uninstallFeatures:
- ✓ Automatic prerequisite checking
- ✓ Backup of existing configuration
- ✓ Colored output with progress indicators
- ✓ Post-install instructions
- ✓ Error handling and validation
# Download the configuration
git clone https://github.com/BrightEra/opencode-agent-team.git
cd opencode-agent-team
# Copy to OpenCode config directory
mkdir -p ~/.config/opencode/.opencode/prompts
cp opencode.json ~/.config/opencode/
cp AGENTS.md ~/.config/opencode/
cp .opencode/prompts/plan.md ~/.config/opencode/.opencode/prompts/
cp .opencode/prompts/build.md ~/.config/opencode/.opencode/prompts/# Install as a package
npm install -g @brighterra/opencode-agent-team
# Or with bun
bun add -g @brighterra/opencode-agent-team| Agent | Model | Steps | Purpose |
|---|---|---|---|
| plan | Claude Opus 4.5 | Unlimited | Strategic planning, task decomposition, architectural decisions, code analysis without modification |
| build | Claude Sonnet 4.5 | Unlimited | Primary implementation, file editing, running commands, full tool access |
| Agent | Model | Steps | Purpose |
|---|---|---|---|
| scout | Claude Haiku 4.5 | 15 | Fast codebase exploration, file pattern matching, code search, directory structure analysis |
| docs | Claude Haiku 4.5 | 15 | Documentation writing, README updates, API docs, docstrings, changelog entries |
| Agent | Model | Steps | Purpose |
|---|---|---|---|
| research | Claude Sonnet 4.5 | 25 | Documentation lookup, API research, best practices, framework patterns, version compatibility |
| reviewer | Claude Sonnet 4.5 | 20 | Code review, quality assessment, anti-pattern detection, architectural feedback |
| tester | Claude Sonnet 4.5 | 25 | Unit/integration/E2E tests, test suite execution, coverage analysis, test debugging |
| refactor | Claude Sonnet 4.5 | 25 | Code structure improvement, method extraction, variable renaming, design patterns, modernization |
| debug | Claude Sonnet 4.5 | 25 | Error investigation, stack trace analysis, log examination, git bisect, performance diagnosis |
| devops | Claude Sonnet 4.5 | 30 | Docker, Kubernetes, CI/CD pipelines, Terraform, cloud configs, monitoring, deployment |
| security | Claude Sonnet 4.5 | 20 | Vulnerability scanning, security anti-patterns, auth/authz review, secrets detection, API security |
read write edit bash web git MCP
plan ✓ ✗ ✗ ✗ ✓ ✗ ✓
build ✓ ✓ ✓ ✓ ✓ ✓ ✓
scout ✓ ✗ ✗ ✗ ✗ ✗ ✗
research ✓ ✗ ✗ ✗ ✓ ✗ ✓
reviewer ✓ ✗ ✗ ✗ ✗ ✗ ✓
tester ✓ ✓ ✓ ✓* ✗ ✗ ✗
refactor ✓ ✗ ✓ ✗ ✗ ✗ ✗
debug ✓ ✗ ✗ ✓* ✗ ✓ ✗
devops ✓ ✓ ✓ ✓* ✓ ✗ ✓
security ✓ ✗ ✗ ✓* ✗ ✓ ✓
* = Scoped permissions (specific commands allowed)
The core workflow follows a proven pattern:
1. PLAN (@plan)
↓
Analyze requirements → Decompose tasks → Create execution plan
↓
2. DISCOVER (@scout + @research in parallel)
↓
Find relevant code → Research best practices → Gather context
↓
3. IMPLEMENT (@build or specialized agents in parallel)
↓
Write code → Run tests → Execute commands
↓
4. VALIDATE (@tester + @reviewer in parallel)
↓
Test coverage → Code quality → Security audit
↓
5. DEPLOY (@devops)
↓
Build → Configure → Deploy
- @plan: "Analyze this codebase and suggest a refactoring strategy"
- @plan: "Design the architecture for a new feature"
- @plan: "Break down this complex task into parallelizable work units"
- @scout: "Find all files matching pattern
*.test.ts" - @scout: "Where is the authentication logic implemented?"
- @research: "What's the latest version of React and what are the breaking changes?"
- @research: "Find best practices for error handling in Node.js"
- @build: "Implement the new authentication system"
- @refactor: "Extract this method into a separate class"
- @refactor: "Rename all instances of
oldNametonewName"
- @tester: "Write unit tests for the authentication module"
- @tester: "Run the test suite and fix any failures"
- @reviewer: "Review this code for potential bugs and anti-patterns"
- @security: "Scan for security vulnerabilities in dependencies"
- @devops: "Create a GitHub Actions workflow for CI/CD"
- @devops: "Write a Dockerfile for this application"
- @debug: "Investigate why the build is failing"
- @debug: "Find the commit that introduced this regression"
- @docs: "Write a comprehensive README for this project"
- @docs: "Generate API documentation from code comments"
@scout Find all service files
@research Look up the latest TypeScript best practices
@security Scan for vulnerabilities
@tester Write and run tests
@reviewer Review the implementation
@docs Update the changelog
@debug → diagnose the issue
@refactor → fix the code
@tester → verify the fix works
Edit opencode.json to change the default model or per-agent models:
{
"model": "anthropic/claude-sonnet-4-5-20250929",
"agent": {
"plan": {
"model": "anthropic/claude-opus-4-5-20251101"
},
"build": {
"model": "openai/gpt-4-turbo"
}
}
}Modify tool access for specific agents:
{
"agent": {
"scout": {
"tools": {
"bash": false,
"webfetch": false,
"read": true,
"grep": true
}
}
}
}Adjust maxSteps to control execution bounds:
{
"agent": {
"tester": {
"maxSteps": 30
}
}
}Extend the configuration with your own specialized agents:
{
"agent": {
"myagent": {
"description": "My custom agent for specific tasks",
"mode": "subagent",
"model": "anthropic/claude-sonnet-4-5-20250929",
"temperature": 0.2,
"maxSteps": 20,
"tools": {
"read": true,
"write": true,
"edit": true,
"bash": false
}
}
}
}The configuration uses Claude models by default, but you can substitute with alternatives. Here's the recommended tier structure:
Primary Choice:
anthropic/claude-opus-4-5-20251101(Claude Opus 4.5)
Alternatives:
openai/gpt-5.2(OpenAI GPT-5.2)google/gemini-3-pro(Google Gemini 3 Pro)deepseek/deepseek-v3.2(DeepSeek V3.2)
Use for: @plan agent
Primary Choice:
anthropic/claude-sonnet-4-5-20250929(Claude Sonnet 4.5)
Alternatives:
openai/gpt-5.1(OpenAI GPT-5.1)deepseek/deepseek-v3.2(DeepSeek V3.2)anthropic/claude-opus-4-5-20251101(Claude Opus 4.5)
Use for: @build, @research, @tester, @refactor, @debug, @devops, @security, @reviewer
Primary Choice:
anthropic/claude-haiku-4-5-20251001(Claude Haiku 4.5)
Alternatives:
openai/gpt-5-mini(OpenAI GPT-5 Mini)anthropic/claude-opus-4-5-20251101(Claude Opus 4.5)
Use for: @scout, @docs
| Scenario | Recommendation |
|---|---|
| Cost-sensitive, small tasks | Haiku/GPT-5-mini |
| Balanced cost/performance | Sonnet/GPT-5.1 |
| Complex analysis, planning | Opus/GPT-5.2 |
| Long context windows needed | Opus/GPT-5.2 |
| Code generation focus | Sonnet/GPT-5.1 |
| Security-critical tasks | Opus/GPT-5.2 |
Exa provides web search and code context capabilities for the @research and @plan agents.
- Visit exa.ai
- Sign up for a free account
- Copy your API key from the dashboard
export EXA_API_KEY="your-api-key-here"The configuration will automatically use Exa if the environment variable is set.
Ref provides fast documentation lookup for libraries and frameworks.
- Visit ref.tools
- Sign up for a free account
- Copy your API key from the dashboard
export REF_API_KEY="your-api-key-here"The configuration will automatically use Ref if the environment variable is set.
# Check if MCP servers are available
opencode --list-mcp
# Test Exa
@research Search for "React hooks best practices"
# Test Ref
@research Look up the TypeScript documentation for genericsProblem: Error: Agent 'xyz' not found
Solution:
- Verify the agent name is spelled correctly
- Check that
opencode.jsonis in~/.config/opencode/ - Reload OpenCode:
opencode --reload-config
Problem: Error: Permission denied for tool 'bash'
Solution:
- Check the agent's permissions in
opencode.json - Some agents have scoped bash permissions (e.g., @tester only allows test commands)
- Use @build for unrestricted bash access
Problem: Error: Failed to connect to MCP server 'exa'
Solution:
- Verify API keys are set:
echo $EXA_API_KEY - Check internet connection
- Temporarily disable MCP in
opencode.json:{ "tools": { "exa*": false, "Ref*": false } }
Problem: Error: Agent exceeded maximum steps (15)
Solution:
- Break the task into smaller subtasks
- Use @plan to decompose complex tasks
- Increase
maxStepsinopencode.jsonif needed (not recommended)
Problem: Error: Model 'anthropic/claude-opus-4-5-20251101' not available
Solution:
- Verify you have API access to the model
- Check your API key is set correctly
- Switch to an alternative model (see Model Alternatives)
Problem: Agents are responding slowly
Solution:
- Check your internet connection
- Verify API rate limits aren't exceeded
- Use faster models (Haiku for @scout, @docs)
- Break tasks into smaller units
We welcome contributions! Please see CONTRIBUTING.md for guidelines on:
- Reporting bugs
- Suggesting improvements
- Submitting pull requests
- Adding new agent configurations
- Improving documentation
# Clone the repository
git clone https://github.com/BrightEra/opencode-agent-team.git
cd opencode-agent-team
# Test your changes
opencode --validate-config opencode.json
# Submit a pull request
git checkout -b feature/your-feature
git commit -am "Add your feature"
git push origin feature/your-featureThis project is licensed under the MIT License - see the LICENSE file for details.
Attribution: Created by Justin Carlson / BrightEra
- OpenCode - The AI-powered CLI that makes this possible
- Anthropic - For Claude models
- Exa - For web search and code context
- Ref - For documentation lookup
- The open-source community for inspiration and feedback
Made with ❤️ by BrightEra