ai-regression-testing
Design regression tests for AI-assisted development by targeting model blind spots such as sandbox versus production path drift, response-shape mismatches, untested bug fixes, and same-model review failures. Use after AI-generated code changes, bug fixes, API edits, or feature-flag/sandbox changes.
What this skill does
# AI Regression Testing Add tests that catch the failures AI agents commonly miss when the same model writes code and reviews its own assumptions. ## Contract Inputs: - Bug report, code diff, API change, route, component, feature flag, or sandbox path - Existing test commands and project conventions - Optional known production incident or regression id Outputs: - Regression test plan - New or updated tests when implementation is requested - Parity checklist for sandbox, mock, feature-flag, and production paths - Verification commands and results Creates/Modifies: - Test files, fixtures, mocks, and minimal helpers when asked to implement - Application code only when the user also asks to fix the failing behavior External Side Effects: - None by default - Do not hit production services; use sandbox, fixtures, local test databases, or mocked providers Confirmation Required: - Before changing production data, external accounts, CI settings, or destructive test fixtures Delegates To: - `testing-expert` for general testing strategy - `react-testing-library` for React component tests - `playwright-e2e-init` or `e2e-testing` for browser workflows - `debug` when the root cause is still unknown ## When to Use - AI modified API routes, backend logic, serializers, or response schemas. - A bug was fixed and must not reappear. - A feature has sandbox/mock and production paths. - A model-generated review says the change is correct but no test proves it. - Build and lint pass, but the user-facing contract may still be wrong. - A feature flag, mock mode, fallback path, or error path was changed. ## Core Principle Test the contract that failed, not the implementation the agent just wrote. Assume the reviewing model shares the same blind spot as the writing model. Common AI blind spots: - production path fixed but sandbox/mock path still wrong - response includes a field in one path but not another - `SELECT`, serializer, DTO, fixture, and frontend type drift apart - optimistic UI path works but rollback/error path is untested - feature flag changes one branch but not the fallback branch - tests assert status codes but not response shape or state transition ## Workflow ### 1. Identify the Contract State the behavior as a user or caller contract: - endpoint returns these fields - component shows this state after this interaction - webhook processes duplicate events idempotently - sandbox and production return the same shape - failed operation rolls back visible and persisted state Create a required-field or required-state list when useful. ### 2. Find All Paths Trace every path that should satisfy the contract: - production data path - sandbox/mock/demo path - feature-flag on/off path - authenticated/unauthenticated path - success, validation error, provider error, and retry path - server response, client type, and UI rendering path ### 3. Write the Regression First The first test should fail on the unfixed bug or on a representative broken fixture. If the bug is already fixed, make the test specific enough that the previous bug would have failed. Prefer deterministic checks: - unit or route handler tests for response shape - integration tests for database, serializer, and service contracts - component tests for state transitions - E2E tests only for critical user journeys or cross-system behavior ### 4. Test Parity For API and data contracts, compare path shapes: ```text production fields == sandbox fields == mock fixture fields frontend type accepts exactly the returned shape empty/error states still include documented envelope fields ``` Use fixtures with realistic nulls, missing optional values, and date formats. ### 5. Verify Run the narrow test first, then the relevant suite: ```bash bun test path/to/regression.test.ts bun test bun run typecheck ``` Use the repo's actual package manager and test commands. Do not invent new tooling when the project already has a pattern. ## Test Design Checklist - Does the test fail for the old bug? - Does it cover every branch that returns or mutates the contract? - Does it assert the actual response/body/state, not only `200 OK`? - Does it include sandbox/mock parity when those modes exist? - Does it cover null, empty, duplicate, retry, and provider-failure cases when relevant? - Is the test small enough to run in a bug-check loop? - Is the regression named after the bug or contract it protects? ## Output Format ```markdown Regression target: `GET /api/profile` must include `notification_settings` in production and sandbox responses. Tests added: - `tests/api/profile.test.ts`: response-shape contract - `tests/api/profile.test.ts`: sandbox/production field parity Verification: - `bun test tests/api/profile.test.ts` passed - `bun run typecheck` passed Residual risk: - No E2E coverage for the settings page rendering this field. ``` ## Anti-Patterns - Letting an AI review replace a mechanical test. - Testing only the path the fix touched. - Asserting vague success instead of the exact contract. - Using production systems for regression tests. - Adding broad flaky E2E coverage when a route or unit test catches the bug. - Forgetting fixtures and generated types after changing response shape.
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.