/toycrane-skills:llm-evalsfrom toycrane-skills
Creates and runs evals to measure LLM output quality for non-deterministic behaviors like prompts, classifiers, extractors, summarizers, and tool-using agents. Defines capability evals and regression suites with scored case sets.
Ships in toycrane-skills. 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.
Prove a criterion about LLM output with an eval: an approved case set, a runner that calls the product's entry point, and a grader, scored over repeated runs. It is a test in a noisy medium. The bar exists before the behavior changes, the baseline score is the red, and the green is a held-out score at or above the target and above the baseline outside the noise floor.
An eval is one of two kinds. A capability eval starts below the target so there is a hill to climb, and it is finished once it reaches green. A regression suite holds the cases a capability eval finished with, at the level they reached, so a score below that level means something broke rather than that there is room to improve. Every criterion starts as a capability eval and ends by graduating into the project's one regression suite.
Read GLOSSARY.md, then use docs/decisions/README.md to load only the
decision subjects relevant to the behavior under evaluation. Surface a conflict
between code, spec, and a decision contract instead of choosing silently.
When implement hands over work, it names the criterion with its metric, its
target on held-out cases, and where the cases come from, plus the active
outcome and the spec as design context. Prove only that criterion. A handed
criterion without a target goes back for shaping: inventing one would let
implementation set its own bar. Invoked directly, derive the criterion from the
request and ask the user for the metric and target when it gives none.
When the project already holds an eval that measures the same behavior, such
as a skill's eval folder or a flow under .claude/hillclimb/, use
it instead of building another. It still goes through the access choice and
the approval below.
Before building anything, ask once how the eval reaches the model, because the
runner's shape and the pilot depend on it. Check what exists without printing
a secret: an API key in the environment or in the env file the product reads,
and a logged-in claude or codex CLI.
The user's answer is the choice; record it in _state.json.
On a subscription, an app feature's runner swaps only the model call for a CLI
call with the app's own system prompt and model and no tools, for example
claude -p --system-prompt <prompt> --tools "" --model <model> --output-format json
with --json-schema for structured output, or codex exec -m <model> with
--output-schema. claude --bare skips the keychain, so it needs a key. For a
skill or agent, the CLI run is the real entry point either way: set the key in
the child environment for API access and clear it for the subscription.
Cases. Take cases from production logs, then bug reports, then examples
the user gives. Synthesize only variations of real examples plus what makes a
case hard here. Size the set against the change you need to see: a pass-rate's
95% interval is about 1/sqrt(cases × reps), so 25 cases at 2 reps is about
±14 points. Split train and test at random, balanced by the primary tag. With
too few cases to split, score the whole set, label the result directional, and
confirm any revision made after seeing failures on cases not seen before.
Runner. Call the product's real entry point; never rebuild the model call
from the prompt you found. Write each (case, rep) as it finishes, so a restart
skips what is already written. The same holds across the whole climb: never
run a (variant, case, rep) that already has a scored row from the same cases
and grader; read that row instead. An attempt recorded only in errors.jsonl
has no row and runs again. The project chooses where its eval root lives:
use the one its agent instructions name, else the folder its existing evals sit
in, else .claude/hillclimb/. Never put it inside a folder that ships to
users, such as a skill's own folder: installers copy that folder whole, and
its users never need the eval. The layout under that root is fixed. The root
holds the runner, regression/ (its log.md, its cell-history.json, and
one folder per graduated criterion), and one folder per capability eval. Name that
folder for the spec folder whose criterion it proves, and for the criterion too
when that spec has more than one of them, so two criteria handed over
separately never land on the same folder. This eval's folder holds
cases.jsonl, its grader, _state.json (metrics with the headline first,
train and test ids, the access choice, the approved spend), and one results
folder per variant named baseline or v<N>, in the shape claude-api's report
tools read. Each variant holds results.jsonl, one row per (case, rep) with
prompt_id, rep, tags, grade as {metric: number}, status, model
read from the response, and usage, keeping each check's verdict so its cells
can be counted; traces/<id>_rep<k>.json with the whole
exchange; and errors.jsonl for attempts that failed before a scorable output. A trial the
model never finished answering is not a result. One that ended on an API
error, such as a usage or rate limit, a network failure, or a timeout, is
recorded with its class in errors.jsonl, never graded, and counted as
neither a pass nor a fail. Decide this from the state the entry point reports,
such as Claude Code's is_error on a result whose subtype still reads
success, never from the grader's reading of the output. A row such a trial
already left in results.jsonl moves to errors.jsonl, so scores and the cell
history count only answered trials and the next run fills it. Run trials
concurrently whatever the access: each one draws the same cost or usage, so
running them one at a time only takes longer. Add nothing to wait out limits;
a limit only leaves trials for the next run to fill. Give each case a
wall-clock ceiling, and fail an attempt whose served model differs from the
requested one.
Skills and agents. The entry point is an agent run with the skill or agent
installed in a disposable workspace. Grade the end state it leaves: hidden
tests pass, expected files exist, nothing off-limits changed, and a no-op that
claims success fails. Record steps through a hook when the process itself is a
criterion. The baseline is the previous skill text, or no skill for a new one.
Keep each workspace outside any .claude/ folder: headless Claude Code treats
every write there as sensitive and denies it. Record a run whose file writes
were denied as a harness failure, not as a score.
Grader. Choose the cheapest grader that truly measures the criterion: a programmatic check, then a pairwise judge against frozen baseline outputs, then a rubric judge with structured output and concrete checkable claims, then a person. Never let the model under test judge itself. Before approval, push the reference answers through runner and grader and see about 100%, push empty and constant outputs and see about 0%, and see a judge fail an empty answer, "I don't know", and a confident answer to the wrong question. Keep expected answers where the model under test cannot read them.
When claude-api is installed and the model under test is Claude, you may use
its runner scaffold and report builder from its own skill folder. Otherwise
build the same contract in the project's language.
Run a pilot of at most three cases at one rep through the whole runner and grader, and read a written row to see every field filled. Then stop once and show:
guards field;Wait for a clear yes. Changing the cases, grader, split, or budget after approval needs approval again.
Run the full set on the unchanged behavior and record it as the baseline: this is the red, for train, for test, and for the project's regression suite, so a suite already failing before this climb is not later read as its doing. When that baseline already sits near the target there is no hill to climb: report that the cases are too easy for this behavior and ask for harder ones instead of climbing. Then climb in rounds:
change.md.Reach green only by changing the behavior. Never weaken, drop, or re-split cases or the grader to pass.
Green ends the capability eval, so finish it instead of leaving it in place.
Take the cases the final variant passed on every repetition from the rows it
already has: train from its round and held-out from the final gate, or the
whole set from its round when the set was not split. Do not run it again for
graduation. Move their cases.jsonl rows and this eval's grader into
regression/ under the eval root, in a folder named the way this eval's was,
and carry the grader whole: the code checks and the rubric both go, because
dropping the rubric stops guarding the regressions only a judge can see. Carry
what the grader reads as well, since the rest of the folder is about to go —
the frozen baseline outputs a pairwise judge compares against, its fixtures,
and the expected answers it scores from. Add each graduating cell — one case
judged by one check — to the cell history with its trials and passes from those
rows, their results in order as its recent results, and its result at this
climb's baseline. A cell that failed at the
baseline goes to the upper tier. A cell that already passed at the baseline
goes to the upper tier only when its case's guards states what it guards
against, and to the lower tier otherwise; a suite with no lower_tier_model
yet takes the climb's model as it. Delete the rest of this eval's folder, append
one line to regression/log.md with the date, the criterion, the baseline and
final scores, the noise floor, the model, and the commit, and record the eval
root's path in the project's agent instructions — AGENTS.md, created when
missing, and CLAUDE.md too when it exists and does not load AGENTS.md — so
later work finds the suite without guessing.
A case whose passes were not repeatable does not graduate: a suite that starts amber reports nothing. Leave it in a capability eval while the criterion is open, and record it as a known failure once the criterion closes.
Cases, graders, the runner, and everything under regression/ are ready to
commit. The variant results folders are not, and graduation deletes them.
Hand back:
A regression suite is scored against the level its cases reached, over the same
repetitions, so a drop outside the noise floor means something broke. Change or
remove one of its cases only when a decision to change that behavior exists, or
when the feature it covers is gone; a failing score is never that reason, and
neither is passing. A cell whose most recent 10 trials all passed may be
demoted to the lower tier, never deleted: answer a request to delete one by
offering demotion instead and deleting nothing. Tell the user that demotion is
proposed from the cell history by the audit-evals skill, which moves only the
cells they approve, and that it installs with
npx skills@latest add toy-crane/skills --skill audit-evals when it is not
installed; this skill does not run it.
Every suite run, at a gate or for implement, runs the upper tier. It runs the
lower tier too only when this run's model differs from the model the lower tier
last ran on. A lower-tier cell that fails outside the noise floor is a
regression: report it as one and propose moving it back to the upper tier,
which happens once the user approves.
After each suite run, add every cell's trials and passes to the cell history
and append each new result to the end of its recent results, dropping the
oldest so it keeps the last 10; then set the suite's last_run_model, and its
lower_tier_model when the lower tier ran. The history grows only from runs that happen anyway; never run
the suite to fill it. A suite that predates the history starts it on its next
run, every cell in the upper tier with an unknown baseline. Keep the run's
answers and judge reasoning only until the next suite run replaces them,
uncommitted: they are for reading the failure just seen, and the counts already
live in the history.
The cell history is regression/cell-history.json: per cell, cumulative counts
and its most recent 10 results, oldest first (p pass, f fail), rather than
a row per run, so its size does not grow with the number of runs. A cell's
recent holds as many results as its trials, up to 10:
{"version": 2, "suites": {"<criterion folder>": {
"reps": 2, "last_run_model": "<model>", "lower_tier_model": "<model or null>",
"checks": {"<check>": {"grader": "code or judge", "judge_call": "<id shared by checks judged in one call>"}},
"cells": {"<case>": {"<check>": {"tier": "upper or lower", "baseline": "pass, fail, or null",
"trials": 14, "passes": 13, "recent": "pppppppppp"}}}}}}
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub toy-crane/skills --plugin toycrane-skillsOther plugins' skills for the same job
28 skills in this plugin
/add-env-keyGet a key the user must issue or supply, such as an API key, token, or password, into the project's .env file without the value passing through chat or the model's context. Opens the vendor's issuance page, collects the value through the secret-env mod's input pane when the session has it, and otherwise opens the file in the user's editor with the key line ready. Use when work needs such a key that the project does not have yet, or when the user asks to add, set, or put an API key or token into .env./add-stack-contextAudit and establish current agent context for the technologies that define a project's stack. Use when setting up a project for agent work, after selecting or adding a framework, library, developer tool, or hosted service, or when entering an existing project whose agent context has not been audited./