ai-prompt-regression-testing
Skill này làm gì
Công cụ này giúp so sánh cách AI trả lời câu hỏi trước và sau khi bạn thay đổi chỉ dẫn của nó. Nó đảm bảo các thay đổi không làm hỏng những câu trả lời cũ.
Khi nào nên dùng
- ✓Khi kiểm tra xem một thay đổi trong chỉ dẫn của AI có làm hỏng điều gì không.
- ✓Khi kiểm tra AI có còn tuân theo các quy tắc quan trọng (như không bịa đặt sự thật) hay không.
- ✓Khi ghi lại quyết định về chất lượng câu trả lời khi kết quả chưa rõ ràng.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/ai-prompt-regression-testing/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“So sánh câu trả lời của AI cho 5 câu hỏi này trước và sau khi thay đổi chỉ dẫn. Kiểm tra xem nó có còn tuân theo các quy tắc không.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Bạn cung cấp một bộ câu hỏi cố định và câu trả lời mong đợi. Sau đó, bạn so sánh câu trả lời của AI theo chỉ dẫn mới với câu trả lời cũ. Hệ thống ghi lại nếu có điều gì sai.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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"]
…
Câu hỏi thường gặp
“Regression” là gì?
Regression nghĩa là một thứ từng hoạt động tốt nhưng đã ngừng hoạt động sau một thay đổi.
Tôi có cần một bộ dữ liệu đặc biệt không?
Có, bạn cần một bộ câu hỏi và câu trả lời để làm chuẩn so sánh. Bộ này nên cố định và được xem xét kỹ.
Công cụ này có thay thế kiểm thử thông thường không?
Không, đây là một loại kiểm thử cụ thể: kiểm tra xem thay đổi chỉ dẫn có làm câu trả lời hiện có trở nên tệ hơn không.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #3718
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
writing-skills
311kDạy agent của bạn viết skill mới và kiểm thử từng skill trước, kiểm tra xem skill có thực sự thay đổi cách agent hành xử hay không.
writing-for-agents
310kGiải thích cách viết hướng dẫn rõ ràng cho agent AI, gồm skill, tệp AGENTS.md và CLAUDE.md, để agent cư xử nhất quán.
bengali-nlp
280kGiúp agent của bạn xử lý văn bản tiếng Bengali, hỗ trợ hiểu ngôn ngữ này, chuẩn hóa văn bản và xử lý các đặc điểm riêng của nó.