Prerequisites: Load plugins/context/capabilities/events_skills.md first
Purpose: Create an OpenCode skill directory and SKILL.md file
Note: This is for OpenCode skills (internal system). For Claude Code Skills, see creating-skills.md.
Adding an OpenCode skill involves:
Time: ~10-15 minutes
task-management, brand-guidelinesmkdir -p .opencode/skills/{skill-name}/scripts
Standard structure:
.opencode/skills/{skill-name}/
├── SKILL.md # Required: Main skill documentation
├── router.sh # Optional: CLI router script
└── scripts/
└── skill-cli.ts # Optional: CLI tool implementation
---
name: {skill-name}
description: Brief description of what the skill provides
---
# Skill Name
**Purpose**: What this skill helps users do
## What I do
- Feature 1
- Feature 2
- Feature 3
## How to use me
### Basic Commands
bash npx ts-node .opencode/skills/{skill-name}/scripts/skill-cli.ts command1
### Command Reference
| Command | Description |
|---------|-------------|
| `command1` | What command1 does |
| `command2` | What command2 does |
For Claude Code Skills (.claude/skills/), add extra frontmatter:
allowed-tools - Tool restrictionscontext + agent - Run in forked subagenthooks - Lifecycle eventsuser-invocable - Hide from slash menuSee creating-skills.md for Claude Code Skills details.
For CLI-based skills:
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ $# -eq 0 ]; then
echo "Usage: bash router.sh <command> [options]"
exit 1
fi
COMMAND="$1"
shift
case "$COMMAND" in
help|--help|-h)
echo "{Skill Name} - Description"
echo "Commands: command1, command2, help"
;;
command1|command2)
npx ts-node "$SCRIPT_DIR/scripts/skill-cli.ts" "$COMMAND" "$@"
;;
*)
echo "Unknown command: $COMMAND"
exit 1
;;
esac
chmod +x .opencode/skills/{skill-name}/router.sh
adding-skill-implementation.mdadding-skill-example.mdcreating-skills.mdcreating-skills.md - Claude Code Skills (different system)adding-skill-implementation.md - CLI and registryadding-skill-example.md - Task-management exampleplugins/context/capabilities/events_skills.md - Skills Plugin