OpenCode Commands
Use this skill when creating, modifying, or understanding OpenCode commands stored in ~/.config/opencode/command/.
Location
Commands directory: ~/.config/opencode/command/
Vault root: /Users/alexismanuel/.config/opencode/
Command Structure
Commands are stored user prompts - markdown files with YAML frontmatter.
File Format
---
description: Short description of what command does
---
[Instructions for agent - what to do when command is invoked]
Load relevant skills if needed.
Arguments: $ARGUMENTS
Required Fields
description(YAML frontmatter): Short, action-oriented summary$ARGUMENTS: Placeholder for command arguments (if needed)
Naming
- Use kebab-case:
bootstrap-daily-note.md - Descriptive, concise names matching the command's purpose
Creating Commands
- Choose a descriptive name (kebab-case)
- Create markdown file in
~/.config/opencode/command/ - Add YAML frontmatter with description
- Write clear instructions for the agent
- Reference relevant skills to load
- Include
$ARGUMENTSplaceholder if command accepts arguments
Examples
Existing commands to reference:
diary.md- Update daily note with session summarysave-session.md- Save OpenCode session to vaultbootstrap-daily-note.md- Bootstrap daily note from yesterday
Best Practices
- Keep instructions concise and actionable
- Always reference relevant skills
- Test commands after creation
- Use consistent formatting across commands