Unit Test Architect skill for Claude and Codex
Plans the unit tests for a module before any are written: a test-case table per critical function, the mocking strategy and its boundaries, coverage targets…
Install it once and Claude or Codex runs it for you. When your request matches, your AI loads the skill, asks for anything it is missing, and works through the template itself. Prefer to fill it in by hand? See the full prompt template.
Download the skill (.zip) · View SKILL.md
When it is used
Use when a module has no tests yet and you need a test plan with cases per function, a mocking strategy, and a worked example in your framework. Do not use for generating a full test file for one function, or analysing the results of an existing suite. Related topics: coding, unit.
What it will ask you for
- Programming language (choose one: Python, JavaScript, TypeScript, Java, C#, Go)
- Test framework (choose one: pytest, Jest, Vitest, JUnit, NUnit, Go test)
- Module description (longer free text)
- Module source if available (longer free text)
- Critical functions (choose any: Initialization, Data processing, Output generation, Error handling, External calls)
- Target coverage in percent (number from 50 to 100)
- Mocking approach (choose one: Manual stubs, Mock library, Dependency injection)
- Constraints (longer free text)
How it works
- Enumerate the behaviours per critical function: happy path, boundaries, error branches, and external dependencies; each has a row.
- Fix the mock boundary (process-crossing dependencies mocked, pure logic real) and express it in the chosen approach and framework idiom.
- Assign a coverage target per function weighted toward error handling and data processing, summing to the overall target.
- Write one complete arrange-act-assert test per critical function with the mock set up as the guidelines say.
- Assemble the four sections and check every table row has a test name that reads as a sentence.
What you get
A markdown document with Overview, Test Plan Table (function, case, mock, coverage), Sample Test Code (one fenced test per critical function), and Mock Guidelines.
What it watches out for
- Mocking the module's own pure functions, so tests pass while the real logic is never executed.
- Planning one test per function instead of one per behaviour, which hits the coverage number and misses the error branches.
- Choosing a mock library idiom the framework does not support, such as patching in Go where injection is the only route.
How to install
Claude.ai and the Claude desktop app
- Download the skill .zip.
- Open Settings, then Capabilities, and find Skills.
- Choose Upload skill and select the .zip.
- Ask Claude for help with the task. It loads the skill when your request matches.
Claude Code
- Download the skill .zip.
- Unzip it into ~/.claude/skills/ (or .claude/skills/ inside a project).
- Start a new session. Claude Code loads the skill when your request matches.
Codex
- Download the skill .zip.
- Unzip it into ~/.agents/skills/ (or .agents/skills/ inside a project).
- Codex picks it up on its own. Type $ and the skill name to use it, or just ask for the task.
Cursor
- Download the Cursor rule (.mdc).
- Save it in .cursor/rules/ inside your project.
- Cursor's agent applies the rule when your request matches its description.
AGENTS.md (Codex, Cursor, and other coding agents)
- Copy the AGENTS.md section.
- Paste it into AGENTS.md at the root of your repository, creating the file if needed.
- Coding agents that read AGENTS.md follow it when your request fits.