opencode-command-creator
Skill4 starsChanged 7 months agoMITView on GitHub
Create custom OpenCode commands with proper structure, trigger descriptions, arguments, and configuration. Use when the user wants reusable slash/command workflows in OpenCode, needs `.opencode/commands/*.md` or `opencode.jsonc` entries, wants command templates with `$ARGUMENTS`, or needs to override/extend built-in commands safely.
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 10 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill when creating OpenCode custom commands that allow users to define reusable prompts and workflows.
- Distinctive: line 14
Use this skill when the user wants to:
- Distinctive: line 15
Create new OpenCode custom commands
- Very specific: line 26
Create .md files in:
- Distinctive: line 88
Use placeholders in templates:
- Distinctive: line 174
Add descriptions: Always include descriptions for TUI display
- Distinctive: line 176
Use global commands for general-purpose utilities
- Distinctive: line 177
Use project commands for project-specific workflows
- Very specific: line 180
Consider subtasks: Use subtask: true to keep primary context clean
- Distinctive: line 185
When creating a command:
- Distinctive: line 196
Test the command: Run in TUI with various inputs
- Distinctive: line 197
Document usage: Add to project docs if project-specific
≈ “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
OpenCode Command Creator
Use this skill when creating OpenCode custom commands that allow users to define reusable prompts and workflows.
When to Use
Use this skill when the user wants to:
- Create new OpenCode custom commands
- Define command templates with arguments
- Set up command configurations
- Override or extend built-in commands
Command Structure
OpenCode commands can be defined in two ways:
1. Markdown Files (Recommended)
Create .md files in:
- Global:
~/.config/opencode/commands/ - Per-project:
.opencode/commands/
Format:
---
description: Brief description of command
agent: agent-name (optional)
model: model-identifier (optional)
subtask: true/false (optional)
---
Command template with $ARGUMENTS placeholder
and other prompt content.Example:
---
description: Run tests with coverage
agent: build
model: anthropic/claude-3-5-sonnet-20241022
---
Run the full test suite with coverage report and show any failures.
Focus on the failing tests and suggest fixes.2. JSON Configuration
Add to opencode.jsonc:
{
"$schema": "https://opencode.ai/config.json",
"command": {
"command-name": {
"template": "Prompt template text",
"description": "Brief description",
"agent": "agent-name",
"model": "model-identifier",
"subtask": false
}
}
}Configuration Options
Required
template: The prompt sent to the LLM when command executes
Optional
description: Brief description shown in TUIagent: Which agent should execute the commandsubtask: Boolean to force subagent invocationmodel: Override default model for this command
Template Features
Arguments
Use placeholders in templates:
$ARGUMENTS- All arguments as single string$1,$2,$3, etc. - Individual positional arguments
Example:
Create a React component named $ARGUMENTS with TypeScript support.Usage: /component Button
Shell Output
Inject bash command output with !`command`:
Here are the current test results:
!`npm test`
Based on these results, suggest improvements.File References
Include file content with @filename:
Review the component in @src/components/Button.tsx.
Check for performance issues.Examples
Simple Command
---
description: Format all files
---
Run the code formatter on all source files and report any changes.Command with Arguments
---
description: Create new feature
agent: code
---
Create a new feature for $ARGUMENTS.
Include tests and documentation.Command with Shell Output
---
description: Analyze git changes
---
Recent commits:
!`git log --oneline -10`
Review these changes and suggest improvements.Complex Command
---
description: Full code review
agent: reviewer
model: anthropic/claude-sonnet-4-5
subtask: true
---
Review the following files: $ARGUMENTS
Check for:
1. Code quality issues
2. Security vulnerabilities
3. Performance problems
Current test status:
!`npm test`Best Practices
- Use descriptive names: Command names should be clear and memorable
- Add descriptions: Always include descriptions for TUI display
- Choose file location wisely:
- Use global commands for general-purpose utilities
- Use project commands for project-specific workflows
- Leverage arguments: Make commands flexible with
$ARGUMENTSand positional params - Use appropriate agents: Match commands to the right agent for the task
- Consider subtasks: Use
subtask: trueto keep primary context clean - Test commands: Try commands with different arguments before committing
Implementation Steps
When creating a command:
- Determine scope: Global or project-specific?
- Choose format: Markdown (preferred) or JSON config?
- Define structure:
- Required: template
- Optional: description, agent, model, subtask
- Add template features as needed:
- Arguments placeholders
- Shell command outputs
- File references
- Test the command: Run in TUI with various inputs
- Document usage: Add to project docs if project-specific
Notes
- Custom commands can override built-in commands (
/init,/undo,/redo, etc.) - Commands run in the project's root directory
- Shell commands use bash syntax
- File references automatically include content in the prompt
- Markdown filename becomes command name (e.g.,
test.md→/test)
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- greats-soul-archive-contributor/AGENTS.mdAGENTS.md
- agentic-cli-designSkill
- ai-chat-frontendSkill
- autoresearch-agentSkill
- brainstorm-frameworksSkill
- business-planningSkill
- clawdbot-configSkill
- dashboard-design-guidebookSkill
- fermi-estimationSkill
- firecrawlSkill
- gogcliSkill
- greats-soul-archive-contributorSkill
- jp-grantsSkill
- openclaw-agent-creatorSkill
- opencode-agent-creatorSkill
- openspec-brownfield-baselineSkill
- oss-publishSkill
- product-improvement-proposalSkill
- python-uv-projectSkill
- rust-cliSkill
- slack-rsSkill
- unit-test-hygieneSkill
- wt-setupSkill
- youtube-summarizerSkill
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.

