creating-opencode-agents
Skill124 starsChanged 8 months agoMITView on GitHub
Use when creating OpenCode agents - provides markdown format with YAML frontmatter, mode/tools/permission configuration, and best practices for specialized AI assistants
- Commits and pushes
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 57
all: Default; usable in both contexts - Very specific: line 270
Use kebab-case: code-reviewer, not CodeReviewer
- Distinctive: line 283
Use permissions to restrict dangerous operations
- Distinctive: line 285
Use glob patterns for bash permissions
- Distinctive: line 286
Consider maxSteps for long-running agents
- Very specific: line 325
Check file is in .opencode/agent/
- Distinctive: line 330
Verify tool names (lowercase in OpenCode)
- Distinctive: line 332
Ensure mode allows tool access
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Creating OpenCode Agents
Expert guidance for creating OpenCode AI agents with proper configuration, tools, and permissions.
When to Use
Use when:
- User asks to create an OpenCode agent
- Need specialized AI assistant for specific tasks
- Building domain-focused development tools
- Configuring agent tools and permissions
Don't use for:
- OpenCode plugins (use creating-opencode-plugins skill)
- OpenCode slash commands (different format)
- Generic AI prompts (not OpenCode-specific)
Quick Reference
File Location
- Project:
.opencode/agent/<name>.md - Global:
~/.config/opencode/agent/<name>.md
Minimal Agent Structure
---
description: Brief explanation of the agent's purpose
mode: all
---
System prompt content here...Required Fields
description(string): Brief explanation of the agent's purpose (REQUIRED)
Optional Fields
| Field | Type | Description |
mode | primary | subagent | all | How agent can be used (default: all) |
model | string | Override model (e.g., anthropic/claude-sonnet-4-6) |
temperature | number | Response randomness 0.0-1.0 |
prompt | string | Path to prompt file: {file:./path/to/prompt.txt} |
maxSteps | number | Maximum iterations (unlimited if unset) |
tools | object | Enable/disable tools with boolean values |
permission | object | Tool access: ask, allow, or deny |
disable | boolean | Deactivate the agent |
Agent Modes
primary: Main assistant for direct interaction, switchable via Tab keysubagent: Specialized assistant invoked by primary agents or@mentionsall: Default; usable in both contexts
Common Patterns
Code Reviewer (Read-Only)
---
description: Reviews code for best practices and security
mode: subagent
model: anthropic/claude-sonnet-4-6
temperature: 0.1
tools:
write: false
edit: false
bash: false
read: true
grep: true
glob: true
permission:
edit: deny
bash: deny
---
# Code Review Agent
You are an expert code reviewer with deep knowledge of software engineering principles.
## Instructions
- Check for code smells and anti-patterns
- Verify test coverage
- Ensure documentation exists
- Review error handling and security
- Suggest improvements with examples
## Review Checklist
- [ ] Code follows project conventions
- [ ] Tests are comprehensive
- [ ] No security vulnerabilities
- [ ] Documentation is clearBackend Developer
---
description: Node.js/Express API development with database optimization
mode: all
temperature: 0.3
tools:
read: true
write: true
edit: true
bash: true
grep: true
glob: true
permission:
bash:
"npm test": allow
"npm run *": allow
"git *": ask
"*": deny
---
# Backend Development Agent
You are a backend development expert specializing in Node.js, Express, and database optimization.
## Focus Areas
- RESTful API design
- Input validation and error handling
- Database query optimization
- Security best practices
## Standards
- Always use async/await
- Implement proper logging
- Validate all inputs
- Use TypeScript interfacesTest Writer
---
description: Writes comprehensive test suites with high coverage
mode: subagent
temperature: 0.2
maxSteps: 50
tools:
read: true
write: true
bash: true
permission:
bash:
"npm test*": allow
"*": deny
---
# Test Writer Agent
You are a testing expert focused on comprehensive test coverage.
## Test Requirements
- Unit tests for all functions
- Edge case coverage
- Proper mocking
- AAA pattern (Arrange, Act, Assert)
- Descriptive test names
## Frameworks
- Vitest for unit tests
- Playwright for E2E
- MSW for API mockingDocumentation Writer (Limited Tools)
---
description: Technical documentation and API reference writer
mode: subagent
temperature: 0.5
tools:
read: true
write: true
edit: true
bash: false
---
# Documentation Agent
You write clear, comprehensive technical documentation.
## Focus
- API reference documentation
- README files
- Architecture docs
- Code comments and JSDoc
## Style
- Clear and concise
- Include examples
- Use proper markdown formatting
- Follow project documentation standardsTools Configuration
Available Tools
| Tool | Description |
read | Read file contents |
write | Create new files |
edit | Modify existing files |
bash | Execute shell commands |
grep | Search file contents |
glob | Find files by pattern |
webfetch | Fetch web content |
websearch | Search the web |
Wildcard Patterns
Disable groups of tools with wildcards:
tools:
mymcp_*: false # Disable all MCP tools starting with mymcp_Permission Configuration
Simple Permissions
permission:
edit: ask # Prompt before editing
bash: deny # Block all bash commands
webfetch: allow # Allow web fetchingPer-Command Bash Permissions
permission:
bash:
"git push": ask # Ask before pushing
"git *": allow # Allow other git commands
"npm test": allow # Allow testing
"*": deny # Deny everything elseTemperature Guidelines
| Temperature | Use Case |
| 0.0-0.2 | Code review, debugging, analysis |
| 0.3-0.5 | General development, refactoring |
| 0.6-1.0 | Documentation, brainstorming, creative work |
Common Mistakes
| Mistake | Problem | Fix |
| Missing description | Required field | Add description in frontmatter |
| Granting all tools | Security risk | Only grant necessary tools |
| Vague prompt | Ineffective agent | Be specific about domain and tasks |
| Wrong mode | Agent not accessible | Use all for flexibility |
| No tool restrictions | Agent can do anything | Use tools/permission to limit scope |
Best Practices
Naming
- Use kebab-case:
code-reviewer, notCodeReviewer - Be specific:
react-testing-expert, nothelper - Indicate domain:
aws-infrastructure,mobile-ui-designer
Prompts
- Define expertise area clearly
- List specific focus areas
- Specify standards/conventions
- Provide examples when helpful
- Set clear expectations
Security
- Grant minimum necessary tools
- Use permissions to restrict dangerous operations
- Disable bash for read-only agents
- Use glob patterns for bash permissions
- Consider maxSteps for long-running agents
PRPM Integration
Package Manifest (prpm.json)
{
"name": "@username/my-agent",
"version": "1.0.0",
"description": "My OpenCode agent",
"format": "opencode",
"subtype": "agent",
"files": [".opencode/agent/my-agent.md"],
"tags": ["opencode", "agent", "development"]
}Installation
# Install from registry
prpm install @username/agent-name --format opencode
# Installs to: .opencode/agent/<agent-name>.mdPublishing
prpm publishNavigation & Usage
- Tab key: Switch between primary agents
- @ mention: Invoke subagents (e.g.,
@code-reviewer check this function) <Leader>+Right/Left: Navigate parent/child sessions
Troubleshooting
Agent Not Found
- Check file is in
.opencode/agent/ - Verify
.mdextension - Validate YAML frontmatter syntax
Tools Not Working
- Verify tool names (lowercase in OpenCode)
- Check permission settings
- Ensure mode allows tool access
Agent Ineffective
- Be more specific in prompt
- Add concrete examples
- Reference team standards
- Structure with markdown headers
Schema Reference: packages/converters/schemas/opencode.schema.json
Documentation: https://opencode.ai/docs/agents/
In this repository64 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- beanstalk-deployCursor rule
- .cursor/rules/core-principles.mdcCursor rule
- .cursor/rules/creating-agents-md.mdcCursor rule
- .cursor/rules/creating-claude-agents.mdCursor rule
- .cursor/rules/creating-claude-commands.mdCursor rule
- .cursor/rules/creating-claude-hooks.mdCursor rule
- .cursor/rules/creating-continue-packages.mdCursor rule
- .cursor/rules/creating-copilot-packages.mdCursor rule
- .cursor/rules/creating-cursor-commands.mdCursor rule
- .cursor/rules/creating-cursor-rules.mdcCursor rule
- .cursor/rules/creating-kiro-agents.mdcCursor rule
- .cursor/rules/creating-kiro-packages.mdCursor rule
- .cursor/rules/creating-skills.mdcCursor rule
- .cursor/rules/creating-windsurf-packages.mdCursor rule
- .cursor/rules/elastic-beanstalk-deployment.mdCursor rule
- .cursor/rules/format-conversion.mdcCursor rule
- .cursor/rules/github-actions-testing.mdcCursor rule
- .cursor/rules/karen-repo-reviewer.mdcCursor rule
- .cursor/rules/prpm-json-best-practices.mdcCursor rule
- .cursor/rules/self-improve-cursor.mdcCursor rule
- .cursor/rules/testing-patterns.mdcCursor rule
- .cursor/rules/typescript-type-safety.mdcCursor rule
- .cursor/rules/typescript-type-specialist.mdcCursor rule
- creating-agent-skillsSkill
- adding-new-ai-formatSkill
- agent-builderSkill
- aws-beanstalk-expertSkill
- beanstalk-deploySkill
- claude-hook-writerSkill
- creating-agents-mdSkill
- creating-claude-agentsSkill
- creating-claude-commandsSkill
- creating-claude-hooksSkill
- creating-claude-rulesSkill
- creating-continue-packagesSkill
- creating-copilot-packagesSkill
- creating-cursor-commandsSkill
- creating-cursor-rules-skillSkill
- creating-kiro-agentsSkill
- creating-kiro-packagesSkill
- creating-opencode-pluginsSkill
- creating-skillsSkill
- creating-windsurf-packagesSkill
- creating-zed-extensionsSkill
- documentation-standardsSkill
- elastic-beanstalk-deploymentSkill
- github-actions-testingSkill
- human-writingSkill
- integrating-stripe-webhooksSkill
- karen-repo-reviewerSkill
- npm-trusted-publishingSkill
- osgrepSkill
- postgres-migrationsSkill
- prpm-developmentSkill
- prpm-json-best-practicesSkill
- pulumi-troubleshootingSkill
- self-improvingSkill
- slash-command-builderSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

