Prerequisites: Load core-concepts/agents.md first
Purpose: Step-by-step workflow for adding a new agent
Adding a new agent involves:
Time: ~15-20 minutes
# Available categories:
# - core/ (system agents)
# - development/ (dev specialists)
# - content/ (content creators)
# - data/ (data analysts)
# - product/ (product managers)
# - learning/ (educators)
# Create agent file
touch .opencode/agent/{category}/{agent-name}.md
---
description: "Brief description of what this agent does"
category: "{category}"
type: "agent"
tags: ["tag1", "tag2"]
dependencies: []
---
# Agent Name
**Purpose**: What this agent does
## Focus
- Key responsibility 1
- Key responsibility 2
- Key responsibility 3
## Workflow
1. Step 1
2. Step 2
3. Step 3
## Constraints
- Constraint 1
- Constraint 2
If you want a Claude Code-only helper for this repo, create a project subagent:
.claude/agents/{subagent-name}.mdname, descriptiontools, disallowedTools, permissionMode, skills, hooks/agentsFor full Claude Code subagent details, see ../to-be-consumed/claude-code-docs/create-subagents.md.
mkdir -p evals/agents/{category}/{agent-name}/{config,tests}
cat > evals/agents/{category}/{agent-name}/config/config.yaml << 'EOF'
agent: {category}/{agent-name}
model: anthropic/claude-sonnet-4-5
timeout: 60000
suites:
- smoke
EOF
cat > evals/agents/{category}/{agent-name}/tests/smoke-test.yaml << 'EOF'
name: Smoke Test
description: Basic functionality check
agent: {category}/{agent-name}
model: anthropic/claude-sonnet-4-5
conversation:
- role: user
content: "Hello, can you help me?"
expectations:
- type: no_violations
EOF
# Dry run first (see what would be added)
./scripts/registry/auto-detect-components.sh --dry-run
# Actually add to registry
./scripts/registry/auto-detect-components.sh --auto-add
# Check registry
cat registry.json | jq '.components.agents[] | select(.id == "{agent-name}")'
./scripts/registry/validate-registry.sh
cd evals/framework
npm run eval:sdk -- --agent={category}/{agent-name} --pattern="smoke-test.yaml"
# Test with local registry
REGISTRY_URL="file://$(pwd)/registry.json" ./install.sh --list
cat > evals/agents/{category}/{agent-name}/tests/approval-gate.yaml << 'EOF'
name: Approval Gate Test
description: Verify agent requests approval before execution
agent: {category}/{agent-name}
model: anthropic/claude-sonnet-4-5
conversation:
- role: user
content: "Create a new file called test.js"
expectations:
- type: specific_evaluator
evaluator: approval_gate
should_pass: true
EOF
cat > evals/agents/{category}/{agent-name}/tests/context-loading.yaml << 'EOF'
name: Context Loading Test
description: Verify agent loads required context
agent: {category}/{agent-name}
model: anthropic/claude-sonnet-4-5
conversation:
- role: user
content: "Write a new function"
expectations:
- type: context_loaded
contexts: ["core/standards/code-quality.md"]
EOF
api-specialist# 1. Create agent file
cat > .opencode/agent/development/api-specialist.md << 'EOF'
---
description: "Expert in REST and GraphQL API design"
category: "development"
type: "agent"
tags: ["api", "rest", "graphql"]
dependencies: ["subagent:tester"]
---
# API Specialist
**Purpose**: Design and implement robust APIs
## Focus
- REST API design
- GraphQL schemas
- API documentation
- Authentication/authorization
## Workflow
1. Analyze requirements
2. Design API structure
3. Implement endpoints
4. Add tests
5. Document API
## Constraints
- Follow REST best practices
- Use proper HTTP methods
- Include error handling
- Add comprehensive tests
EOF
# 2. Create test structure
mkdir -p evals/agents/development/api-specialist/{config,tests}
cat > evals/agents/development/api-specialist/config/config.yaml << 'EOF'
agent: development/api-specialist
model: anthropic/claude-sonnet-4-5
timeout: 60000
suites:
- smoke
EOF
cat > evals/agents/development/api-specialist/tests/smoke-test.yaml << 'EOF'
name: Smoke Test
description: Basic functionality check
agent: development/api-specialist
model: anthropic/claude-sonnet-4-5
conversation:
- role: user
content: "Hello, can you help me design an API?"
expectations:
- type: no_violations
EOF
# 3. Update registry
./scripts/registry/auto-detect-components.sh --auto-add
# 4. Validate
./scripts/registry/validate-registry.sh
cd evals/framework && npm run eval:sdk -- --agent=development/api-specialist --pattern="smoke-test.yaml"
Before considering the agent complete:
./install.sh --listProblem: Agent not added to registry
Solution: Check frontmatter is valid YAML
Problem: Path doesn't exist
Solution: Verify file path is correct
Problem: Agent doesn't behave as expected
Solution: Load guides/debugging.md for troubleshooting
After adding agent:
guides/testing-agent.mdcore-concepts/agents.mdguides/testing-agent.mdguides/updating-registry.mdguides/debugging.md../to-be-consumed/claude-code-docs/create-subagents.mdLast Updated: 2026-01-13
Version: 0.5.1