Skill Creator
This skill guides the creation of Agent Skills for the Opencode environment.
Opencode Skill Basics
Skills are directories containing a SKILL.md file that define reusable behaviors for agents.
Locations
Skills are discovered in:
- •Project:
.opencode/skill/<name>/SKILL.md(Recommended for project-specific tools) - •Global:
~/.config/opencode/skill/<name>/SKILL.md(Recommended for general tools)
Directory Structure
code
skill-name/ ├── SKILL.md (required) └── (Optional resources like scripts/, references/, assets/)
Naming Rules
- •Name: 1-64 characters, lowercase alphanumeric with hyphens (e.g.,
git-release,database-helper). - •Consistency: The directory name MUST match the
namefield in the frontmatter.
Creation Workflow
Follow these steps to create a new skill for the user.
1. Requirements Gathering
Ask the user:
- •Goal: What should the skill do?
- •Scope: Is this for the current project or global use?
- •Triggers: When should the agent use this skill?
2. Implementation
You can create the skill structure using the provided helper script or manually with your tools.
Option A: Using Helper Script
This skill includes a script to scaffold the directory and files.
Location: ~/.config/opencode/skill/skill-creator/scripts/init_skill.py
bash
# For project-local skill python3 ~/.config/opencode/skill/skill-creator/scripts/init_skill.py <skill-name> # For global skill python3 ~/.config/opencode/skill/skill-creator/scripts/init_skill.py <skill-name> --global
Option B: Manual Creation
Use your tools (bash, write) to create the skill.
Step 2a: Create Directory
Create the directory based on the user's preference (Global or Project).
bash
# Example for project skill mkdir -p .opencode/skill/my-new-skill
Step 2b: Create SKILL.md
Write the SKILL.md file. It MUST start with YAML frontmatter.
Template:
markdown
--- name: my-new-skill description: A concise description (1-1024 chars) of what this skill does and when to use it. --- ## Overview A brief explanation of the skill's purpose. ## Capabilities * List key features ## Usage Instructions for the agent on how to perform the tasks.
3. Verification
- •Ensure
SKILL.mdis all caps. - •Verify
namein frontmatter matches directory name. - •Verify
descriptionis present.
Best Practices
- •Progressive Disclosure: Keep
SKILL.mdconcise. Move large documentation toreferences/subfolder and link to it. - •Scripts: If the skill requires complex logic, save scripts in
scripts/and instruct the agent to run them. - •Assets: Store templates or static files in
assets/.