Why this matters: Agent files define specialized AI agents that perform specific tasks. They must be translated to work with OpenCode's agent system.
End goal: All agent files work as OpenCode agents with correct tool sets and specifications. </objective>
<context> This is prompt 6 of 6 in the translation sequence. Use the mapping document created in prompt 1 as your reference.Source files: ./original/agents/*.md Target directory: ./gsd-opencode/agents/
Mapping reference: @./assets/prompts/TRANSLATION-MAPPING.md
Agent documentation: https://opencode.ai/docs/agents/
Project context:
- Project name: "gsd-opencode"
- Config folder: ~/.config/opencode OR .opencode/ (not ~/.claude)
- Translate all Claude Code-specific tools, names to OpenCode equivalents
Translation rules:
- Frontmatter: Update agent frontmatter to OpenCode agent specification format
- Tool names: Translate all tool names in frontmatter and content to OpenCode equivalents
- File paths: Update all file path references to OpenCode structure
- XML tags: Convert
<sub>something</sub>to*something* - Command references: Update gsd:<name> to gsd-<name>
- Config paths: Update ~/.claude to ~/.config/opencode or .opencode/
- Agent capabilities: Update tool lists to OpenCode equivalents
- Workflow references: Update workflow paths to OpenCode structure </context>
-
Translate each .md file from ./original/agents/ to ./gsd-opencode/agents/
-
For each agent file:
- Update frontmatter to match OpenCode agent specification format per mapping document
- Translate all tool names in frontmatter to OpenCode equivalents
- Update agent name if it references Claude Code
- Translate all tool names in agent content to OpenCode equivalents
- Update all file path references to OpenCode structure
- Convert all
<sub>something</sub>tags to*something* - Update any command references to use gsd-<name> format
- Update config directory references
- Update workflow references to point to OpenCode structure
- Preserve the agent's role, capabilities, and behavior
- Maintain the agent's documentation and examples
-
Ensure agents have the correct tool sets for OpenCode
-
Maintain the agent's functionality and purpose
-
Update any examples in agent descriptions to use OpenCode syntax
</requirements>
For each file:
- Read the source file
- Identify all Claude Code-specific elements in frontmatter and content
- Update frontmatter to OpenCode agent format (may involve restructuring)
- Apply all translation rules from the mapping document
- Verify the translated agent makes sense in OpenCode context
- Ensure the agent has the correct tools for its purpose in OpenCode
- Write to target location
Important:
- Agent frontmatter structure may differ significantly between Claude Code and OpenCode
- Use the mapping document for the correct OpenCode agent specification format
- Preserve the agent's role, philosophy, and behavior descriptions
- Update tool lists to match OpenCode's available tools
- Maintain the agent's specialized capabilities and purpose
- Update examples and patterns in the agent content
- Ensure agent spawning references use OpenCode format </implementation>
Each agent file should:
- Have OpenCode-compliant frontmatter
- Use OpenCode tool names in frontmatter and content
- Reference files in the correct OpenCode structure
- Use OpenCode-compatible XML tags
- Reference commands with gsd-<name> format
- Preserve original agent role and purpose
- Have correct tool sets for OpenCode
- Maintain agent documentation and examples </output>
-
Verify all agent files have been translated:
ls -la ./original/agents/*.md | wc -l ls -la ./gsd-opencode/agents/*.md | wc -lThe counts should match.
-
Check that frontmatter follows OpenCode agent specification format:
- Review frontmatter of each agent file
- Ensure correct fields and structure per mapping document
-
Check that no Claude Code tool names remain:
grep -r "WebFetch\|AskUserQuestion" ./gsd-opencode/agents/Should return nothing.
-
Verify no
<sub>tags remain:grep -r "<sub>" ./gsd-opencode/agents/Should return nothing.
-
Verify workflow references point to correct locations
-
Spot-check a few agent files to ensure frontmatter is correct
</verification>
<success_criteria>
- ./gsd-opencode/agents/ directory created
- All agent files from source translated
- All agent frontmatter follows OpenCode specification format
- All tool names in frontmatter translated to OpenCode equivalents
- All tool names in content translated to OpenCode equivalents
- All file paths updated to OpenCode structure
- All
<sub>tags converted to* - All command references use gsd-<name> format
- Agent roles and purposes preserved
- Tool sets correct for OpenCode
- File count matches between source and target </success_criteria>