1.9 KiB
1.9 KiB
name, description, compatibility
| name | description | compatibility |
|---|---|---|
| create-subagent | Guidelines for creating and configuring new subagents in OpenCode. | opencode |
Create Subagent Skill
This skill provides a standardized workflow for adding new specialized subagents to an OpenCode project.
Workflow
- Analyze Requirements: Determine the specific specialized task the agent should handle (e.g., "Security Auditor", "Documentation Specialist").
- Define Configuration:
- Name: Use lowercase alphanumeric with single hyphen separators (e.g.,
security-auditor). - Mode: Set to
subagent. - Description: Write a clear, concise description of what the agent does and when it should be used. This is CRITICAL as primary agents use this to decide when to invoke it.
- Model: Choose a model optimized for the task (if different from the primary agent).
- Permissions: Define strict permissions (
allow,deny,ask) based on the principle of least privilege. Read-only agents should haveedit: deny.
- Name: Use lowercase alphanumeric with single hyphen separators (e.g.,
- Implementation:
- Preferred Method: Create a Markdown file in
.opencode/agents/<name>.md. - Alternative: Add to
opencode.jsonunder the"agent"key.
- Preferred Method: Create a Markdown file in
- Verification:
- Ensure the file is saved with the correct frontmatter and system prompt.
- Test the agent by calling it via
@<name>in a session.
Configuration Example (Markdown)
---
description: Performs security audits on the codebase
mode: subagent
model: anthropic/claude-sonnet-4-20250514
permission:
edit: deny
bash: deny
---
You are a security expert. Focus on identifying potential vulnerabilities,
input validation issues, and authentication flaws.
Configuration Example (JSON)
{
"agent": {
"security-auditor": {
"description": "Performs security audits on the codebase",
"mode": "subagent",
"model": "anthropic/claude-sonnet-4-20250514",
"permission": { "edit": "deny" }
}
}
}