A repeatable loop for taking any Claude Code skill from "kind of works" to accurate and autonomous, with a scoreboard instead of a vibe.
Most people "improve" a skill by running it, eyeballing the output, and tweaking. There is no scoreboard, so "better" is a feeling. This framework forces a number first, then improves against it.
We built it by running it on a real skill: find UK company directors' verified LinkedIn profiles. Every step below is mapped to what actually happened, and to the numbers it moved.
Not "find directors." A number you can move.
State this skill's job as a single quantifiable objective, one number we can measure on a fixed test set. Not a description of what it does; the metric we're trying to move.
The step everyone skips, and the most important. Define "correct" before you measure, strictly, as evidence.
Define the gold standard for a correct result: what hard evidence must exist for us to count it as a pass? Make it strict and falsifiable, a rule a skeptic couldn't argue with. Anything weaker than this is not a pass.
Don't assume your first tool is best. Score several against the gold standard, then pick the winner with data.
Go research and test 3-5 different methods or tools for this skill's core step. Run each against the same test set and return a number for each, measured against our gold standard, not just "did it return something". Recommend the winner and say why.
Now, and only now, with a metric (1), a definition of good (2), and a baseline (3), you iterate. Three levers, in order of how much autonomy they add.
The gold standard is worthless if any path can bypass it. A hook makes it mandatory: every result passes the gate, identically, no exceptions. Two flavours, and you should know which one you are using.
settings.json hook (PostToolUse or Stop) that auto-rejects output failing the standard and forces a retry. Enforced by the harness, not by the model remembering. The standard holds even when you are not watching.Turn our gold standard into an enforced gate nothing can bypass. First as a verification function every result must pass. Then show me how to wire it as a Claude Code hook (PostToolUse or Stop in settings.json) that auto-rejects any output failing the standard and forces a retry, so the standard is enforced by the harness rather than by the model choosing to.
The vanilla skill took the first result and gave up if it was wrong. A retry loop fixes that.
This skill takes the first result and stops. Add a retry loop: pull the top N candidates, run each through the gate, keep the first that passes, and only give up after all N fail. Also tighten the check itself to demand an exact match, not a partial one. Re-run the test set and show before and after.
Whatever is still failing is failing because the obvious approach already failed. Those need a different angle and one-at-a-time attention: one fresh agent per failure, then a second adversarial agent to disprove each win.
Take every item this skill failed on. Run a workflow: spawn one fresh agent per failed item, in parallel, each told to IGNORE the searches the first pass already tried and instead work new angles (related records, alternate sources, name and ID variants). Every candidate must still clear the exact same verification gate, no looser. Then, for each newly-passed item, spawn a second adversarial agent whose only job is to REFUTE it, defaulting to suspicion, keeping it only if it cannot be broken. Report what got recovered and what the skeptic rejected.
| Step | What it is | Our result |
|---|---|---|
| 1 · Aim | % of 123 directors confirmed | the metric |
| 2 · Gold standard | two independent records must agree | defines "good" |
| 3 · Methods | Exa / Serper / Firecrawl / waterfall, each scored | Exa won recall |
| 4a · Hooks | the verify gate, enforced on every result | nothing skips it |
| 4b · Loops | top-5 retry + stricter check | 57 → 66 |
| 4c · New-angle + verifier | fan-out per failure + adversarial skeptic | 66 → 72 |
The throughline: finding an answer is easy; proving it is the right one is the whole job. Steps 1-3 build the scoreboard. 4a makes the standard unskippable. 4b finds more. 4c finds more and attacks every win to keep only what is real.
Worked example: a Companies House director-finder across 100 UK accounting companies and 123 directors. 46% vanilla, 54% with loops, 59% with the new-angle pass and verifier. Run the loop on any skill you have shipped.
The library shows the methods. A 30-minute call shows whether they fit your pipeline.