# test-engineer

test-engineer writes unit, integration and end-to-end tests for the code you just finished, then reports coverage by line, branch and function. Useful when a feature works but nothing guards it.

- subagent · `type=agent` · Claude Code, Codex, Cursor · ★ 1357 repo stars
- Author: qdhenry
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/qdhenry/Claude-Command-Suite/tree/HEAD/.claude/agents/test-engineer.md
- Updated: 2026-03-01
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/agents/qdhenry-test-engineer

## What it does

A Claude subagent that writes tests for code you already have and measures how much of it they touch. Its description tells Claude to call it whenever code is written or changed, so it is meant to stay in the loop instead of running once.

The instructions walk through three stages. First it hunts for files with no tests and runs `npm test -- --coverage`. Then planning: function signatures, boundaries, failure cases, test data. Then the tests themselves, built around setup, action and assertion, with mocks and isolation. Coverage targets are fixed: lines above 90%, branches above 85%, functions above 95%, critical paths at 100%. It finishes with a markdown report that breaks coverage down by module and lists the lines still uncovered.

It holds `Read`, `Write`, `Edit`, `Bash`, `Grep` and `Glob`, so it can edit test files and run the suite itself. The numbers come from `npm test -- --coverage`; a project without that script leaves the percentages empty and the report a summary of code.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/agents/test-engineer.md` — For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

### Codex

**Manually: put the files in place**
- File: `.codex/agents/test-engineer.toml` — Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

### Cursor

**Manually: put the files in place**
- File: `.cursor/agents/test-engineer.md` — Cursor also reads .claude/agents/

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/qdhenry/Claude-Command-Suite/tree/HEAD/.claude/agents/test-engineer.md

## When to use it
- write unit tests for a function that just landed
- find source files with no test file at all
- read a coverage report by module and spot uncovered branches
- cover validation errors and failure paths
- guard critical paths before a release

## Example prompts
- Use the test-engineer subagent to add tests for `UserService`, including the validation errors.
- Run test-engineer and show me which modules fall short on coverage.
- Have test-engineer write a regression test for the bug we just fixed.

## Similar
- [test-coverage](https://affpapa.org/en/nevibecode/skills/test-coverage.md) — skill · 1900 installs
- [test-automator](https://affpapa.org/en/nevibecode/skills/test-automator.md) — skill · 823 installs
- [test-gaps](https://affpapa.org/en/nevibecode/skills/test-gaps.md) — skill · 755 installs
- [test-audit](https://affpapa.org/en/nevibecode/skills/mblode-test-audit.md) — skill · 283 installs
- [python-testing](https://affpapa.org/en/nevibecode/skills/python-testing.md) — skill · 6800 installs
- [tdd-workflow](https://affpapa.org/en/nevibecode/skills/affaan-mustafa-tdd-workflow.md) — skill · ★ 6739 repo stars

## Other versions with the same name
- [test-engineer · anthropics](https://affpapa.org/en/nevibecode/agents/test-engineer.md) — 9715 installs
- [test-engineer · alirezarezvani](https://affpapa.org/en/nevibecode/agents/alirezarezvani-test-engineer.md) — ★ 788 repo stars
- [test-engineer · managedcode](https://affpapa.org/en/nevibecode/agents/managedcode-test-engineer.md) — ★ 521 repo stars
- [test-engineer · gupsammy](https://affpapa.org/en/nevibecode/agents/samarth-gupta-test-engineer.md) — ★ 276 repo stars

From the same set: [qdhenry/claude-command-suite](https://affpapa.org/en/nevibecode/by/qdhenry/claude-command-suite.md) — 112 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
