Skill Creator
A workflow for creating, revising, evaluating, optimizing, and packaging OpenCode skills.
Prefer the smallest skill that reliably triggers and gives clear execution guidance. When reviewing an existing skill set, check neighboring skills for overlap and tighten trigger boundaries together rather than editing one skill in isolation.
Do not use this skill when the user is applying an existing skill to a normal task, such as reversing a website or writing a hook. Use it only when the object of work is a skill definition, description, eval, packaged resource, or trigger boundary.
If the user is editing opencode.json, agents, plugins, MCP servers, or permission rules and is not changing a skill, use customize-opencode instead.
Core Loop
- Capture the skill's intent and success criteria.
- Draft or revise
SKILL.mdand any bundled resources. - Add realistic eval prompts and, where useful, objective assertions.
- Run the skill against test prompts and compare against a baseline when feasible.
- Review qualitative outputs and quantitative benchmark data with the user.
- Improve the skill based on feedback and rerun.
- Package the final skill when the user is satisfied.
Adapt the depth of this loop to the user's request. If they ask for a lightweight cleanup, do not force a full benchmark. If they ask whether a skill is actually helping, run the evaluation workflow.
Confirmation Checkpoints
Match the user's requested mode before editing anything.
Pause and confirm before:
- Creating a new skill directory, overwriting an existing
SKILL.md, or moving long content into newreferences/,scripts/,assets/, orevals/files. - Adding eval prompts that include real target URLs, cookies, tokens, proprietary workflows, or other sensitive samples.
- Running a benchmark that will spawn subagents, call browser/network tools, install dependencies, or generate large result artifacts.
- Packaging, publishing, copying into an installed skills directory, or changing an active skill used by the current OpenCode session.
If the user asks for review, scoring, trigger analysis, or explanation only, stay read-only and return findings plus proposed edits. Do not silently upgrade a review into file modification.
Communicating With The User
Match the user's technical level.
- Use terms like evaluation, benchmark, JSON, and assertion when the user appears comfortable with them.
- Briefly define terms when the user may not know them.
- For lightweight requests, give concise findings and edits.
- For evaluation-heavy requests, explain what will be tested and how the user can review results.
Creating Or Revising A Skill
Capture Intent
Extract what you can from the current conversation before asking questions.
Clarify only what is needed:
- What should this skill enable OpenCode to do?
- When should this skill trigger, and when should it not?
- What output should a successful run produce?
- Should this skill include evals, scripts, templates, references, or assets?
Research Nearby Skills
Check available skills and adjacent trigger areas before editing.
Common overlaps:
- Browser hook injection vs crypto entry tracing.
- Crypto entry tracing vs Node.js environment patching.
- AST deobfuscation vs runtime debugging.
- General workflow guidance vs a narrow task-specific skill.
When overlap exists, tighten all relevant surfaces:
- Frontmatter
description. - Trigger boundary section.
- Handoff guidance.
- Near-miss negative eval prompts.
Write SKILL.md
Required frontmatter:
name: kebab-case skill identifier.description: primary trigger signal; include concrete trigger contexts and nearby non-trigger cases.
Optional frontmatter:
compatibility.argument-hint.allowed-tools.metadata.
Recommended structure:
skill-name/
├── SKILL.md
├── scripts/ # deterministic helpers or templates
├── references/ # detailed docs loaded as needed
├── assets/ # templates, icons, HTML review pages
└── evals/ # local test prompts, usually excluded from package output
Keep SKILL.md focused. If it approaches 500 lines, move long procedures to references/ and leave clear pointers.
Writing Guidance
- Put trigger guidance in the frontmatter
description, not only in the body. - Use imperative instructions.
- Explain why important constraints exist instead of relying only on rigid MUST/NEVER wording.
- Include examples when output format matters.
- Bundle scripts only for repeatable work that future runs would otherwise recreate.
- Do not include malware, credential exfiltration, misleading behavior, or surprising capabilities.
Testing And Evaluation
Use references/evaluation-workflow.md when the user asks to test, benchmark, add evals, compare iterations, or prove that a skill helps.
Short version:
- Save realistic prompts to the evals/evals.json file in the target skill.
- Run with-skill and baseline outputs when feasible.
- Draft objective assertions while runs execute.
- Save timing and grading data.
- Aggregate with
scripts/aggregate_benchmark.py. - Present qualitative outputs and benchmark results for user review.
Use agents/grader.md, agents/analyzer.md, and agents/comparator.md when grading, analyzing benchmarks, or doing blind comparisons.
Description Optimization
Use references/description-optimization.md when the user asks to improve trigger accuracy, optimize a description, add trigger evals, or reduce skill overlap.
Use references/trigger-eval-quickcheck.md when the user only wants a lightweight review of existing trigger evals without running the full optimization loop.
Short version:
- Create about 20 realistic trigger eval queries.
- Include both should-trigger and near-miss should-not-trigger prompts.
- Let the user review the eval set with
assets/eval_review.htmlwhen possible. - Run
scripts/run_loop.pyif the required CLI dependencies are available. - Apply
best_descriptionand report before/after scores.
Environment Adaptation
Use references/environment-adaptation.md when the environment is limited, headless, remote, or when packaging/updating installed skills.
Key rules:
- In limited environments, run test prompts yourself and use inline review.
- In headless environments, prefer static artifacts or conversation review over local browser servers.
- Preserve the existing skill name when updating a skill.
- Package with
scripts/package_skill.pywhen ready.
Improvement Heuristics
When revising a skill after feedback:
- Generalize from feedback rather than overfitting to one prompt.
- Remove instructions that cause wasted work or excessive token use.
- Split repeated helper code into
scripts/if multiple evals recreate it. - Move long background material to
references/. - Strengthen trigger boundaries when a skill steals work from a neighboring skill.
- Add near-miss evals for every boundary bug you fix.
Packaging
When the skill is ready:
python scripts/package_skill.py <path/to/skill-folder> [output-directory]
The packager validates the skill and excludes local build artifacts such as __pycache__ and .pyc files.
Reference Files
references/evaluation-workflow.md: full eval, benchmark, grading, and review loop.references/description-optimization.md: trigger eval generation and description optimization loop.references/environment-adaptation.md: limited/headless environment handling and packaging notes.references/trigger-eval-quickcheck.md: lightweight trigger eval coverage review.references/schemas.md: JSON schemas for eval and benchmark artifacts.agents/grader.md: grading assertions against outputs.agents/analyzer.md: analyzing benchmark results.agents/comparator.md: blind A/B comparison.
Troubleshooting And Recovery
| Problem | Recovery |
|---|---|
Eval script crashes (run_eval.py, run_loop.py) |
Check Python 3 is available: python --version. Verify evals/evals.json is valid JSON. Run with --verbose if supported. Fall back to manual dry-run evaluation. |
| Frontmatter not parsed by OpenCode | Ensure file uses ---\n delimiters (not ---\r\n from Windows). Check description is ≤1024 chars. Remove non-standard fields (compatibility, argument-hint) that OpenCode ignores. |
| Skill overlap with another skill is unresolvable | Present a comparison table to the user: both descriptions, both trigger scenarios, and 3 near-miss prompts. Offer options: merge into one skill, split by explicit boundary, or keep both with tightened anti-triggers. Require explicit user choice. |
| Benchmark shows regression after edit | Do not discard the data. Record the failed attempt in results.tsv. Revert the edit. Diagnose why: over-specificity, conflicting instructions, or wrong dimension targeted. Try a different dimension next round. |
package_skill.py fails |
Check the skill folder has SKILL.md with valid frontmatter. Ensure no symlink loops in references/. Remove __pycache__ manually if needed. |
| No test-prompts.json exists for a skill | Create one before evaluating. Use 2-3 typical user prompts covering the happy path and one ambiguous edge case. Save as JSON array: [{"id":1,"prompt":"...","expected":"..."}]. |
| User wants to undo all optimization | If git is available: git log --oneline to find the commit before optimization, then git revert each commit back. If not: restore from the backup copy in skills-archive/. |