/mthines-agent-skills:create-skill [scaffold|diagnose|prune] [<skill-name>|<path>...]from mthines-agent-skills
Scaffolds new skills from real corrections, diagnoses skill failures with confidence-gated diffs, and prunes skills that don't improve outcomes.
Ships in mthines-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Write a skill from what a real run of the job got wrong, harden an existing skill after it failed, and delete skills that do not earn their context.
Detailed rules live in rules/*.md and templates in templates/*.md; load them on demand.
Parse $ARGUMENTS (first token) and detect the mode:
| Mode | Default | Trigger |
|---|---|---|
scaffold | yes | Default. "create", "scaffold", "new skill", or no mode argument. |
diagnose | "diagnose", "why did miss this", or $0 == "diagnose". | |
prune | "prune", "clean up my skills", "which skills are useless", or $0 == "prune". |
If the user typed a path or skill name as $ARGUMENTS, treat it as the
target for diagnose/prune; for scaffold it is the proposed
skill name.
State the detected mode and target in one line before continuing. Example:
Mode: scaffold
Target: skills/<category>/<proposed-name>/
Run the job first, write the skill second.
Phases 0–2 do the job with no skill loaded and record every correction it needed; Phases 3–5 write a skill made of those corrections only and prove it closes them.
The full procedure for Phases 0–2 is rules/run-first.md; why it beats designing the skill up front is references/run-first-rationale.md.
No one to ask. When the user said not to ask questions, or the session is headless, answer each question below yourself from the request and the run, record the answers in the ledger, and continue.
| Phase | Name | Gate |
|---|---|---|
| 0 | Brief | Task, real input, guardrails, and a definition of done that can fail |
| 1 | Run | The job ran on the real input with no skill and passes its definition of done, and every correction is in the ledger — or the run was waived with a recorded reason |
| 2 | Distill | Every ledger row routed; no-skill exit evaluated; name, description, and invocation settled |
| 3 | Write | Every skill line traces to a ledger row, a guardrail, or the definition of done |
| 4 | Check | scripts/validate-skill.mjs is PASS; wiring done when inside this repo |
| 5 | Verify | A fresh run with the skill needed none of the ledger's corrections |
Ask the user, in one message, for the four brief fields in rules/run-first.md § Step 1: task, a real input, guardrails, and a definition of done.
Do not ask for the skill's name, description, or structure yet.
Do the job on the real input, in this session, without the skill, following rules/run-first.md § Step 2.
Show the output with its definition-of-done result, take the user's corrections, and repeat until they accept it.
Write each correction to the ledger at .agent/{branch}/skill-run-<task-slug>.md as it happens.
✗ Wrong — writing the skill from the user's description of the process
User: create a skill for our weekly client report
Agent: Here is skills/…/weekly-client-report/SKILL.md with 9 steps …
✓ Right — doing the report first
User: create a skill for our weekly client report
Agent: Give me this week's export, what I must not touch, and what "done" means.
I'll produce the report without a skill, you correct me, and the skill
will be made of those corrections.
rules/run-first.md § Step 4) and apply the no-skill exit (§ Step 5).
On a zero count, stop here and say no skill is needed — unless the run was waived, which skips the exit.anthropic or claude.rules/description-writing.md).disable-model-invocation: true) (rules/invocation-control.md).argument-hint only when the run took an argument, allowed-tools only when the run needed repeated permission prompts, and the portable profile only when the user asks for it (rules/frontmatter.md § Portability profile).Write the skill from the ledger, not from the process:
| Ledger route | Becomes |
|---|---|
skill gotcha | one line or one short block under ## Gotchas |
check script | scripts/check-<name>.mjs (zero dependencies, ${CLAUDE_SKILL_DIR}-anchored; rules/scripts-and-assets.md) plus one line to run it before reporting done |
subagent step | one instruction to run that step in a sub-agent and return only its result |
hook, workspace fact | its routed destination, never the skill |
Never add a step the agent did correctly in the run, a heading with no ledger row under it, or frontmatter the run did not need.
Start from templates/SKILL.minimal.md; split into rules/ only when the body passes 200 lines (rules/structure-decision.md).
<!-- ✗ Wrong — a manual for the process, plus ceremony -->
## Overview / ## Steps (1. Read the export. 2. Compute totals. …) / ## Best practices / ## Troubleshooting
<!-- ✓ Right — only what the run got wrong, and how done is checked -->
## Gotchas
- Refund rows carry positive amounts; subtract them.
- JPY has no minor unit; never divide its amount by 100.
Before reporting done, run `node ${CLAUDE_SKILL_DIR}/scripts/check-report.mjs report.md` and show its last line.
Run node ${CLAUDE_SKILL_DIR}/scripts/validate-skill.mjs <dir> [--portable], fix every FAIL, and report its Self-check: line verbatim.
FAIL FM05 SKILL.md:3 — description must be non-empty and <= 1024 chars, got 1180
Self-check: FAIL — 1 failing
Inside this repo (it has scripts/sync-symlinks.sh), place the skill at skills/<category>/<name>/, run bash scripts/sync-symlinks.sh, and add the inventory hook to CLAUDE.md and the row to README.md (rules/repository-conventions.md).
Anywhere else, skip wiring and state where the skill was written.
Re-run the Phase 0 brief in a sub-agent with the skill installed, on a fresh input (another real input, or the same one with the previous output deleted), and check that no ledger correction recurs.
A recurring correction means the line meant to prevent it is wrong or missing: fix that line and re-run once.
Report Verify: PASS — fresh run, 0 of <n> corrections recurred.
The lift check (rules/lift-check.md) is not part of a scaffold: run it when the user asks, or before the skill is shipped to other people.
For diagnose mode, do not scaffold or review.
Analyse a session in which another skill executed and produced an
unsatisfactory result, identify which of that skill's gates should have
caught it, and emit a confidence-gated unified diff that hardens the target
skill against the same failure class.
The full procedure (seven steps, including the mandatory
confidence(analysis) ≥ 90 % gate before --apply), the report format,
and the hard rules live in rules/diagnose-mode.md.
Invocation:
/create-skill diagnose <target-skill-name> [--symptom "..."] [--scope <phase|companion>] [--apply] [--pr] [--no-write]
The target declares its own diagnostic surface in
skills/<target>/rules/diagnostic-surface.md (skills) or
agents/<target>/rules/diagnostic-surface.md (agents) — phase model,
failure taxonomy, existing-guards table, source root, hard invariants.
Step 1 of Diagnose Mode disambiguates by checking both locations.
The contract spec is in rules/diagnostic-surface.md;
the scaffolding template a target drops into its own rules/ is
templates/diagnostic-surface.template.md.
If the target has not declared a surface, Diagnose Mode falls back to
inferring phases from the target body's H2 sections (SKILL.md for skills,
agents/<name>.md for agents) and warns the user once that fidelity is reduced.
Diagnose Mode never modifies user product code. It only proposes changes to the target's own source.
Self-improving skills. An orchestrator skill can close the loop further with
a two-tier self-improvement loop: a fast episodic-lessons tier
(LoreKit memory.* tools) feeding the slow diagnose tier via a recurrence gate.
The reusable recipe — including when NOT to add one — is in
rules/self-improvement-loop-pattern.md.
When a target declares a ## Lessons scope, Diagnose Mode reads it as evidence
(Step 2).
For prune mode, clean up an installed skill set; follow rules/prune-mode.md:
claude -p "/skill-doctor".rules/lift-check.md), highest cost first; no lift over the dummy makes it a trim or delete candidate.Why: references/lift-and-prune-rationale.md.
Load these on demand — do not preload them all.
| Phase | Files |
|---|---|
| 0–2 | rules/run-first.md, rules/description-writing.md, rules/invocation-control.md |
| 3 | rules/scripts-and-assets.md, rules/structure-decision.md (only past 200 lines), templates/SKILL.minimal.md |
| 4 | rules/repository-conventions.md (inside this repo only) |
| prune | rules/prune-mode.md, rules/lift-check.md |
| diagnose | rules/diagnose-mode.md, rules/diagnostic-surface.md, plus the target's rules/diagnostic-surface.md |
| loop | rules/self-improvement-loop-pattern.md (adding a self-improvement loop to an orchestrator skill) |
| lens | rules/review-lens-contract.md + templates/lens.md (making an existing skill lens-eligible for pr-reviewer) |
rules/run-first.md).A scaffold run is done when:
.agent/{branch}/skill-run-<task-slug>.md routes every correction.SKILL.md line traces to a ledger row, a guardrail, or the definition of done.validate-skill.mjs reports PASS.CLAUDE.md and README.md rows exist.A prune run is done when:
unchecked mark.A diagnose run is done when:
F-novel plus a
proposed new row).confidence(analysis) score recorded; --apply honored only at
≥ 90 % (final score, after Step 6.5's two-iteration refinement loop
if the initial score was below the gate)..agent/{branch}/diagnose-{target}.md (or
stdout with --no-write).--apply ran, user explicitly confirmed before git apply.references/lift-and-prune-rationale.md (opens in a new tab)references/run-first-rationale.md (opens in a new tab)rules/description-writing.md (opens in a new tab)rules/diagnose-mode.md (opens in a new tab)rules/diagnostic-surface.md (opens in a new tab)rules/frontmatter.md (opens in a new tab)rules/invocation-control.md (opens in a new tab)rules/lift-check.md (opens in a new tab)rules/prune-mode.md (opens in a new tab)rules/repository-conventions.md (opens in a new tab)rules/review-lens-contract.md (opens in a new tab)rules/run-first.md (opens in a new tab)rules/scripts-and-assets.md (opens in a new tab)rules/self-improvement-loop-pattern.md (opens in a new tab)rules/structure-decision.md (opens in a new tab)scripts/validate-skill.mjs (opens in a new tab)templates/SKILL.minimal.md (opens in a new tab)templates/SKILL.multi-file.md (opens in a new tab)templates/SKILL.portable.md (opens in a new tab)templates/diagnostic-surface.template.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (mthines/agent-skills) — no native marketplace selected
npx claudepluginhub p/mthines-mthines-agent-skills54 skills in this plugin
/ai-engineeringReviews and guides LLM/AI application engineering — prompts, caching, RAG, agent loops and tools, resilience, model migration, evals, prompt-injection defence, and observability. Invoke with /ai-engineering for "review my prompt", "set up RAG", or "write evals".
/animationsAuthors performant CSS-first web animations and picks the right feedback for an interaction — transitions, View Transitions, scroll-driven motion, Motion for React, reduced motion, and perceived performance. Triggers on "animate this", "hover effect", "feel faster", "skeleton loader", "/animations".
/animations-nativeAuthors performant React Native / Expo animations and gestures with Reanimated and react-native-gesture-handler on the UI thread; web animations go to `animations`. Triggers on "reanimated", "react native animation", "gesture handler", "swipe gesture", "/animations-native".
/atelierTakes one change from request to merged PR by sequencing existing skills — aw builds the draft PR, prepare gets it green, a deterministic gate allows the squash-merge only when a user-visible diff that needs a rollout ships behind a deployment-verify flag contract, or a small one carries a classed no-flag marker (and, in a repo with a hosted service, every diff carries a contract or an opt-out) — then reads the default-branch pipeline, fixes a red one once, verifies a no-flag change on the deploy with deployment-verify, and says what a human does next. Resumable from a sticky PR comment; invoke with /atelier.
/attach-mediaUploads local screenshots and recordings to GitHub and embeds them in a PR or issue body or comment as inline-rendering user-attachments URLs, via `gh --attach` with a curl fallback; never writes placeholders. Triggers on "attach screenshots to the PR", "upload this recording to the PR", "/attach-media".
/autonomous-workflowThe phase machinery (0–7) behind the `aw` dispatcher: task intake through a tested draft PR in an isolated worktree, gated by the plan.md brief and the run-checks.mjs sentinel, with companions that never block. Not the entry point — natural-language requests for autonomous work go to the `aw` skill; invoke /autonomous-workflow only to run the phases directly.
Other plugins' skills for the same job