本文へスキップ
Skillpedia
エージェント29k · #9526

agent-regression-evals

できること

このスキルにより、エージェントは一度の実行ではなく統計を使って、変更の後に性能が上がったか下がったかをテストします。AIエージェントに変更を加えてリリースする前に、明確な判定が必要なチームを対象としています。

使う場面

  • ✓エージェントのプロンプト、モデル、ツールに変更を加えてリリースしようとしているとき。
  • ✓エージェントの合格率が下がり、それが本当かどうかを知る必要があるとき。
  • ✓同じテストケースがランダムに成功と失敗を繰り返すので、その原因を見つける必要があるとき。

スキルのリンク

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agent-regression-evals/skills/agent-regression-evals/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agent-regression-evals/skills/agent-regression-evals/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“サポートエージェントが使うモデルを変更しました。テストを複数回実行して、新しいバージョンが本当に悪くなっているかを教えてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは各テストケースを、古いバージョンと新しいバージョンでそれぞれ複数回実行し、ツールを通じて行った手順を確認します。不安定なケースを見つけた後、統計的な判定基準がケースごとに二つのバージョンを比較し、判定を出します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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

  1. A statistically significant drop (CI upper bound below zero, or McNemar p < 0.05).
  2. A critical case that passed every baseline trial and failed any candidate trial.
  3. A baseline case missing from the candidate run. Dropping a case is the cheapest fake fix.
  4. A quarantine entry with no owner or expiry, or covering a critical case.
  5. 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

よくある質問

なぜ各ケースを複数回実行するのですか?

エージェントは実行のたびに異なる答えを返すことがあるため、一回の試行では本当の性能低下を示せないからです。

回答がどう得られたかも確認しますか?

はい。ツール呼び出しの経路を確認し、例えば必要な検索が行われたかを確認します。

失敗したチェックはマージを止められますか?

はい。判定基準は失敗のコードを返すので、マージを止めることができます。

詳細

作者による元の説明

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.

repo: alirezarezvani/claude-skills

人気

GitHubのスター
29k
ランキング
#9526
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル