build-skill
Create effective skills for OpenCode agents. Load FIRST before writing any SKILL.md. Provides required format, naming conventions, progressive disclosure patterns, and validation. Use when building, reviewing, or debugging skills.
- License 许可
- MIT
- 所属仓库
- roerohan/skills
- 最近更新
- 2026-09-04
- Stars
- ★ 29
- Forks
- 1
01 前言 Front Matter
- name
- build-skill
- description
- Create effective skills for OpenCode agents. Load FIRST before writing any SKILL.md. Provides required format, naming conventions, progressive disclosure patterns, and validation. Use when building, reviewing, or debugging skills.
02 资源文件 9
- 参考文档references/anatomy.md3.5 KB
- 参考文档references/bundled-resources.md1.9 KB
- 参考文档references/frontmatter.md3.7 KB
- 参考文档references/gotchas.md2.1 KB
- 参考文档references/patterns.md3.0 KB
- 参考文档references/progressive-disclosure.md3.9 KB
- 脚本scripts/init_skill.sh6.8 KB
- 脚本scripts/package_skill.sh4.5 KB
- 脚本scripts/validate_skill.sh7.0 KB
03 SKILL.md 正文
Building Skills
Skills extend agent capabilities with specialized knowledge, workflows, and tools.
Quick Start
Minimal viable skill in 30 seconds:
mkdir my-skill && cat > my-skill/SKILL.md << 'EOF'
---
name: my-skill
description: Does X when Y happens. Use for Z tasks.
---
# My Skill
Instructions go here.
EOF
Place new skills in this skills repository by default. OpenCode should load this repo through opencode.json skills.paths.
Skill Type Decision Tree
What are you building?
├─ Instructions only → Simple skill (SKILL.md only)
│ Example: code-review guidelines, commit message format
│
├─ Domain knowledge → Reference-heavy skill (+ references/)
│ Example: API docs, database schemas, company policies
│
├─ Repeatable automation → Script-heavy skill (+ scripts/)
│ Example: PDF processing, data validation, file conversion
│
├─ Complex multi-step workflow → Multi-file skill (all directories)
│ Example: release process, deployment pipeline
│
└─ Large platform → Progressive skill
Example: AWS, GCP, Cloudflare (60+ products)
When to Create a Skill
Create a skill when:
- Same instructions repeated across conversations
- Domain knowledge model lacks (schemas, internal APIs, company policies)
- Workflow requires 3+ steps with specific order
- Code rewritten repeatedly for same task
- Team needs shared procedural knowledge
When NOT to Create a Skill
| Scenario | Do Instead |
|---|---|
| Single-use instructions | AGENTS.md or inline in conversation |
| Model already knows domain | Don't add redundant context |
| < 3 steps, no reuse | Inline instructions |
| Highly variable workflow | Higher-freedom guidelines |
| Just want to store files | Use regular directories |
Reading Order
| Task | Files to Read |
|---|---|
| New skill from scratch | anatomy.md → frontmatter.md |
| Optimize existing skill | progressive-disclosure.md |
| Add scripts/resources | bundled-resources.md |
| Find skill pattern | patterns.md |
| Debug/fix skill | gotchas.md |
In This Reference
| File | Purpose |
|---|---|
| anatomy.md | Skill directory structures |
| frontmatter.md | YAML spec, naming, validation |
| progressive-disclosure.md | Token-efficient design |
| bundled-resources.md | scripts/, references/, assets/ |
| patterns.md | Real-world skill patterns |
| gotchas.md | Common mistakes + fixes |
Scripts
| Script | Purpose |
|---|---|
scripts/init_skill.sh |
Scaffold new skill |
scripts/validate_skill.sh |
Validate skill structure |
scripts/package_skill.sh |
Create distributable zip |
Pre-Flight Checklist
Before using a skill:
- [ ] SKILL.md starts with
---(line 1, no blank lines) - [ ]
name:field present, matches directory name - [ ]
description:includes what + when to use - [ ] Closing
---after frontmatter - [ ] SKILL.md under 200 lines (use references/ for more)
- [ ] All internal links resolve
Run: ./scripts/validate_skill.sh ./my-skill
Skill Locations
| Priority | Location |
|---|---|
| 1 | ~/path/to/skills/<name>/ (source of truth for this repo) |
| 2 | .opencode/skills/<name>/ (project-local OpenCode fallback) |
| 3 | ~/.config/opencode/skills/<name>/ (global OpenCode fallback) |
| 4 | .claude/skills/<name>/ (Claude-compat) |
OpenCode should be configured with skills.paths pointing at this repo. Avoid writing generated skills directly into ~/.config/opencode/skills; that makes the runtime copy the source of truth, which is backwards. A tiny tragedy, but still a tragedy.
See Also
- Cloudflare Skill - Reference implementation
04 同仓库更多 Skills
why
Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.
using-git-worktrees
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
unslop
Cut AI tells from any writing. Must always apply.
tmux
Manage long-running commands in the user's current tmux session. Use when starting dev servers, watchers, background logs, or reading/interacting with named tmux panes.
timesharing
Multiplexes one agent's attention across independent long-running external processes while preserving one reasoning context. Use for concurrent tests, builds, servers, watchers, REPLs, benchmarks, downloads, and other latency-bearing shell work; never use it to spawn or substitute subagents.
teach
Teach the user a new skill or concept, within this workspace.