# AI test generator

> AI test generator is an open-source agent skill for developer tools. Generates test code from acceptance criteria with an LLM and scores each test's confidence. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/testland/qa/tree/main/plugins/qa-ai-assisted/skills/ai-test-generator
- **Repository:** https://github.com/testland/qa
- **GitHub stars:** 18
- **License:** MIT
- **Skill name:** ai-test-generator
- **Collection:** https://github.com/testland/qa
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill turns acceptance criteria, user stories or requirements into generated test code, with the AI producing drafts and the team reviewing them before merge. It walks the agent through defining structured inputs and expected results per criterion, generating one test per criterion through an LLM call that carries project test conventions, and checking that the output compiles or parses before any scoring happens.

Each generated test receives a heuristic confidence score based on the model's own self-assessment, the presence of vague matchers such as truthiness checks, imports that do not resolve to real modules, and generic test names. Tests are grouped into high, medium and low confidence tiers, and the output ends with a review checklist covering hallucinated APIs, weak assertions, missing setup and redundancy with existing tests.

The workflow expects a spec or story file, a Python environment with the OpenAI client, and the project's test framework, with examples given for Jest and TypeScript, Python and JavaScript syntax checks. It also covers caching prior generations, batching several criteria per call and a feedback loop that refines the prompt over time.

## When your agent uses it

> Use for any question or task about generating tests with an LLM from acceptance criteria, user stories or requirements, including whether it works and why generated tests assert the wrong thing. Scores confidence per test case (self-assessment plus assertion, naming and completeness checks), batches uncertain cases for human review and emits tests in the team's existing framework.

## What it can access

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

- [Instructions only, no scripts](https://github.com/testland/qa/tree/HEAD/plugins/qa-ai-assisted/skills/ai-test-generator)
- [License: MIT](https://github.com/testland/qa/tree/HEAD/plugins/qa-ai-assisted/skills/ai-test-generator)

## Features

- **Structured criteria input:** Defines each acceptance criterion with its id, inputs and expected outcomes in a YAML file.
- **One test per criterion:** Prompts an LLM to write a separate test file for each acceptance criterion using project conventions.
- **Compile and syntax validation:** Checks generated test files for TypeScript, Python or JavaScript syntax before they are scored.
- **Heuristic confidence scoring:** Scores each test using self-reported confidence, vague matchers, unresolved imports and generic naming.
- **Tiered review report:** Groups tests into high, medium and low confidence with a checklist for human reviewers.
- **Prompt feedback loop:** Adds prohibitions or API examples to the prompt when recurring generation problems appear.

## Good for

- Generate Jest tests from a user story's acceptance criteria
- Turn a list of promo code requirements into reviewable test files
- Score generated tests and flag the weak ones for manual rewrite
- Create a review report for AI-written tests before merging a pull request

## Install

### Claude Code

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

```sh
/plugin marketplace add testland/qa
/plugin install qa-ai-assisted@testland-qa
```

Or copy only this skill to `~/.claude/skills/ai-test-generator`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/testland/qa.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/ai-test-generator &&
cp -R "$tmp/plugins/qa-ai-assisted/skills/ai-test-generator" ~/.claude/skills/ai-test-generator &&
rm -rf "$tmp"
```

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

### Codex

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

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/testland/qa.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/ai-test-generator &&
cp -R "$tmp/plugins/qa-ai-assisted/skills/ai-test-generator" ~/.agents/skills/ai-test-generator &&
rm -rf "$tmp"
```

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

### Cursor

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

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/testland/qa.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/ai-test-generator &&
cp -R "$tmp/plugins/qa-ai-assisted/skills/ai-test-generator" ~/.cursor/skills/ai-test-generator &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/ai-test-generator` 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/testland/qa.git --path plugins/qa-ai-assisted/skills/ai-test-generator
```

Or copy the folder to `~/.gemini/skills/ai-test-generator` yourself.

### VS Code

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

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/testland/qa.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/ai-test-generator &&
cp -R "$tmp/plugins/qa-ai-assisted/skills/ai-test-generator" ~/.copilot/skills/ai-test-generator &&
rm -rf "$tmp"
```

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

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/testland/qa.git
```

Then copy `qa/plugins/qa-ai-assisted/skills/ai-test-generator` into your agent's skills folder as `ai-test-generator`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It expects a structured YAML file of acceptance criteria, an OpenAI-compatible LLM client in the sample script, and the team's test framework and conventions document. The examples use Jest and TypeScript, Python and JavaScript checks.

### Does AI test generator change the project's code?

It writes generated test files to a tests/generated folder and produces a markdown report. The skill's guidance says generated tests should be curated by a person before they are merged.

### How is confidence determined?

The score starts at 100 and drops for low self-reported confidence, vague matchers, unresolved imports and generic test names. The skill notes this is heuristic and that high-confidence tests can still be wrong.

### Is AI test generator tied to a specific AI client?

The skill is distributed as a Claude Code plugin in the testland-qa marketplace, but its steps are plain instructions and scripts for running an LLM.

### How do I install AI test generator in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/ai-test-generator to use it in all your projects, or to .claude/skills/ai-test-generator in one project. Or install the qa-ai-assisted plugin, which includes it: /plugin marketplace add testland/qa, then /plugin install qa-ai-assisted@testland-qa.

### Does AI test generator 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 test generator?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to AI test generator?

The closest alternatives to AI test generator are AI evaluation, Create test, API to testcase generator, AI regression testing and Agentic eval.

## Where this comes from

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

## Alternatives

- [AI evaluation](https://ai-powered.com/skills/ai-evaluation): AI evaluation is an open-source agent skill for developer tools.
- [Create test](https://ai-powered.com/skills/create-test): Create test is an open-source agent skill for developer tools.
- [API to testcase generator](https://ai-powered.com/skills/api-to-testcase-generator): API to testcase generator is an open-source agent skill for developer tools.
- [AI regression testing](https://ai-powered.com/skills/ai-regression-testing): AI regression testing is an open-source agent skill for developer tools.
- [Agentic eval](https://ai-powered.com/skills/agentic-eval): Agentic eval is an open-source agent skill for ai models and llm tooling.
- [AI spec coverage mapper](https://ai-powered.com/skills/ai-spec-coverage-mapper): AI spec coverage mapper is an open-source agent skill for developer tools.
- [Eval harness](https://ai-powered.com/skills/eval-harness-fmarzochi): Eval harness is an open-source agent skill for developer tools.
- [Manual tester](https://ai-powered.com/skills/manual-tester): Manual tester is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/ai-test-generator
