claude/opencode-tools/skills/oc-update-agent/SKILL.md
Updates an existing OpenCode agent to match current platform best practices, fixes deprecated patterns, and validates the result. Use when user says "update opencode agent", "fix opencode agent", "migrate agent to opencode", or wants to modernize an existing OpenCode agent file.
npx skillsauth add sequenzia/agent-alchemy oc-update-agentInstall 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.
You are initiating the OpenCode agent update workflow. This process locates an existing agent, researches current platform best practices, analyzes the agent for outdated patterns, and applies updates with validation.
IMPORTANT: You MUST use the AskUserQuestion tool for ALL questions to the user. Never ask questions through regular text output.
Read the OpenCode platform overview and agent guide:
${CLAUDE_PLUGIN_ROOT}/references/platform-overview.md${CLAUDE_PLUGIN_ROOT}/references/agent-guide.mdFind the agent to update.
If $ARGUMENTS is provided:
{name}.md in known directoriesIf no arguments:
Glob for .opencode/agents/*.mdGlob for ~/.config/opencode/agents/*.mdAskUserQuestion:
Read the selected agent file and store its contents.
Spawn the researcher agent to check latest documentation:
Task:
subagent_type: "agent-alchemy-opencode-tools:oc-researcher"
prompt: |
Research the latest OpenCode documentation for agent format compatibility.
Artifact type: agent
Current artifact content:
---
{contents of the agent file}
---
Specific questions:
1. Are there any new agent frontmatter fields?
2. Have permission syntax rules changed?
3. Are there new agent modes or capabilities?
4. Any changes to subagent behavior or limitations?
Reference guide: ${CLAUDE_PLUGIN_ROOT}/references/agent-guide.md
Compare the existing agent against current best practices:
| Issue | Detection | Fix |
|-------|-----------|-----|
| name field present | Should not exist — name from filename | Remove |
| skills field present | Skills not assignable to agents | Remove |
| Invalid mode value | Must be primary, subagent, or all (default: all) | Fix or default to all |
| Wrong model format | Must be provider/model-id | Convert |
| Temperature out of range | Must be 0.0-1.0 | Clamp to valid range |
| top_p out of range | Must be 0.0-1.0 if present | Clamp to valid range |
| Invalid permission syntax | Values must be allow/ask/deny/true/false | Fix syntax |
| Missing description | Required field | Add based on agent content |
| Issue | Detection | Fix |
|-------|-----------|-----|
| Subagent uses question | Subagents can't use question tool | Add note or restructure |
| Claude Code tool names | AskUserQuestion instead of question | Convert to OpenCode names |
| mcp__ format | Double-underscore MCP naming | Convert to single-underscore |
| ${CLAUDE_PLUGIN_ROOT} refs | Claude Code path variable | Remove or convert |
| Missing purpose statement | No clear first sentence | Add purpose statement |
| No output format section | Agent should specify output | Add output format |
| Issue | Detection | Fix | |-------|-----------|-----| | Glob pattern syntax errors | Invalid patterns in permission rules | Fix syntax | | Overly permissive subagent | Subagent with full write/bash access | Suggest tightening | | Missing common tools | No read/glob/grep permissions set | Add basic permissions |
Present the analysis organized by severity:
## Update Analysis: {agent-name}
### Errors (must fix)
{list with explanations}
### Warnings (should fix)
{list with explanations}
### Suggestions
{list with explanations}
### Research Notes
{findings from researcher agent}
Use AskUserQuestion for approval:
Apply changes based on user selection:
Edit to modify the agent fileSpawn the validator agent:
Task:
subagent_type: "agent-alchemy-opencode-tools:oc-validator"
prompt: |
Validate the following OpenCode artifact:
Type: agent
Path: {path to updated file}
Reference guide: ${CLAUDE_PLUGIN_ROOT}/references/agent-guide.md
Present validation results and a before/after summary of changes.
CRITICAL: Complete ALL 7 phases before finishing.
development
Systematic, hypothesis-driven debugging workflow with triage-based track routing. Use when asked to "fix this bug", "debug this", "why is this failing", "this is broken", "investigate this error", "track down this issue", or any debugging situation. Supports --deep flag to force full investigation.
development
Executes diagnostic investigation tasks to test debugging hypotheses. Runs tests, traces execution, checks git history, and reports evidence. (converted from agent)
content-media
Provides architectural pattern knowledge for designing feature implementations including MVC, event-driven, microservices, and CQRS patterns. Use when designing system architecture or choosing implementation patterns.
documentation
Provides Mermaid diagram syntax, best practices, and styling rules for technical visualizations. Use when creating diagrams, flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, architecture diagrams, C4 diagrams, or any visual documentation in markdown.