agent-regression-evals
What it does
This skill makes the agent test whether an AI agent got better or worse after a change, using statistics instead of a single run. It is for teams shipping changes to AI agents who need a clear verdict before release.
When to use it
- ✓When you are about to ship a change to a prompt, model or tool used by an agent.
- ✓When an agent's pass rate has dropped and you need to know whether it is real.
- ✓When some test cases seem to pass and fail at random and need to be found.
Skill link
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agent-regression-evals/skills/agent-regression-evals/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“We changed the model behind our support agent. Run the tests several times and tell me if the new version is really worse.”
5 new skills a week. 1 minute to read.
How it works
The agent runs each test case several times on the old and new versions and checks the steps the agent took through its tools. It finds flaky cases, then a statistical gate compares the two versions case by case and gives a verdict.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Agent Regression Evals — prove the change did not make it worse
Portability: 3 stdlib scripts, no APIs, no LLM calls. You run the agent; these grade, count and gate.
"Pass rate went from 82% to 79%" is not a finding until you know whether three points is outside the noise. Agents are non-deterministic, so one trial per case cannot tell a regression from a coin flip, and a final answer can be right while the path to it called a tool it never should have.
Workflow
# 0 - Run every case k times (k >= 3) on baseline and candidate, from a clean
# environment per trial. Write one JSONL row per trial:
# {"case_id": "refund-lookup", "trial": 1, "passed": true, "critical": true,
# "cost_usd": 0.012, "trajectory": [{"tool": "get_order", "args": {...}}]}
# 1 - Grade the path where the path matters (safety, required lookups).
python scripts/trajectory_checker.py --spec cases.json --results candidate.jsonl
# 2 - Separate flaky cases from stable ones before trusting any comparison.
python scripts/flake_detector.py --results candidate.jsonl --k 3 --quarantine-out q.json
# 3 - Gate: paired per-case comparison against baseline. Exit 4 blocks the merge.
python scripts/regression_gate.py --baseline baseline.jsonl --candidate candidate.jsonl --quarantine q.json
Step 1 uses match modes strict | unordered | subset | superset. Default to
superset (required steps present, harmless exploration allowed); grade the
outcome, not the path, unless order is the requirement. forbidden tools block
in every mode.
Step 2 reports pass@k (succeeds at least once in k) and pass^k (succeeds all k times). A user meets every trial, so pass^k is the reliability number. Cases marked critical are never quarantine candidates.
Step 3 averages trials within each case first (trials of one case are correlated), then tests paired per-case differences with a t-based 95% CI and a one-sided exact McNemar test. When the drop is real but the sample is too small to show it, the gate says how many cases it would take.
The gate blocks on
- A statistically significant drop (CI upper bound below zero, or McNemar p < 0.05).
- A critical case that passed every baseline trial and failed any candidate trial.
- A baseline case missing from the candidate run. Dropping a case is the cheapest fake fix.
- A quarantine entry with no owner or expiry, or covering a critical case.
- A forbidden tool call (trajectory checker, exit 4).
It warns, and a human decides, on an underpowered drop above --tolerance or a
cost rise above --max-cost-increase.
Hard rules
- Never compare single trials. Under 3 trials per case the flake detector refuses (exit 4).
- Never pool trials as independent samples. Average per case, then compare cases.
- Never quarantine without owner and expiry. An expired entry re-enters the gate automatically.
- Never delete a failing case to go green. The gate counts what is missing.
- Never call "no significant drop" a pass on 8 cases. Report the power note with the verdict.
- Start the suite from real failures (20-50 cases), balanced between "should do" and "should not do".
Scripts
| Script | Role | Exit codes |
|---|---|---|
scripts/trajectory_checker.py |
Grades tool-call paths: match modes, args modes, forbidden tools, call ceilings | 0 · 2 deviations · 3 bad input · 4 forbidden tool |
scripts/flake_detector.py |
STABLE_PASS / STABLE_FAIL / FLAKY per case, Wilson CI, pass@k, pass^k, quarantine stubs | 0 · 2 flaky · 3 · 4 too few trials |
scripts/regression_gate.py |
Paired CI, exact McNemar, critical cases, dropped cases, quarantine validity, cost | 0 PASS · 2 WARN · 3 · 4 BLOCK |
All support --sample and --output json.
References and assets
references/eval_statistics.md— pass@k vs pass^k, per-case averaging, paired CI, McNemar, power (7 sources)references/trajectory_grading.md— outcome vs path, match modes, grader types (6 sources)references/flaky_cases_and_quarantine.md— flake causes, quarantine with expiry, clean trials (6 sources)assets/eval_case_spec.example.json— trajectory spec for step 1assets/sample_baseline.jsonl,assets/sample_candidate.jsonl— results format- [
assets/ci_eval_gate.example.yml
FAQ
Why run each case several times?
Agents give different answers on different runs, so one trial cannot show a real regression.
Does it check how the agent got its answer?
Yes. It checks the tool-call path, such as whether a required lookup happened.
Can a failing check block a merge?
Yes. The gate returns a failure code that can block a merge.
Details
Original description by the author
Use before shipping any agent, prompt, model or tool change, or when a pass-rate drop needs a verdict. Runs repeated trials, gates candidate vs baseline with paired statistics in regression_gate.py, checks tool-call trajectories and finds flaky cases.
Popularity
- GitHub stars
- 29k
- Ranking position
- #9526
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
agent-launcher-orchestrator
29kHelps your agent plan, build, test and schedule a Claude managed agent in your own account, step by step, starting from one clear goal.
grade-iterate
29kLets your agent grade a managed AI agent's work against a rubric and improve it in a fixed number of rounds, so it never loops forever.
interview
29kLets your agent interview you about an AI agent idea and turn your answers into a simple build plan before anything is launched.
run-without-you
29kHelps your agent set up a managed AI agent to run on a schedule or when an event happens, with the cron timing checked before launch.
Similar skills
add-model-provider
394kLets your agent connect a new AI model provider to OpenClaw using safe setup commands, keep API keys out of plain text, and run a live test.
acp-router
394kHelps your agent send a task to a coding assistant such as Claude Code or Cursor through OpenClaw, so the work runs in that tool.
browser-automation
394kTeaches your agent to control web pages step by step, including logins, tabs, and recovery when a page stops responding.