xiaohongshu
xiaohongshu
Atlas skill for converting Claude Code Subagents to OpenCode Agents format. USE WHEN migrating from Claude Code to OpenCode or when you have existing subagent definitions to port.
Full skill instructions
This skill helps you convert Claude Code Subagent definitions (from .claude/agents/ or ~/.claude/agents/) to OpenCode Agent format (.opencode/agent/ or ~/.config/opencode/agent/).
Note: When running from a personal config that symlinks to ~/.config/opencode/, the agent files will be available globally.
Source formats:
.claude/agents/*.md or ~/.claude/agents/*.md--agents flag with JSON objectTarget formats:
.opencode/agent/*.md or ~/.config/opencode/agent/*.mdopencode.json config fileKey differences:
mode field (primary, subagent, all)permission fieldtemperature, disable, modeFind Claude Code subagents to convert:
# Project-level subagents
ls .claude/agents/
# User-level subagents
ls ~/.claude/agents/
Read the subagent definition to understand its configuration:
cat .claude/agents/code-reviewer.md
Convert each field from Claude Code format to OpenCode format:
Frontmatter mapping:
| Claude Code | OpenCode | Notes |
|---|---|---|
name | filename or name in JSON | Filename becomes agent name in markdown |
description | description | Keep identical |
tools | tools | Convert format (see below) |
model | model | Keep identical, adjust defaults |
| n/a | mode | Add explicit mode: subagent (default), primary, or all |
| n/a | temperature | Optional: Set 0.0-1.0 for response variability |
| n/a | disable | Optional: Set true to disable agent |
| n/a | permission | Optional: Set granular permissions |
Tool format conversion:
Claude Code (comma-separated or omitted):
tools: Read, Grep, Glob, Bash
OpenCode (object with booleans):
tools:
read: true
grep: true
glob: true
bash: true
write: false
edit: false
If tools field is omitted in Claude Code: It inherits all tools. In OpenCode, either omit the tools field entirely or set all desired tools to true.
Model mapping:
Claude Code models:
sonnet, opus, haiku (aliases)'inherit' (use main conversation model)OpenCode models:
anthropic/claude-sonnet-4-20250514Consider adding these optional fields:
Temperature:
temperature: 0.1 # Lower = more focused, higher = more creative
Mode:
mode: subagent # or 'primary' or 'all'
Permissions:
permission:
edit: ask # Options: ask, allow, deny
bash:
"git push": ask
"git status": allow
"*": ask
webfetch: deny
Option A: Markdown format (recommended for easy editing)
Create file at .opencode/agent/<agent-name>.md:
---
description: Expert code reviewer focusing on quality and security
mode: subagent
model: anthropic/claude-sonnet-4-20250514
temperature: 0.1
tools:
read: true
grep: true
glob: true
bash: true
write: false
edit: false
permission:
edit: deny
bash: ask
---
[System prompt content from original Claude Code subagent]
Option B: JSON format (for programmatic access)
Add to opencode.json:
{
"agent": {
"code-reviewer": {
"description": "Expert code reviewer focusing on quality and security",
"mode": "subagent",
"model": "anthropic/claude-sonnet-4-20250514",
"temperature": 0.1,
"prompt": "{file:./prompts/code-review.txt}",
"tools": {
"read": true,
"grep": true,
"glob": true,
"bash": true,
"write": false,
"edit": false
},
"permission": {
"edit": "deny",
"bash": "ask"
}
}
}
}
Check the converted agent:
Verify file location:
.opencode/agent/ directory exists and file is present~/.config/opencode/agent/ directory exists and file is presentVerify frontmatter:
Verify system prompt:
Test the agent:
@agent-name to invoke the agentFor detailed step-by-step examples with before/after comparisons, see:
cat EXAMPLES.md
The EXAMPLES.md file includes:
Quick example snippet:
Claude Code format:
---
name: code-reviewer
description: Reviews code for quality and security
tools: Read, Grep, Glob
model: sonnet
---
OpenCode format:
---
description: Reviews code for quality and security
mode: subagent
model: anthropic/claude-sonnet-4-20250514
temperature: 0.1
tools:
read: true
grep: true
glob: true
write: false
edit: false
permission:
edit: deny
---
Claude Code:
tools: Read, Grep, Glob
OpenCode:
mode: subagent
tools:
read: true
grep: true
glob: true
write: false
edit: false
bash: false
permission:
edit: deny
bash: deny
Claude Code:
tools: # Omitted = inherits all
OpenCode:
mode: subagent
# Omit tools field to inherit all, or:
tools:
read: true
write: true
edit: true
bash: true
grep: true
glob: true
permission:
bash:
"rm *": ask
"git push": ask
"*": allow
Claude Code:
tools: Bash, Read
OpenCode:
mode: subagent
tools:
bash: true
read: true
write: false
edit: false
permission:
bash:
"git status": allow
"git diff*": allow
"git log*": allow
"npm test": allow
"npm run*": allow
"*": ask # All other commands require approval
Claude Code has built-in agents like the "Plan" subagent. OpenCode also has built-in agents:
Don't convert built-in agents - they already exist in OpenCode with similar functionality.
Claude Code supports CLI-defined agents via --agents flag:
claude --agents '{
"code-reviewer": {
"description": "...",
"prompt": "...",
"tools": ["Read", "Grep"],
"model": "sonnet"
}
}'
OpenCode equivalent: Pass configuration via environment or config file. No direct CLI equivalent, but you can:
opencode.json for persistence.opencode/agent/ files~/.config/opencode/agent/ filesMost tools have the same names, but watch for:
Bash, Read, Write, Edit, Grep, Globbash, read, write, edit, grep, glob (lowercase in YAML)In OpenCode markdown frontmatter, use lowercase. In JSON, also lowercase.
Both systems support MCP (Model Context Protocol) tools:
tools field is omittedmymcp_*: falseWhen converting, if the Claude Code agent uses MCP tools:
# OpenCode - allow specific MCP server tools
tools:
read: true
myserver_*: true # All tools from 'myserver' MCP
write: false
Claude Code supports resumable subagents via agentId and resume parameter. OpenCode uses session-based continuity with parent/child session navigation:
Conversion strategy:
After conversion, verify:
.opencode/agent/ or ~/.config/opencode/agent/)description (required)mode is set to subagent, primary, or all (defaults to all if omitted)tools field uses object format with booleans (or omitted to inherit all)model string is valid for your OpenCode provider configurationname field in frontmatter (filename is the name)temperature is set if behavioral control is importantpermission is configured for potentially destructive tools@agent-nameIssue: Agent not appearing in OpenCode
.opencode/agent/ or ~/.config/opencode/agent/)description field is presentdisable: true in frontmatterIssue: Tools not working as expected
tools object format (not comma-separated string)Issue: Agent behaves differently than in Claude Code
temperature setting (may need adjustment)permission settings (may be blocking operations)Issue: Model errors
provider/model-nameinherit if main model should be used.opencode/agent/ for team sharingopencode agent create - Create a new agent with guided setup.opencode/agent/ or ~/.config/opencode/agent/@agent-name in OpenCode conversationxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience