>- Before iterating on a speedup or quality problem, build the feedback loop first and write it down as a Loop Card that names the outcome, the instrument the agent runs itself, the noise floor, the keep bar and the stop rule. Use on `/lever loop`, when asked to speed up, optimize, hill-climb or "make X better" user has pasted two or more screenshots or numbers, "still broken" has come up twice, the agent said "please try it" without running it, someone claims a win from one run, or the human is acting as the instrument. Not for one-shot fixes that existing tests already prove.
npx skills add https://github.com/github/lever --skill find-the-loop
The loop is the product and the agent is the motor. An agent with no trustworthy signal keeps changing code and asks the human whether it worked. That turns the human into the test runner, and progress stops. This skill runs before any iteration. It produces a Loop Card (templates/loop-card.md) that states what is measured, how the agent measures it without help, how noisy that measurement is, what counts as a win, and when to stop. Hand the finished card to whoever does the iterating, whether that is you, a child agent or experiment-arms.
Do not use it for one-shot mechanical edits (renames, copy changes, config bumps) where existing CI already proves correctness. Do not use it when a Loop Card already exists for this outcome; reuse that card and update the baseline instead. Do not force a loop onto build-mode work: a large new prototype often has no signal to climb yet. File issues, run them in parallel with autonomous-delivery, and come back here once there's something real to measure.
decision-tree.md for the proof, noise control and pitfalls of each row. If nothing fits or the ask is vague, run the loop interview (step 2a).No code changes until the card's Outcome, Metric and Keep bar rows are filled in.
package.json, Makefile, scripts/, .github/workflows/ and installed skills. Build a new instrument only when none fits.docs/autonomy.md; this skill does not decide who merges.10. Name the ledger. Record accepts *and* rejects in templates/ledger.md, and feed the rejects back to the proposer so they are not retried.
11. Publish the card and start iterating. Post the Loop Card in the conversation or PR. After merge, re-measure on real traffic. If the outcome matters for longer than this task, schedule the loop, for example a nightly baseline that files an issue on regression.
| If the problem is… | Loop | Instrument the agent runs itself | Noise control | Keep bar |
|---|---|---|---|---|
| A logic bug | Failing test first | Unit or integration repro test | Deterministic; rerun 3 times | Repro red → green, suite green |
| A UI or visual bug | Self-run app plus capture | E2E harness with DOM assertions; screenshot or video the agent opens and inspects | Fixed viewport, data, theme | Assertion passes; before/after media attached |
| TUI or CLI behavior | Scripted run in a PTY | PTY script, captured output and debug logs | Fixed terminal size and seed | Agent observed the expected output |
| UI performance or jank | A/A, then probe | FPS, render count, long-task trace on a replayed flow | A/A, at least 5 runs, same machine | p50 *and* p90 beat the floor |
| CI or build speed | Paired real-CI runs | Time-to-green p50/p90 on the critical path, plus billed minutes | Same SHA; nonce touches code and workflow; interleaved; n≥6 (12 for small effects) | Above the floor on p50, signal not weakened |
| Runtime or engine perf | Experiment arms | Benchmark subset, reference-correctness check, holdout | A/A spread; interleaved ABBA reps; bootstrap CI | CI excludes no change; guards hold |
| Prompt or agent behavior | Eval plus holdout | Pre-registered evals (gold plus canary), k≥3, held-out set | k repeats; calibrated grader | Pass-rate delta on holdout; generalization check |
| Classification, triage or review | Past decisions as labels | Dataset of past human decisions, held-out split | Held-out split | Precision/recall vs labels, holdout holds |
| A data or analytics claim | Independent ground truth | Raw-source query; injected known values | Two independent sources | Matches truth; injected values detected |
| A flaky test or infra | Repeat-N stats | Run the test N times; failure rate k/N | Large N; same runner class | 0/N at a preset N |
| Production behavior | Post-merge telemetry | Dashboard, error rate, latency SLO | Week over week; cohorts | Moves the right way over the window |
| "Make X better" (vague) | Loop interview | — | — | Loop Card agreed before any code |
| Dial | Default | Options |
|---|---|---|
| Smell sensitivity | Trigger on any one smell | Two smells; manual invocation only |
| Primary metric and guards | One felt metric plus one cost or quality guard | Several guards, with every "more X" paired with its cost |
| Noise budget | A/A first; n=5 timed, n=3 deterministic | n up to 12+; bootstrap CI level |
| Keep bar | Above the A/A spread at p50 and p90 | A fixed effect size; CI must exclude no-change |
| Generalization check | Holdout for evals; re-measure after merge for perf | None; full gate (redaction, swap and lookup tests) |
| Loop speed vs fidelity | Targeted inside the loop, full suite at the gate | Full every time |
| Leash | Short runs to tune n, then the brief's timebox | Minutes up to overnight |
| Concurrency and API budget | From .github/lever.yml budgets: | Arms in parallel; poll interval |
| Judge | The instrument | Instrument plus a second-model review; human audits the deltas |
| Autonomy level | Resolved by autonomy-dial | L0–L5, see docs/autonomy.md |
| Continuity | Re-measure once after merge | Nightly baseline that files an issue on regression |
ran <command> → <observed result>.decision-tree.md.Take github/find-the-loop from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.