ai-regression-testing
Skill1 starsChanged 9 months agoMITView on GitHub
Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code.
- Reads credentials
29 other projects use a version of this, 24 of them edited.
Adopted by
Most recently taken up by
- KevinLoichot/everything-claude-codeedited, first seen Nov 29, 2026
- aayushsoam/clawbot-plusedited, first seen Nov 29, 2026
- multiplex-ai/muggle-ai-teamsedited, first seen Nov 29, 2026
- genfeedai/genfeed.aitheir own version, first seen Nov 29, 2026
- satvikgbusiness-jpg/Claude-skillsedited, first seen Nov 29, 2026
- leileigwl/claude-skillsedited, first seen Nov 29, 2026
Used with
Projects with it also use agent-payment-x402, openclaw-persona-forge and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
TironFoxSkillagent-payment-x402
Add x402 payment execution to AI agents — per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents need to pay for APIs, services, or other agents.
Also in 8 projects that use this
TironFoxSkillopenclaw-persona-forge
为 OpenClaw AI Agent 锻造完整的龙虾灵魂方案。根据用户偏好或随机抽卡, 输出身份定位、灵魂描述(SOUL.md)、角色化底线规则、名字和头像生图提示词。 如当前环境提供已审核的生图 skill,可自动生成统一风格头像图片。 当用户需要创建、设计或定制 OpenClaw 龙虾灵魂时使用。 不适用于:微调已有 SOUL.md、非 OpenClaw 平台的角色设计、纯工具型无性格 Agent。 触发词:龙虾灵魂、虾魂、OpenClaw 灵魂、养虾灵魂、龙虾角色、龙虾定位、 龙虾剧本杀角色、龙虾游戏角色、龙虾 NPC、龙虾性格、龙虾背景故事、 lobster soul、lobster character、抽卡、随机龙虾、龙虾 SOUL、gacha。
Also in 7 projects that use this
loulanyueSkillnuxt4-patterns
Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.
Also in 13 projects that use this
RojiosSkilldart-flutter-patterns
Production-ready Dart and Flutter patterns covering null safety, immutable state, async composition, widget architecture, popular state management frameworks (BLoC, Riverpod, Provider), GoRouter navigation, Dio networking, Freezed code generation, and clean architecture.
Also in 9 projects that use this
renepfSkillmotion-advanced
Advanced motion patterns for React / Next.js — drag & drop, gestures, text animations, SVG path drawing, custom hooks, imperative sequences (useAnimate), loaders, and the full API decision tree. Requires motion-foundations.
Also in 5 projects that use this
Yog-SothoSkillpytorch-patterns
PyTorch deep learning patterns and best practices for building robust, efficient, and reproducible training pipelines, model architectures, and data loading. Always activate when the user is writing PyTorch models or training scripts, reviewing deep learning code, debugging training loops or data pipelines, optimizing GPU memory or training speed, setting up reproducible experiments, implementing transfer learning or fine-tuning, or asks anything about nn.Module, DataLoader, autograd, AMP, or torch.compile.
Also in 16 projects that use this
- +1 more from TironFox
Other versions29 projects use a version of this.
Word for word · 0
None found.
Edited · 24
- loulanyue/awesome-claude-notes★ 27262% same
- Fmarzochi/EGC★ 6160% same
- gongyijie85/dsh-ecc★ 859% same
- Ronnasayd/aipp★ 559% same
- Yog-Sotho/claude-skills★ 424% same
- aayushsoam/clawbot-plus★ 262% same
- multiplex-ai/muggle-ai-teams★ 262% same
- ronmkr/PromptBook★ 260% same
- aiconnai/MultiplAI★ 162% same
- get-proofpilot/claude-skills-catalog★ 162% same
14 more not listed
Wrote their own version · 5
- genfeedai/genfeed.ai★ 10same name
- yeaight7/agent-powerups★ 6same name
- HarambeeAI/bayes-ship★ 1same name
- Lukk17/agent-standards★ 1same name
- agenticluke/ai-regression-guard-plus★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository189 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- examples/CLAUDE.mdCLAUDE.md
- .cursor/rules/common-agents.mdCursor rule
- .cursor/rules/common-coding-style.mdCursor rule
- .cursor/rules/common-development-workflow.mdCursor rule
- .cursor/rules/common-git-workflow.mdCursor rule
- .cursor/rules/common-hooks.mdCursor rule
- .cursor/rules/common-patterns.mdCursor rule
- .cursor/rules/common-performance.mdCursor rule
- .cursor/rules/common-security.mdCursor rule
- .cursor/rules/common-testing.mdCursor rule
- .cursor/rules/golang-coding-style.mdCursor rule
- .cursor/rules/golang-hooks.mdCursor rule
- .cursor/rules/golang-patterns.mdCursor rule
- .cursor/rules/golang-security.mdCursor rule
- .cursor/rules/golang-testing.mdCursor rule
- .cursor/rules/kotlin-coding-style.mdCursor rule
- .cursor/rules/kotlin-hooks.mdCursor rule
- .cursor/rules/kotlin-patterns.mdCursor rule
- .cursor/rules/kotlin-security.mdCursor rule
- .cursor/rules/kotlin-testing.mdCursor rule
- .cursor/rules/php-coding-style.mdCursor rule
- .cursor/rules/php-hooks.mdCursor rule
- .cursor/rules/php-patterns.mdCursor rule
- .cursor/rules/php-security.mdCursor rule
- .cursor/rules/php-testing.mdCursor rule
- .cursor/rules/python-coding-style.mdCursor rule
- .cursor/rules/python-hooks.mdCursor rule
- .cursor/rules/python-patterns.mdCursor rule
- .cursor/rules/python-security.mdCursor rule
- .cursor/rules/python-testing.mdCursor rule
- .cursor/rules/swift-coding-style.mdCursor rule
- .cursor/rules/swift-hooks.mdCursor rule
- .cursor/rules/swift-patterns.mdCursor rule
- .cursor/rules/swift-security.mdCursor rule
- .cursor/rules/swift-testing.mdCursor rule
- .cursor/rules/typescript-coding-style.mdCursor rule
- .cursor/rules/typescript-hooks.mdCursor rule
- .cursor/rules/typescript-patterns.mdCursor rule
- .cursor/rules/typescript-security.mdCursor rule
- .cursor/rules/typescript-testing.mdCursor rule
- api-designSkill
- article-writingSkill
- backend-patternsSkill
- bun-runtimeSkill
- claude-apiSkill
- coding-standardsSkill
- content-engineSkill
- crosspostSkill
- deep-researchSkill
- dmux-workflowsSkill
- documentation-lookupSkill
- e2e-testingSkill
- eval-harnessSkill
- exa-searchSkill
- fal-ai-mediaSkill
- frontend-patternsSkill
- frontend-slidesSkill
- The first 60 shown.
The file
Files
AI 회귀 테스팅
AI 지원 개발을 위해 특별히 설계된 테스팅 패턴으로, 동일한 모델이 코드를 작성하고 리뷰할 때 자동화된 테스트만이 잡을 수 있는 체계적인 사각지대를 만듭니다.
활성화 시기
- AI 에이전트(Claude Code, Cursor, Codex)가 API 라우트 또는 백엔드 로직을 수정한 경우
- 버그가 발견되어 수정됨 — 재발 방지가 필요한 경우
- 프로젝트에 DB 없는 테스팅에 활용할 수 있는 샌드박스/목 모드가 있는 경우
- 코드 변경 후
/bug-check또는 유사한 리뷰 커맨드를 실행할 때 - 여러 코드 경로가 존재하는 경우 (샌드박스 vs 프로덕션, 기능 플래그 등)
핵심 문제
AI가 코드를 작성하고 자신의 작업을 리뷰할 때, 두 단계 모두에 동일한 가정을 가져갑니다. 이것은 예측 가능한 실패 패턴을 만듭니다:
AI writes fix → AI reviews fix → AI says "looks correct" → Bug still exists실제 사례 (프로덕션에서 관찰됨):
Fix 1: Added notification_settings to API response
→ Forgot to add it to the SELECT query
→ AI reviewed and missed it (same blind spot)
Fix 2: Added it to SELECT query
→ TypeScript build error (column not in generated types)
→ AI reviewed Fix 1 but didn't catch the SELECT issue
Fix 3: Changed to SELECT *
→ Fixed production path, forgot sandbox path
→ AI reviewed and missed it AGAIN (4th occurrence)
Fix 4: Test caught it instantly on first run ✅이 패턴에서 샌드박스/프로덕션 경로 불일치가 AI가 도입하는 회귀의 1위입니다.
샌드박스 모드 API 테스팅
대부분의 AI 친화적 아키텍처를 가진 프로젝트에는 샌드박스/목 모드가 있습니다. 이것이 빠른 DB 없는 API 테스팅의 핵심입니다.
설정 (Vitest + Next.js App Router)
// vitest.config.ts
import { defineConfig } from "vitest/config";
import path from "path";
export default defineConfig({
test: {
environment: "node",
globals: true,
include: ["__tests__/**/*.test.ts"],
setupFiles: ["__tests__/setup.ts"],
},
resolve: {
alias: {
"@": path.resolve(__dirname, "."),
},
},
});// __tests__/setup.ts
// Force sandbox mode — no database needed
process.env.SANDBOX_MODE = "true";
process.env.NEXT_PUBLIC_SUPABASE_URL = "";
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY = "";Next.js API 라우트용 테스트 헬퍼
// __tests__/helpers.ts
import { NextRequest } from "next/server";
export function createTestRequest(
url: string,
options?: {
method?: string;
body?: Record<string, unknown>;
headers?: Record<string, string>;
sandboxUserId?: string;
},
): NextRequest {
const { method = "GET", body, headers = {}, sandboxUserId } = options || {};
const fullUrl = url.startsWith("http") ? url : `http://localhost:3000${url}`;
const reqHeaders: Record<string, string> = { ...headers };
if (sandboxUserId) {
reqHeaders["x-sandbox-user-id"] = sandboxUserId;
}
const init: { method: string; headers: Record<string, string>; body?: string } = {
method,
headers: reqHeaders,
};
if (body) {
init.body = JSON.stringify(body);
reqHeaders["content-type"] = "application/json";
}
return new NextRequest(fullUrl, init);
}
export async function parseResponse(response: Response) {
const json = await response.json();
return { status: response.status, json };
}회귀 테스트 작성
핵심 원칙: 작동하는 코드가 아닌, 발견된 버그에 대한 테스트를 작성하세요.
// __tests__/api/user/profile.test.ts
import { describe, it, expect } from "vitest";
import { createTestRequest, parseResponse } from "../../helpers";
import { GET, PATCH } from "@/app/api/user/profile/route";
// Define the contract — what fields MUST be in the response
const REQUIRED_FIELDS = [
"id",
"email",
"full_name",
"phone",
"role",
"created_at",
"avatar_url",
"notification_settings", // ← Added after bug found it missing
];
describe("GET /api/user/profile", () => {
it("returns all required fields", async () => {
const req = createTestRequest("/api/user/profile");
const res = await GET(req);
const { status, json } = await parseResponse(res);
expect(status).toBe(200);
for (const field of REQUIRED_FIELDS) {
expect(json.data).toHaveProperty(field);
}
});
// Regression test — this exact bug was introduced by AI 4 times
it("notification_settings is not undefined (BUG-R1 regression)", async () => {
const req = createTestRequest("/api/user/profile");
const res = await GET(req);
const { json } = await parseResponse(res);
expect("notification_settings" in json.data).toBe(true);
const ns = json.data.notification_settings;
expect(ns === null || typeof ns === "object").toBe(true);
});
});샌드박스/프로덕션 동등성 테스팅
가장 흔한 AI 회귀: 프로덕션 경로는 수정하지만 샌드박스 경로를 잊는 것 (또는 그 반대).
// Test that sandbox responses match the expected contract
describe("GET /api/user/messages (conversation list)", () => {
it("includes partner_name in sandbox mode", async () => {
const req = createTestRequest("/api/user/messages", {
sandboxUserId: "user-001",
});
const res = await GET(req);
const { json } = await parseResponse(res);
// This caught a bug where partner_name was added
// to production path but not sandbox path
if (json.data.length > 0) {
for (const conv of json.data) {
expect("partner_name" in conv).toBe(true);
}
}
});
});버그 체크 워크플로에 테스트 통합
커스텀 커맨드 정의
<!-- .claude/commands/bug-check.md -->
# Bug Check
## Step 1: Automated Tests (mandatory, cannot skip)
Run these commands FIRST before any code review:
npm run test # Vitest test suite
npm run build # TypeScript type check + build
- If tests fail → report as highest priority bug
- If build fails → report type errors as highest priority
- Only proceed to Step 2 if both pass
## Step 2: Code Review (AI review)
1. Sandbox / production path consistency
2. API response shape matches frontend expectations
3. SELECT clause completeness
4. Error handling with rollback
5. Optimistic update race conditions
## Step 3: For each bug fixed, propose a regression test워크플로
User: "バグチェックして" (or "/bug-check")
│
├─ Step 1: npm run test
│ ├─ FAIL → Bug found mechanically (no AI judgment needed)
│ └─ PASS → Continue
│
├─ Step 2: npm run build
│ ├─ FAIL → Type error found mechanically
│ └─ PASS → Continue
│
├─ Step 3: AI code review (with known blind spots in mind)
│ └─ Findings reported
│
└─ Step 4: For each fix, write a regression test
└─ Next bug-check catches if fix breaks일반적인 AI 회귀 패턴
패턴 1: 샌드박스/프로덕션 경로 불일치
빈도: 가장 흔함 (4건의 회귀 중 3건에서 관찰됨)
// ❌ AI adds field to production path only
if (isSandboxMode()) {
return { data: { id, email, name } }; // Missing new field
}
// Production path
return { data: { id, email, name, notification_settings } };
// ✅ Both paths must return the same shape
if (isSandboxMode()) {
return { data: { id, email, name, notification_settings: null } };
}
return { data: { id, email, name, notification_settings } };이를 잡는 테스트:
it("sandbox and production return same fields", async () => {
// In test env, sandbox mode is forced ON
const res = await GET(createTestRequest("/api/user/profile"));
const { json } = await parseResponse(res);
for (const field of REQUIRED_FIELDS) {
expect(json.data).toHaveProperty(field);
}
});패턴 2: SELECT 절 누락
빈도: Supabase/Prisma에서 새 컬럼 추가 시 흔함
// ❌ New column added to response but not to SELECT
const { data } = await supabase
.from("users")
.select("id, email, name") // notification_settings not here
.single();
return { data: { ...data, notification_settings: data.notification_settings } };
// → notification_settings is always undefined
// ✅ Use SELECT * or explicitly include new columns
const { data } = await supabase
.from("users")
.select("*")
.single();패턴 3: 에러 상태 누출
빈도: 중간 — 기존 컴포넌트에 에러 처리를 추가할 때
// ❌ Error state set but old data not cleared
catch (err) {
setError("Failed to load");
// reservations still shows data from previous tab!
}
// ✅ Clear related state on error
catch (err) {
setReservations([]); // Clear stale data
setError("Failed to load");
}패턴 4: 적절한 롤백 없는 낙관적 업데이트
// ❌ No rollback on failure
const handleRemove = async (id: string) => {
setItems(prev => prev.filter(i => i.id !== id));
await fetch(`/api/items/${id}`, { method: "DELETE" });
// If API fails, item is gone from UI but still in DB
};
// ✅ Capture previous state and rollback on failure
const handleRemove = async (id: string) => {
const prevItems = [...items];
setItems(prev => prev.filter(i => i.id !== id));
try {
const res = await fetch(`/api/items/${id}`, { method: "DELETE" });
if (!res.ok) throw new Error("API error");
} catch {
setItems(prevItems); // Rollback
alert("削除に失敗しました");
}
};전략: 버그가 발견된 곳에서 테스트
100% 커버리지를 목표로 하지 마세요. 대신:
Bug found in /api/user/profile → Write test for profile API
Bug found in /api/user/messages → Write test for messages API
Bug found in /api/user/favorites → Write test for favorites API
No bug in /api/user/notifications → Don't write test (yet)AI 개발에서 이것이 효과적인 이유:
- AI는 같은 카테고리의 실수를 반복적으로 하는 경향이 있습니다
- 버그는 복잡한 영역에 집중됩니다 (인증, 다중 경로 로직, 상태 관리)
- 한번 테스트되면, 해당 정확한 회귀는 다시 발생할 수 없습니다
- 테스트 수가 버그 수정과 함께 유기적으로 증가합니다 — 낭비되는 노력 없음
빠른 참조
| AI 회귀 패턴 | 테스트 전략 | 우선순위 |
| 샌드박스/프로덕션 불일치 | 샌드박스 모드에서 동일한 응답 형태 검증 | 🔴 높음 |
| SELECT 절 누락 | 응답의 모든 필수 필드 검증 | 🔴 높음 |
| 에러 상태 누출 | 에러 시 상태 정리 검증 | 🟡 중간 |
| 롤백 누락 | API 실패 시 상태 복원 검증 | 🟡 중간 |
| null을 가리는 타입 캐스트 | 필드가 undefined가 아닌지 검증 | 🟡 중간 |
해야 할 것 / 하지 말아야 할 것
해야 할 것:
- 버그를 발견한 직후 (가능하면 수정 전에) 테스트를 작성하세요
- 구현이 아닌 API 응답 형태를 테스트하세요
- 모든 버그 체크의 첫 번째 단계로 테스트를 실행하세요
- 테스트를 빠르게 유지하세요 (샌드박스 모드로 총 1초 이내)
- 방지하는 버그의 이름을 따서 테스트 이름을 지정하세요 (예: "BUG-R1 regression")
하지 말아야 할 것:
- 버그가 발생한 적 없는 코드에 대한 테스트를 작성하지 마세요
- AI 자체 리뷰를 자동화된 테스트의 대체물로 신뢰하지 마세요
- "단지 목 데이터일 뿐"이라고 샌드박스 경로 테스팅을 건너뛰지 마세요
- 단위 테스트로 충분할 때 통합 테스트를 작성하지 마세요
- 커버리지 퍼센트가 아닌 회귀 방지를 목표로 하세요
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

