# AI regression testing

> AI regression testing is an open-source agent skill for developer tools. Adds regression tests and a test-first bug-check workflow for AI-written code. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/smartworldarafath/REA_Skill/tree/main/.agents/skills/ai-regression-testing
- **Repository:** https://github.com/smartworldarafath/rea_skill
- **GitHub stars:** 73
- **License:** MIT
- **Skill name:** ai-regression-testing
- **Collection:** https://github.com/smartworldarafath/REA_Skill
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill is a set of testing patterns for codebases where an AI agent both writes changes and reviews them. It argues that the same model tends to repeat the same blind spots during self-review, so it pushes regression coverage into automated tests instead of relying on review alone. The guidance centers on writing tests for bugs that were actually found, naming each test after the bug it guards against, and keeping the suite fast.

The main technique is DB-free API testing through a project's sandbox or mock mode. The skill shows a Vitest setup for a Next.js App Router project, a request helper for calling route handlers directly, and example tests that assert required response fields and that sandbox responses match the production shape. It also covers common recurring regressions such as sandbox and production path mismatches, incomplete SELECT clauses, stale state after errors, and optimistic updates without rollback.

It also describes a bug-check command that runs the test suite and type-check build before any AI code review, so mechanical failures are reported first. The examples assume a Next.js and TypeScript stack with Supabase-style queries and a sandbox flag, so the patterns need adapting for other stacks.

## When your agent uses it

> 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. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/ai-regression-testing)
- [License: MIT](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/ai-regression-testing)

## Features

- **Sandbox-mode API testing:** Runs route handler tests against a mock mode so no database is needed.
- **Vitest and Next.js setup:** Provides example config, setup file and request helpers for App Router routes.
- **Regression test patterns:** Covers recurring AI mistakes such as path mismatch, missing SELECT fields and rollback gaps.
- **Bug-check workflow:** Defines a review command that runs tests and build before AI code review.
- **Test-where-bugs-are strategy:** Guides adding tests only to areas that have produced bugs, not full coverage.

## Good for

- Add regression tests for an API route after a bug fix
- Check that sandbox and production responses return the same fields
- Run a bug-check pass on recent AI-generated changes
- Set up Vitest with a DB-free sandbox mode in a Next.js project
- Add rollback handling tests for optimistic UI updates

## Install

### Claude Code

This skill ships in the `rea-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add smartworldarafath/REA_Skill
/plugin install rea-skills@smartworldarafath
```

Or copy only this skill to `~/.claude/skills/ai-regression-testing`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/ai-regression-testing &&
cp -R "$tmp/.agents/skills/ai-regression-testing" ~/.claude/skills/ai-regression-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/ai-regression-testing` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/ai-regression-testing` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/ai-regression-testing &&
cp -R "$tmp/.agents/skills/ai-regression-testing" ~/.agents/skills/ai-regression-testing &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/ai-regression-testing` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/ai-regression-testing` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/ai-regression-testing &&
cp -R "$tmp/.agents/skills/ai-regression-testing" ~/.cursor/skills/ai-regression-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/ai-regression-testing` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/smartworldarafath/REA_Skill.git --path .agents/skills/ai-regression-testing
```

Or copy the folder to `~/.gemini/skills/ai-regression-testing` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/ai-regression-testing`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/ai-regression-testing &&
cp -R "$tmp/.agents/skills/ai-regression-testing" ~/.copilot/skills/ai-regression-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/ai-regression-testing` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git
```

Then copy `REA_Skill/.agents/skills/ai-regression-testing` into your agent's skills folder as `ai-regression-testing`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to be useful?

It assumes a project with a sandbox or mock mode and a test runner such as Vitest. The examples use Next.js App Router and TypeScript.

### When does AI regression testing activate?

When an AI agent has changed API routes or backend logic, after a bug is fixed, when running a bug-check or review command, or when the same model wrote and reviewed a change.

### Does AI regression testing run any scripts?

No scripts are included. It provides markdown guidance with code examples for tests and a bug-check command.

### How do I install AI regression testing in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/ai-regression-testing to use it in all your projects, or to .claude/skills/ai-regression-testing in one project. Or install the rea-skills plugin, which includes it: /plugin marketplace add smartworldarafath/REA_Skill, then /plugin install rea-skills@smartworldarafath.

### Does AI regression testing run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use AI regression testing?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to AI regression testing?

The closest alternatives to AI regression testing are Vitest skill, Jest skill, Unit test vue pinia, Testcafe skill and Scoutqa test.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Vitest skill](https://ai-powered.com/skills/vitest-skill): Vitest skill is an open-source agent skill for developer tools.
- [Jest skill](https://ai-powered.com/skills/jest-skill): Jest skill is an open-source agent skill for developer tools.
- [Unit test vue pinia](https://ai-powered.com/skills/unit-test-vue-pinia): Unit test vue pinia is an open-source agent skill for developer tools.
- [Testcafe skill](https://ai-powered.com/skills/testcafe-skill): Testcafe skill is an open-source agent skill for developer tools.
- [Scoutqa test](https://ai-powered.com/skills/scoutqa-test): Scoutqa test is an open-source agent skill for developer tools.
- [Webapp testing](https://ai-powered.com/skills/webapp-testing-github): Webapp testing is an open-source agent skill for browser automation.
- [Manual tester](https://ai-powered.com/skills/manual-tester): Manual tester is an open-source agent skill for developer tools.
- [React frontend](https://ai-powered.com/skills/react-frontend): React frontend is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/ai-regression-testing
