Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ uploads them yet.

## Evals

Every skill has [eval cases][40] in `evals/<skill>/`. The ones for
[`/ask-claude`][39] sit directly in `evals/`. Run one skill's cases from the
repo root:
Every skill has [eval cases][40] in `evals/<skill>/`. Run one skill's cases
from the repo root:

```
claude plugin eval . --case 'slice-*' --scaffold --max-cost-usd 10 --allow-tools Write Bash
```

- Case names start with the skill's name, which is what `--case` matches.
The `/ask-claude` cases are the exception.
- `--scaffold` runs each case's `scaffold.sh`, which builds the sample app it
runs against.
- Most skills need `--allow-tools Write Bash`. `/ship` also needs `Edit
Expand All @@ -124,6 +124,12 @@ Workflow`. `/ask-claude` needs `"WebFetch(domain:code.claude.com)"
shouldn't trigger a skill to about $2.40 for a `/ship` run.
- The CLI needs its own login, even inside the desktop app: `claude auth login`.
- Results go to `evals/results/`, which is gitignored.
`bin/eval-summary evals/results/<label>.json` shrinks one to
`evals/baselines/<label>.json`, which is committed.
- `bin/eval-compare <baseline> <new>` lists the cases whose score dropped,
and exits 1 if any dropped by more than 0.34.
- Cases that scored 1.0 on the Opus 5.5 baseline are tagged `regression`.
`--tag regression` runs only those.
- Cases with a `scaffold.sh` need `--scaffold`. The `/pr` cases also need
`--allow-tools Bash Write Edit Agent`.

Expand Down
50 changes: 50 additions & 0 deletions bin/eval-compare
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash

# Print every eval case whose score dropped between two baselines.
#
# Usage:
# bin/eval-compare evals/baselines/opus-5-5-high.json evals/baselines/new.json
#
# Exits 1 if any case dropped by more than 0.34, about one run of three.

set -euo pipefail

if [ $# -ne 2 ]; then
echo "Usage: bin/eval-compare <baseline.json> <new.json>" >&2
exit 1
fi

if ! command -v jq &> /dev/null; then
echo "Error: jq is required but not installed. Install it with: brew install jq" >&2
exit 1
fi

max_drop=0.34

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tradeoff: We fail only on a drop over 0.34, so losing exactly 1
run of 3 (a 0.33 drop) prints but passes. A skill that really got
worse in 1 run of 3 slips through, so we might want to rerun any case
that prints before trusting it.

Each test gets 3 tries. If it goes from passing all 3 to passing 2,
the check still says OK. It's a smoke alarm set to go off only when
there's a lot of smoke: fewer false alarms, but a small fire can
smolder.

Claude Opus 5.5 (claude-opus-5-5)


rows=$(jq -r --slurpfile new "$2" '

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: We'll compare any 2 baselines, but a plugin-only run counts
the "did the skill run?" checks and a with-and-without run skips them.
That's how the Opus-vs-Sonnet comparison here mixes the two, so we
might want to refuse when one file has a Δ and the other doesn't.

The Sonnet scores were graded on a slightly different checklist from
the Opus ones. Graded the Opus way, most of Sonnet's low scores get
lower still, and 2 tests turn out fine. It's comparing 2 students'
grades when 1 teacher counted attendance and the other didn't.

Claude Opus 5.5 (claude-opus-5-5)

($new[0].cases | map({(.name): .score}) | add // {}) as $scores
| .cases[]
| select($scores[.name] == null or $scores[.name] < .score)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: A case missing from the new run prints as missing but
doesn't fail, so a --tag regression run lists 13 expected missing
lines every time. A case that dropped out by mistake looks the same,
so we might want to compare only the cases both runs share.

When we rerun just the 47 tests Opus passed every time, the report also
reads out the other 13 as missing. A test that vanished by accident
shows up the same way, buried among them. It's a roll call where the
kids who were never on today's list get read out with the one who
skipped.

Claude Opus 5.5 (claude-opus-5-5)

| [.name, .score, ($scores[.name] // "missing"),
(if $scores[.name] == null then "" else ($scores[.name] - .score) end)]
| @tsv
' "$1")

if [ -z "$rows" ]; then
echo "No case dropped."
exit 0
fi

{
printf "CASE\tBASE\tNEW\tCHANGE\n"
echo "$rows" | awk -F'\t' -v OFS='\t' '{
if ($4 == "") print $1, sprintf("%.2f", $2), $3, ""
else print $1, sprintf("%.2f", $2), sprintf("%.2f", $3), sprintf("%+.2f", $4)
}'
} | column -t -s $'\t'

if echo "$rows" | awk -F'\t' -v max="$max_drop" '$4 != "" && -$4 > max { found = 1 } END { exit !found }'; then
echo
echo "At least one case dropped by more than $max_drop."
exit 1
fi
52 changes: 52 additions & 0 deletions bin/eval-summary
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash

# Shrink a `claude plugin eval --json` result to a committable baseline.
#
# Usage:
# bin/eval-summary evals/results/opus-5-5-high.json
#
# Writes evals/baselines/opus-5-5-high.json, named after the input file.

set -euo pipefail

if [ $# -ne 1 ]; then
echo "Usage: bin/eval-summary <results.json>" >&2
exit 1
fi

if ! command -v jq &> /dev/null; then
echo "Error: jq is required but not installed. Install it with: brew install jq" >&2
exit 1
fi

results="$1"
label=$(basename "$results" .json)
out="evals/baselines/$label.json"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: We name the baseline after the results file and overwrite
an existing one without asking, so rerunning Opus as opus-5-5-high
replaces the baseline we compare against. We might want to refuse
when the file already exists.

If we save a new run under an old run's name, the old scores are gone.
The check then compares the new run with itself, so it always passes.
It's writing this week's grades over last week's in the gradebook,
then asking whether anyone got worse.

Claude Opus 5.5 (claude-opus-5-5)


if [ "$(jq -r '.partial' "$results")" = "true" ]; then
echo "Error: $results is partial ($(jq -r '.partialReason' "$results")). Not summarizing it." >&2
exit 1
fi

mkdir -p evals/baselines

jq --arg label "$label" '
def round(places): (. * pow(10; places) | round) / pow(10; places);
{
label: $label,
claudeVersion,
startedAt,
costUsd: (.costUsd | round(2)),
cases: [
.cases[] | {
name,
skill: (.dir | split("/")[1]),
score: (.aggregates.score | round(4)),
delta: (.aggregates.delta | if . == null then null else round(4) end),
costUsd: ([.arms[][] | .costUsd] | add | round(2))
}
]
}
' "$results" > "$out"

echo "Wrote $out"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description: A "make it happen every time" ask should get a hook, not a CLAUDE.m
max_turns: 30
timeout_seconds: 600
allowed_tools: [Read, Glob, Grep, Skill, WebFetch]
tags: [regression]
---

I want rubocop to run on every Ruby file you edit in my Rails app. What's the best way to set that up?
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
description: A plain Rails question shouldn't trigger the skill.
max_turns: 10
allowed_tools: [Read, Glob, Grep, Skill]
tags: [regression]
---

What's the difference between has_many :through and has_and_belongs_to_many?
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description: A vague bug report should get questions or a prompt that reproduces
max_turns: 30
timeout_seconds: 600
allowed_tools: [Read, Glob, Grep, Skill, WebFetch]
tags: [regression]
---

Users can't sign up on our Rails app. How should I ask you to fix it?
Loading
Loading