/skill-forge:create-skillfrom skill-forge
Guides creation of new agent skills through a test-driven workflow: write evals, confirm baseline failure, author minimal skill, verify flip.
Ships in skill-forge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Create skills the way disciplined engineers create code: evidence first, minimal content, a flipped baseline as the shipping gate.
Creating a skill IS test-driven development applied to process documentation. Write the eval, watch the baseline agent fail (RED), write the minimal skill that flips it (GREEN), close the loopholes evaluation exposes (REFACTOR). If you didn't watch an agent fail without the skill, you don't know that the skill teaches anything.
The Iron Law, tiered:
Structure and budget rules: references/skill-anatomy.md. Writing rules: references/writing-guide.md. Evaluation machinery: the eval-skill skill — this workflow invokes it rather than duplicating it.
There is no launcher script — resolving the CLI is your job, once, before the first command. From the create-skill skill root:
1. bin/ holds this platform's compiled binary? -> use that path
macOS: bin/create-skill-darwin-arm64
Linux: bin/create-skill-linux-x64
Windows: bin/create-skill-windows-x64.exe
2. no binary for this platform: the CLI is unavailable -- report that
and stop; never improvise a substitute
Every create-skill … command below means the command resolved here.
This document also issues eval-skill … commands (steps 3, 6, 8) — a different
binary. Resolve those once through the eval-skill skill's own § CLI resolution;
invoke that skill rather than guessing a path. An unresolvable command is a stop,
not a licence to improvise: an in-session subagent is not a substitute for a
hermetic eval-skill run, and step 3 depends on that distinction.
Create when the technique wasn't intuitively obvious, would be referenced again across projects, and applies broadly. Don't create for one-off solutions, standard practices already well-documented, project-specific conventions (those belong in the project's instructions file), or anything enforceable by a validator/regex — automate mechanical constraints; save documentation for judgment calls.
Two safety rules regardless of type: handle bundled scripts and external actions according to their risk — an operation that can be destructive or irreversible gets a plan → validate → execute → verify structure, never a bare command. And never create a skill whose behavior would surprise its user: no concealed side effects, no undisclosed data flows, nothing that facilitates unauthorized access.
Skill types (drives both writing form and eval design):
| Type | What it is | Eval focus |
|---|---|---|
| Technique | Concrete method with steps | Application to new scenarios |
| Pattern | A way of thinking about problems | Recognition + counter-examples |
| Reference | API docs, schemas, tool guides | Retrieval + correct application |
| Discipline | Rules with compliance costs | Pressure scenarios |
| Tool | Bundled scripts/APIs are the contract | Resource scenarios (script runs correctly on real input AND fails safely on bad input; agent uses the bundled script rather than reimplementing it) |
flowchart LR
A[Capture intent +\nconcrete examples] --> B[Write evals]
B --> C{RED: baseline\nfails?}
C -- passes --> X[Stop: skill unneeded\nor eval broken]
C -- fails --> D[Scaffold + write\nminimal skill]
D --> E[GREEN: subagent\nspot-check]
E --> F{RED failures\nflipped?}
F -- no --> G[REFACTOR:\nimprove skill]
G --> E
F -- yes --> H[Ship + hand off\nformal validation]
Inspect before asking: read the conversation, the target directory, any existing skill being revised, and neighboring skills' descriptions — trigger collisions are cheapest to catch here. If the conversation already contains the workflow ("turn this into a skill"), extract from history first — tools used, step sequence, corrections made, formats observed — and have the user confirm. Ask only what is both undiscoverable and consequential, a few questions at a time:
Research edge cases, input formats, and dependencies before writing anything. Classify the skill type (table above).
Collect 3+ concrete example requests — realistic, specific, the kind of thing a user would actually type. Then extract two artifacts from them:
runbooks/<skill-name>.yaml at the repo root, holding the run definition plus evals[]/trigger_evals[] (contract: the schemas reference in eval-skill; design rules: the scenario-design reference in eval-skill). Scaffold the file with eval-skill init-runbook rather than hand-rolling the YAML — the init-eval-infra skill choreographs it together with the discovery-root mounts. The suite lives in the repo's runbooks/, never inside the skill directory. The examples that define the skill are the evals that test it — gathering examples and never testing against them wastes the best evidence available.Before writing any skill content, run the eval prompts against the baseline configuration via eval-skill's Tier 2 harness — eval-skill run-behavioral --configuration without_skill, one hermetic run per eval: fresh sandbox, empty discovery root, --safe-mode, so the baseline is provably skill-free in a way no in-session subagent can be. No skill for a new skill; a snapshot of the current version when improving an existing one. This is the authoring flow's one deliberate headless-CLI expense, and it is paid once per eval, not once per iteration — the loop that follows never re-runs a baseline it already has.
create-skill commands in this document run from the create-skill skill
root, spelled with the resolved command from § CLI resolution.
create-skill init-skill <skill-name> --path <parent-dir> [--resources scripts,references,assets]
Decide the target platform profile (portable / claude / codex / both) before scaffolding — rules: references/platform-compatibility.md. When the user hasn't named a destination, default to the repo's canonical skills directory (<repo>/skills/<name>) mounted into each target platform's discovery root with relative symlinks — .claude/skills/<name> for Claude Code, .agents/skills/<name> for Codex; validate the mounts with create-skill validate-mounts --repo-root <repo> (pass --fix to create missing links). Installs are repo-level, not user-home level: the skill ships with the repo it serves.
When the working directory resolves to no repo — not a git repository, or no canonical skills/ to mount into — that default has no referent, and ~/.claude/skills/ is the one destination it must never silently become. A home install strands the skill outside the repo that serves it and leaves steps 2 and 3 with no runbooks/ to write into, so one wrong destination silently voids the entire RED chain. Establish the repo shape in the working directory instead — skills/, runbooks/, and both discovery roots, which the init-eval-infra skill scaffolds — or, when the working directory is genuinely not the skill's home, ask. Either way, state the destination you chose before scaffolding.
Then implement bundled resources BEFORE writing SKILL.md — a body written first tends to reference files that never get created. Test every script by actually running it (quality bar: writing-guide.md § Bundled script quality). The scaffold's TODO placeholders are enforced: eval-skill's Tier 0 lint fails on any leftovers.
Write SKILL.md addressing the specific baseline failures documented in RED — nothing speculative (YAGNI applies to documentation). Follow references/writing-guide.md for the description (third person, capability + triggers, never a workflow summary) and body (imperative, explain-the-why, one excellent example), and references/skill-anatomy.md for structure and budgets.
Match the guidance form to the observed failure type (writing-guide.md § Match the form to the failure) — the baseline evidence tells you whether you need a recipe, a required slot, a conditional, or a prohibition with counters.
Run Tier 0 (eval-skill validate-skill — local, seconds). Then re-run the eval prompts as fresh subagents with the skill now mounted — all fanned out in one turn, each given the eval's prompt and nothing else (blinding is a discipline here: never the runbook, expectations, or a sibling's output). Judge each output against the runbook's expectations and the verbatim RED record: GREEN is every documented baseline failure flipped. A run that fails because the skill never triggered is evidence too — of a description problem (step 8), not a content problem. For discipline skills, spot-check the pressure prompts the same way and capture new rationalizations verbatim.
This loop is deliberately informal, and that is its speed. No paired runs, no run dirs, no grading processes, no report — subagent-fast, zero headless-CLI spawns, and honest about being an unmeasured upper bound (the author judges; the subagents share this session's environment). It answers the only authoring-time question — does the draft fix what RED documented? — and nothing else. Formal measurement (Tier 1 trigger rates, paired hermetic runs, headless grading, report.html) is one runbook execution away whenever wanted — trigger measurement on request in step 8, everything else through step 9's hand-off — and never runs per-iteration.
Improve based on spot-check results and human feedback, then re-run step 6:
scripts/.Stop iterating when: the user is satisfied, all review feedback comes back empty, or two consecutive iterations show no meaningful movement (report raw counts, not vibes).
After content stabilizes, run eval-skill's Tier 1 trigger measurement; if triggering is weak, use its description-optimization loop (run-loop — train/test split, held-out selection). This is a headless-CLI sweep — the first spawn cost since RED — so run it when the description is worth measuring, with the user's go-ahead. Curate the query set with the user first. Never hand-inflate the description with pushy phrasing instead — measured precision/recall or nothing.
Ship on authoring evidence, labeled as exactly that: Tier 0 zero FAILs, the RED baseline documented, every documented failure flipped in step 6's spot-check, pressure prompts held (discipline skills). That evidence is spot-checked, not measured — report it with raw counts and never present it as a passed gate or a benchmark.
Formal validation is the user's move, not this loop's tail. The runbook from step 2 makes it one ask away — "run the runbook" hands the full pipeline (paired hermetic runs, headless grading, trigger measurement, report.html) to eval-skill's choreography, which dispatches a fresh subagent to execute it end-to-end. On scaffold dials (executor: subagent, runs_per_configuration: 1) that first measured run stays cheap and directional; when the user wants gate-closing numbers (a publish-grade "proven better", a regression gate, a repo's gating suite), tighten both dials in one edit — executor: cli, runs_per_configuration ≥ 3 — and only that run may close a gate (why the loose dials can't: quality-standards.md § Shipping bar and § Execution-carrier rules). State this hand-off when shipping; run nothing unasked.
Once the bar is met:
create-skill package-skill <path-to-skill> # produces a .skill file, when packaging is wanted
Pass --platform <darwin-arm64|linux-x64|windows-x64>|all to compile and inject a standalone binary for that platform into the .skill instead of raw TypeScript source (writes <skill-name>-<platform>.skill); --entry overrides the default CLI entry point for a skill living outside this repo's own src/ layout.
The runbook (runbooks/<skill-name>.yaml) stays in the repo alongside the skill — it is the regression suite future edits re-run.
Shipping hands back, it doesn't push forward: never publish, install globally, or delete source material (pre-consolidation skills, extracted conversation notes) unless the user asks; commit with the user's go-ahead, not by default.
Sharing with Codex: generate the agents/openai.yaml UI-metadata sidecar with create-skill generate-openai-yaml <skill-dir> --interface ... (field rules: references/openai-yaml.md). The sidecar ships inside the skill; the body stays platform-neutral (policy: references/openai-yaml.md; portable-core rules: references/platform-compatibility.md). For a repo-scoped both profile, re-run create-skill validate-mounts after shipping so both discovery roots provably resolve to the same canonical source.
One skill at a time. Complete this entire workflow — through step 9's ship — before starting the next skill. Batching skills means shipping untested skills.
The same workflow applies — the deltas are in what counts as RED's baseline and what must be preserved:
Revision discipline. Snapshot the current version outside the target directory before the first edit — the snapshot doubles as the Tier 2 baseline. Preserve the skill's name and its supported behavior unless the user explicitly asks for a breaking change. If the skill has no eval suite yet, backfill one first: turn its observed current behavior into regression cases BEFORE editing, so the revision has something to hold it steady.
Consolidation (N skills → one). Build an instruction-ownership map outside the target before drafting: every source capability, resource, and runtime directive maps to exactly one destination. The source skills are the baseline configuration; their evals seed the merged suite; their should-trigger queries must still trigger the merged skill unless a narrowing was deliberate. After drafting, walk the map to verify coverage and cut paraphrased restatements — near-duplicate guidance surviving a merge is how skills bloat. The map is working material: it never ships inside the skill.
| Excuse | Reality |
|---|---|
| "The skill is obviously clear" | Clear to the author ≠ clear to a fresh agent. That's what the eval measures. |
| "It's just a reference skill" | References have gaps and stale sections. Retrieval evals find them. |
| "Evaluation is overkill for this" | Untested skills fail in production, where debugging costs 10× the eval. |
| "I'll evaluate if problems emerge" | Problems = agents silently doing the wrong thing. Nobody files a bug. |
| "The baseline obviously fails" | Then demonstrating it costs one run. Skipping it costs the evidence for every later decision. |
| "Formal eval is deferred anyway, so skip the baseline too" | The hand-off defers measurement, not evidence of need. RED is the specification — a few hermetic runs, paid once. Content written without a failing baseline is speculation. |
| "No time to test" | The eval corpus already exists — it's the examples from step 2. Running it is the cheap part. |
RED
runbooks/<skill-name>.yaml)GREEN
create-skill init-skill; resources built and scripts executed before body writtenREFACTOR
Ship
executor: cli and runs_per_configuration ≥ 3 — subagent or n=1 numbers never presented as a closed gaterunbooks/; skill packaged if wanted; committed with the user's go-aheadbin/create-skill-<platform> — compiled CLI binary, present only in a published package (§ CLI resolution; a dev checkout has no bin/ and runs the repo's TypeScript source under Bun)references/skill-anatomy.md — structure, naming, progressive-disclosure budgets, resource taxonomyreferences/writing-guide.md — description/body writing rules, structure selection, form-matching, bulletproofing, script qualityreferences/platform-compatibility.md — platform profiles, portable-core rules, repo dual-mount layout; read before creating a shared Codex/Claude skillreferences/openai-yaml.md — Codex sidecar field rules; read before generating or editing agents/openai.yamlcreate-skill subcommandsinit-skill — scaffold a new skill directory (template with lint-enforced TODO placeholders)package-skill — validate and package a finished skill into a .skill filegenerate-openai-yaml — platform adapter: generate the Codex agents/openai.yaml sidecarvalidate-mounts — verify repo-level dual-platform symlink mounts (.claude/skills, .agents/skills) resolve to the canonical skillZero-dependency TypeScript, run through create-skill <subcommand> ... (Bun ≥1.3 when running from repo source) — no separate install step, no Python.
REQUIRED SUB-SKILL: eval-skill — owns all evaluation machinery (lint, trigger tests, paired benchmarks, pressure tests, judge agents, schemas, viewer) plus the quality-standards rulebook this workflow ships against. If eval-skill is not available in the environment, say so and stop at a draft — a defined-but-unexecuted eval is not evidence, and authoring confidence is not a shipping gate.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub neokn/skill-forge --plugin skill-forge3 skills in this plugin
/eval-skillThis skill should be used when the user wants to evaluate, test, benchmark, or regression-check an existing agent skill — measuring whether the skill triggers on the right queries, whether it actually improves agent behavior compared to a baseline, whether a discipline skill holds up under pressure, or whether a skill still works after edits or a model update — or wants to execute a saved eval runbook from the repo's runbooks/ directory. Trigger phrases include "evaluate this skill", "test my skill", "benchmark skill performance", "run skill evals", "run the runbook", "did this skill regress", "is the new version better". Also invoked by create-skill as the quality gate inside its creation loop./init-eval-infraUse when a skill repo needs eval infrastructure bootstrapped for one of its skills — fixing the .claude/skills and .agents/skills symlink mounts and generating a starter runbooks/<id>.yaml so eval-skill can run against it. Trigger phrases include "set up eval infra for X", "scaffold a runbook for my skill", "make this skill repo eval-ready", "bootstrap eval infra". Requires create-skill and eval-skill to already be installed, and requires the target skill itself to already exist under skills/ (created via create-skill's init-skill). Does not author the eval content itself — trigger_evals[]/evals[] ship as TODO placeholders; writing real evals is eval-skill's job, guided by its references/scenario-design.md.Other plugins' skills for the same job