ai-prompt-regression-testing
できること
AIへの指示を変更する前と後で、AIの回答がどう変わるかを比較するためのツールです。変更によって、以前は正しく答えられていた内容が壊れていないかを確認できます。
使う場面
- ✓AIへの指示を変更した結果、何かが壊れていないかを確認したいとき。
- ✓AIが重要なルール(事実でないことを作り上げないなど)を今も守っているかを確認したいとき。
- ✓結果がはっきりしないときに、回答の品質についての判断を記録したいとき。
スキルのリンク
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/ai-prompt-regression-testing/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“5つの質問に対するAIの回答を、指示を変更する前と後で比較してください。ルールを今も守っているかも確認してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
まず、固定された質問と期待される回答のセットを用意します。次に、新しい指示でのAIの回答を、古い回答と比較します。システムは、問題が起きたかどうかを記録します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
AI Prompt Regression Testing
When to Use
- Compare a prompt change with an observed baseline on a fixed evaluation set.
- Detect schema, factuality, refusal, tool-selection or task-completion regressions.
- Record a reviewable decision when results are noisy, missing or contradictory.
Workflow
- Define the task, representative cases and forbidden outcomes. Use synthetic or approved/redacted data; freeze case IDs and the dataset revision before runs.
- Record baseline/candidate prompt digests, exact available model/version, inference settings, tool versions and evaluation environment. Do not hardcode old model-family options or silently change models between comparisons.
- Predeclare checks and acceptance rules. Use deterministic schema/field checks for structured output, behavioral checks for tools and a clear human/rubric standard for open text. Similarity does not prove factual or code correctness.
- Run matched baseline/candidate cases under the same permissions and budget. Record latency/cost and repeated runs when variability matters. A timeout, missing output or judge error is incomplete, not a pass or a zero-cost result.
- Treat judge outputs as evidence with limitations. Blind/randomize presentation where feasible, calibrate against human-labeled examples, and record judge identity/rubric. Do not ask a model to verify private reasoning or accept a judge's confidence as an objective correctness measurement.
- Review differences case by case and report the denominators, failures and uncertainty. Keep mandatory safety/schema failures visible even if aggregate similarity improves. Use the predeclared rule, not a threshold selected after results.
- Store a redacted report and exact artifacts at an authorized destination. Decide retain/revise/reject for the stated dataset; deployment is separate.
Regression register
| Field | Type | Example / meaning |
|---|---|---|
| case_id | string | PTEST-001; a textual ID, not SERIAL |
| dataset_revision | immutable reference | exact case inventory, expected checks and labels |
| prompt_revision | string | baseline/candidate digest |
| model_runtime | string | exact available ID/version plus settings |
| check | string | required JSON fields or approved rubric criterion |
| result | enum | pass / fail / incomplete |
| evidence | reference | redacted actual output, tool trace or observed check |
| judge_configuration | optional object | exact judge ID/rubric/version and calibration limits |
| latency_ms | nonnegative number or null | null if not observed; never invented |
| cost | amount/currency or null | actual billing basis; unknown remains unknown |
| run_revision | immutable reference | binds the report to the actual run |
IDs and statuses must have consistent SQL/JSON/CSV representations. Do not store private prompts, user messages or tokens in a public spreadsheet or Notion register.
Worked example
Two cases test a support-answer prompt. PTEST-001 requires an answer grounded in the supplied policy; PTEST-002 requires a structured escalation when the policy is absent. The candidate sounds more helpful but PTEST-002 has no observed result. The report is incomplete, not a win. The following Python 3 helper aggregates already reviewed case statuses; it does not call models or decide correctness.
def summarize_regression(results, expected_case_ids):
if not isinstance(expected_case_ids, list) or not expected_case_ids:
return {"status": "incomplete", "reason": "missing case inventory"}
if any(not isinstance(case, str) or not case for case in expected_case_ids):
return {"status": "incomplete", "reason": "invalid case IDs"}
if len(set(expected_case_ids)) != len(expected_case_ids):
return {"status": "incomplete", "reason": "duplicate expected case IDs"}
if not isinstance(results, list) or any(not isinstance(row, dict) for row in results):
return {"status": "incomplete", "reason": "invalid results"}
by_id = {}
for row in results:
case = row.get("case_id")
if not isinstance(case, str) or case not in expected_case_ids or case in by_id:
return {"status": "incomplete", "reason": "unexpected or duplicate result"}
if row.get("result") not in ("pass", "fail", "incomplete"):
return {"status": "incomplete", "reason": "unknown result"}
by_id[case] = row["result"]
…
よくある質問
「リグレッション(回帰)」とは何ですか?
以前は正しく動いていたものが、変更の後に動かなくなることを指します。
特別なデータセットが必要ですか?
はい、比較の基準となる質問と回答のセットが必要です。内容は固定され、確認済みのものである必要があります。
通常のテストの代わりになりますか?
いいえ、これは特定の種類のテスト用です。指示の変更によって、既存の回答の品質が下がっていないかを確認するためのものです。
詳細
作者による元の説明
Use when comparing prompt changes against a fixed evaluation set: record actual model settings, required checks, missing results, judge limitations and case-level regression evidence.
人気
- GitHubのスター
- 48k
- ランキング
- #3718
- ライセンス
- MIT
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
00-andruia-consultant
48kエージェントがAIプロジェクトの立ち上げや改善を支援します。コードを分析し、ツールを提案し、スペイン語で行動計画を作成します。
007
48kエージェントがセキュリティ監査と脅威モデリングを行えるようにします。攻撃や脆弱性からプロジェクトを守るのに役立ちます。
10-andruia-skill-smith
48kエージェントがAIツールの作成や改善を支援します。ツールの動作を定義し、ドキュメントを書き、構造を検証します。
20-andruia-niche-intelligence
48kエージェントが特定の業界に関する要約を作成できるようにします。信頼できる情報源を使って、プロジェクトの背景、ルール、利用パターン、リスクを把握するのに役立ちます。
似ているスキル
writing-skills
311k新しいスキルを書き、それぞれをまず試すようエージェントに教えます。そのスキルが実際にエージェントの動作を変えることを確認します。
writing-for-agents
310kスキル、AGENTS.md、CLAUDE.mdを含め、AIエージェントのための明確な指示の書き方を説明し、エージェントが予測可能に動くようにします。
bengali-nlp
280kエージェントがベンガル語のテキストを処理できるようにします。テキストの正規化など、ベンガル語特有の性質に対応しながら、言語を理解して扱えるようにします。