Official agent skill

Code Testing Agent

by microsoft in microsoft/testfx

Generates and writes new unit tests for any programming language — scaffolds .NET test projects, pytest suites, Vitest/Jest suites, Go test files, and JUnit suites, and configures coverage tooling…

OfficialMITAuto-check passedTesting & QA

Install Code Testing Agent

skills CLI
$ npx skills add microsoft/testfx --skill code-testing-agent -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/testfx code-testing-agent --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/testfx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/code-testing-agent .claude/skills/code-testing-agent && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
code-testing-agent
GitHub stars
1k
Token cost
~2.7k tokens
SKILL.md length
983 words
Files
3
Skills in repo
44
Repo updated
First seen
Licence
MIT

At a glance

Generates and writes new unit tests for any programming language — scaffolds .NET test projects, pytest suites, Vitest/Jest suites, Go test files, and JUnit suites, and configures coverage tooling…

  • Works in 5 steps: Determine the user request → Invoke the Test Generator → Research Phase (Automatic) → …
  • Asked to generate tests
  • SKILL.md covers When to Use This Skill, When Not to Use, How It Works and Step-by-Step Instructions, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Code Testing Agent is an agent skill from microsoft/testfx, published by the product's own GitHub organization. Generates and writes new unit tests for any programming language — scaffolds .NET test projects, pytest suites, Vitest/Jest suites, Go test files, and JUnit suites, and configures coverage tooling (coverlet, pytest-cov, @vitest/coverage-v8) as part of test generation. Use when asked to generate tests, generate pytest tests, generate Vitest tests, write unit tests, add tests, improve coverage, comprehensive tests, or scaffold a new test project or suite for an app, service, library, REST API, blueprint, or package…

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `extensions/dotnet.md` and `unit-test-generation.prompt.md`).

It sits in Testing & QA, covering Unit testing and Test generation. It works with TypeScript, pytest, Vitest and Jest. The repository describes itself as: This repository holds the source code of Microsoft.Testing.Platform (MTP), a lightweight alternative to VSTest, as well as MSTest adapter and framework. The licence is MIT.

When your agent uses it

  • Asked to generate tests
  • Generate pytest tests
  • Generate Vitest tests
  • Write unit tests

Example prompts

  • “Use the code-testing-agent skill to generate and writes new unit tests for any programming language — scaffolds .NET test projects, pytest suites…”
  • “/code-testing-agent”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Determine the user request
  2. Invoke the Test Generator
  3. Research Phase (Automatic)
  4. Planning Phase (Automatic)
  5. Implementation Phase (Automatic)

What it can do on your machine

Read from SKILL.md and the folder at commit 44b9dcc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Code Testing Agent loads about 2.7k tokens when it runs. Until then it costs about 256 tokens; SKILL.md has 983 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~256
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/testfx at commit 44b9dcc, republished under its MIT licence (© microsoft). 983 words, ~2,695 tokens.

Download SKILL.mdSave it as .claude/skills/code-testing-agent/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
code-testing-agent
description
Generates and writes new unit tests for any programming language — scaffolds .NET test projects, pytest suites, Vitest/Jest suites, Go test files, and JUnit suites, and configures coverage tooling (coverlet, pytest-cov, @vitest/coverage-v8) as part of test generation. Use when asked to generate tests, generate pytest tests, generate Vitest tests, write unit tests, add tests, improve coverage, comprehensive tests, or scaffold a new test project or suite for an app, service, library, REST API, blueprint, or package — including project-wide, multi-file test generation across services, repositories, routes, and modules. Supports C#/.NET, Python (pytest, Flask/Django), TypeScript/JavaScript (Vitest, Jest, Mocha), Go, Rust, Java (JUnit). Runs a research, planning, and implementation pipeline so tests compile and pass. DO NOT USE FOR: running existing tests (use run-tests); analyzing existing coverage reports (use coverage-analysis or crap-score); MSTest modernization (use writing-mstest-tests).
license
MIT

Code Testing Generation Skill

An AI-powered skill that generates comprehensive, workable unit tests for any programming language using a coordinated multi-agent pipeline.

When to Use This Skill

Use this skill when you need to:

  • Generate unit tests for an entire project or specific files
  • Improve test coverage for existing codebases
  • Create test files that follow project conventions
  • Write tests that actually compile and pass
  • Add tests for new features or untested code

When Not to Use

  • Running or executing existing tests (use the run-tests skill)
  • Migrating between test frameworks (use migration skills)
  • Writing tests specifically for MSTest patterns (use writing-mstest-tests)
  • Debugging failing test logic

How It Works

This skill coordinates multiple specialized agents in a Research → Plan → Implement pipeline:

Pipeline Overview
text
┌─────────────────────────────────────────────────────────────┐
│                     TEST GENERATOR                          │
│  Coordinates the full pipeline and manages state            │
└─────────────────────┬───────────────────────────────────────┘
                      │
        ┌─────────────┼─────────────┐
        ▼             ▼             ▼
┌───────────┐  ┌───────────┐  ┌───────────────┐
│ RESEARCHER│  │  PLANNER  │  │  IMPLEMENTER  │
│           │  │           │  │               │
│ Analyzes  │  │ Creates   │  │ Writes tests  │
│ codebase  │→ │ phased    │→ │ per phase     │
│           │  │ plan      │  │               │
└───────────┘  └───────────┘  └───────┬───────┘
                                      │
                    ┌─────────┬───────┼───────────┐
                    ▼         ▼       ▼           ▼
              ┌─────────┐ ┌───────┐ ┌───────┐ ┌───────┐
              │ BUILDER │ │TESTER │ │ FIXER │ │LINTER │
              │         │ │       │ │       │ │       │
              │ Compiles│ │ Runs  │ │ Fixes │ │Formats│
              │ code    │ │ tests │ │ errors│ │ code  │
              └─────────┘ └───────┘ └───────┘ └───────┘

Step-by-Step Instructions

Step 1: Determine the user request

Make sure you understand what user is asking and for what scope. When the user does not express strong requirements for test style, coverage goals, or conventions, source the guidelines from unit-test-generation.prompt.md. This prompt provides best practices for discovering conventions, parameterization strategies, coverage goals (aim for 80%), and language-specific patterns.

Step 2: Invoke the Test Generator

Start by calling the code-testing-generator agent with your test generation request:

text
Generate unit tests for [path or description of what to test], following the [unit-test-generation.prompt.md](unit-test-generation.prompt.md) guidelines

The Test Generator will manage the entire pipeline automatically.

Step 3: Research Phase (Automatic)

The code-testing-researcher agent analyzes your codebase to understand:

  • Language & Framework: Detects C#, TypeScript, Python, Go, Rust, Java, etc.
  • Testing Framework: Identifies MSTest, xUnit, Jest, pytest, go test, etc.
  • Project Structure: Maps source files, existing tests, and dependencies
  • Build Commands: Discovers how to build and test the project

Output: .testagent/research.md

Step 4: Planning Phase (Automatic)

The code-testing-planner agent creates a structured implementation plan:

  • Groups files into logical phases (2-5 phases typical)
  • Prioritizes by complexity and dependencies
  • Specifies test cases for each file
  • Defines success criteria per phase

Output: .testagent/plan.md

Step 5: Implementation Phase (Automatic)

The code-testing-implementer agent executes each phase sequentially:

  1. Read source files to understand the API
  2. Write test files following project patterns
  3. Build using the code-testing-builder sub-agent to verify compilation
  4. Test using the code-testing-tester sub-agent to verify tests pass
  5. Fix using the code-testing-fixer sub-agent if errors occur
  6. Lint using the code-testing-linter sub-agent for code formatting

Each phase completes before the next begins, ensuring incremental progress.

Coverage Types
  • Happy path: Valid inputs produce expected outputs
  • Edge cases: Empty values, boundaries, special characters
  • Error cases: Invalid inputs, null handling, exceptions

State Management

All pipeline state is stored in .testagent/ folder:

FilePurpose
.testagent/research.mdCodebase analysis results
.testagent/plan.mdPhased implementation plan
.testagent/status.mdProgress tracking (optional)

Examples

Strategy Selection

The generator picks a strategy based on request scope:

User RequestStrategyWhy
"Generate tests for src/services/UserService.ts"DirectSingle file, small scope — write tests immediately, skip sub-agents
"Add unit tests for my billing project"Single passModerate scope — one Research → Plan → Implement cycle covers it
"Achieve 80% coverage across the entire solution"IterativeLarge scope — multiple R→P→I cycles, each narrowing remaining gaps
Pipeline Walkthrough

Given a request like "Generate unit tests for my InvoiceService", the pipeline produces:

  1. Research → .testagent/research.md containing detected language/framework, build commands, files to test ranked by priority, and existing test inventory
  2. Plan → .testagent/plan.md containing phased approach with specific methods and test scenarios (happy path, edge cases, error cases) for each file
  3. Implement → Test files written, built, and verified per phase. Fix cycle runs automatically if build/test errors occur
  4. Validate → Full workspace build + full test run to catch cross-project issues
  5. Report → Summary of tests created, pass/fail counts, coverage notes, and next steps
Show full SKILL.md (402 more words)Show less
Language-Specific Examples

The code-testing-extensions skill provides concrete, filled-in examples for each pipeline phase showing real source code, real research output, real plans, and real generated tests. Call the code-testing-extensions skill to discover available extension files, then read:

  • dotnet-examples.md — MSTest example with InvoiceService: research output, plan output, generated test file, fix cycle walkthrough, and final report
  • python-examples.md — pytest example with the same InvoiceService scenario: research, plan, generated test file (parametrized, unittest.mock), fix cycles (ModuleNotFoundError, patch target, Mock(spec=...)), and final report
  • typescript-examples.md — Vitest example (also applicable to Jest) showing it.each parameterization, async tests, fake timers, and ESM/CJS fix cycles
  • go-examples.md — Standard testing package example with table-driven subtests, hand-written fake repository, injected clock, and -run regex fix cycle
  • java-examples.md — JUnit 5 + Mockito example on Maven showing @ExtendWith(MockitoExtension.class), @ParameterizedTest + @CsvSource, Clock.fixed(...) for time, and Surefire fix cycles

For languages without a dedicated examples file (Rust, Ruby, Swift, Kotlin, C++, PowerShell), use the base extension file (<language>.md) plus the example file for the closest paradigm — the pipeline shape (research → plan → generate → fix) and the categories of decisions (test layout, mocking strategy, fixed clock for time-dependent code, parameterization style) translate directly.

Agent Reference

AgentPurpose
code-testing-generatorCoordinates pipeline
code-testing-researcherAnalyzes codebase
code-testing-plannerCreates test plan
code-testing-implementerWrites test files
code-testing-builderCompiles code
code-testing-testerRuns tests
code-testing-fixerFixes errors
code-testing-linterFormats code

Requirements

  • Project must have a build/test system configured
  • Testing framework should be installed (or installable)
  • VS Code with GitHub Copilot extension

Troubleshooting

Tests don't compile

The code-testing-fixer agent will attempt to resolve compilation errors. Check .testagent/plan.md for the expected test structure. Call the code-testing-extensions skill and read the language-specific extension file for error code references (e.g., dotnet.md for .NET).

Tests fail

Most failures in generated tests are caused by wrong expected values in assertions, not production code bugs:

  1. Read the actual test output
  2. Read the production code to understand correct behavior
  3. Fix the assertion, not the production code
  4. Never mark tests [Ignore] or [Skip] just to make them pass
Wrong testing framework detected

Specify your preferred framework in the initial request: "Generate Jest tests for..."

Environment-dependent tests fail

Tests that depend on external services, network endpoints, specific ports, or precise timing will fail in CI environments. Focus on unit tests with mocked dependencies instead.

Build fails on full solution

During phase implementation, build only the specific test project for speed. After all phases, run a full non-incremental workspace build to catch cross-project errors.

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in .agents/skills/code-testing-agent of microsoft/testfx.

  • SKILL.md
  • extensions/dotnet.md
  • unit-test-generation.prompt.md

Open the folder on GitHubat commit 44b9dcc

Compare with similar skills

Code Testing Agent next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code Testing Agent compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Testing Agent this skillmicrosoft/testfx1k—~2.7kAutomated safety check: PassMIT
TDD Guidealirezarezvani/claude-skills28k—~3.4kAutomated safety check: PassMIT
TDD GuideLeoYeAI/openclaw-master-skills2.2k—~1.4kAutomated safety check: PassMIT
TDD Guideborghei/Claude-Skills874—~1.7kAutomated safety check: PassMIT
TDD GuideaAAaqwq/AGI-Super-Team1052 repos~1.1kAutomated safety check: PassMIT
MoAI TDD Workflowmodu-ai/moai-adk1.2k—~3.1kAutomated safety check: PassApache-2.0

Similar skills

  • TDD Guide

    alirezarezvani/claude-skills

    Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…

    28k GitHub stars~3.4k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • TDD Guide

    LeoYeAI/openclaw-master-skills

    Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…

    2.2k GitHub stars~1.4k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • TDD Guide

    borghei/Claude-Skills

    Guide red-green-refactor TDD with test generation, coverage-gap analysis, and multi- framework support.

    874 GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed
  • TDD Guide

    aAAaqwq/AGI-Super-Team

    Test-driven development workflow with test generation, coverage analysis, and multi-framework support

    105 GitHub starsUsed in 2 repos~1.1k tokens
    Testing & QAAuto-check passed
  • MoAI TDD Workflow

    modu-ai/moai-adk

    Drives test-first development through the RED, GREEN, REFACTOR cycle, with a config switch that selects between TDD and a DDD workflow for existing code.

    1.2k GitHub stars~3.1k tokensUpdated today
    Testing & QAAuto-check passed
  • Test Patterns

    rohitg00/skillkit

    Applies proven testing patterns — Arrange-Act-Assert (AAA), Given-When-Then, Test Data Builders, Object Mother, parameterized tests, fixtures, spies, and test doubles — to help write maintainable…

    1.5k GitHub stars~1.8k tokensUpdated 4 mo ago
    Testing & QAAuto-check passed

More from microsoft/testfx

All 44 skills in this repo
  • Official

    Guide for organizing MSBuild infrastructure with Directory.Build.props, Directory.Build.targets, Directory.Packages.props, and Directory.Build.rsp.

    1k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Binlog Failure Analysis

    microsoft/testfx

    Official

    Analyze MSBuild binary logs to diagnose build failures. An agent skill from microsoft/testfx.

    1k GitHub starsUsed in 3 repos~730 tokens
    Auto-check passed
  • Coverage Analysis

    microsoft/testfx

    Official

    Project-wide code coverage and CRAP (Change Risk Anti-Patterns) score analysis for .NET projects.

    1k GitHub stars~7.3k tokensUpdated today
    Auto-check passed
  • Incremental Build

    microsoft/testfx

    Official

    Guide for optimizing MSBuild incremental builds. An agent skill from microsoft/testfx.

    1k GitHub starsUsed in 3 repos~3.7k tokens
    Auto-check passed
  • Msbuild Modernization

    microsoft/testfx

    Official

    Guide for modernizing and migrating MSBuild project files to SDK-style format.

    1k GitHub starsUsed in 3 repos~4.3k tokens
    Auto-check passed
  • Msbuild Antipatterns

    microsoft/testfx

    Official

    Catalog of MSBuild anti-patterns with detection rules and fix recipes.

    1k GitHub stars~4.5k tokensUpdated today
    Auto-check passed

Categories

Questions about Code Testing Agent

What does Code Testing Agent do?

Generates and writes new unit tests for any programming language — scaffolds .NET test projects, pytest suites, Vitest/Jest suites, Go test files, and JUnit suites, and configures coverage tooling…. Code Testing Agent is an agent skill from microsoft/testfx, published by the product's own GitHub organization.NET test projects, pytest suites, Vitest/Jest suites, Go test files, and JUnit suites, and configures coverage tooling (coverlet, pytest-cov, @vitest/coverage-v8) as part of test generation.

When should I use Code Testing Agent?

Code Testing Agent fits situations like: asked to generate tests; generate pytest tests; generate Vitest tests; write unit tests.

How do I install Code Testing Agent in Claude Code?

Run `npx skills add microsoft/testfx --skill code-testing-agent -a claude-code`. Or copy the skill folder (.agents/skills/code-testing-agent in microsoft/testfx) into .claude/skills/code-testing-agent in your project. Claude Code loads it when a task matches its description.

How do I install Code Testing Agent in Codex?

Run `npx skills add microsoft/testfx --skill code-testing-agent -a codex`. Or copy the skill folder (.agents/skills/code-testing-agent in microsoft/testfx) into .agents/skills/code-testing-agent in your project. Codex loads it when a task matches its description.

Can I use Code Testing Agent in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/testfx --skill code-testing-agent -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-testing-agent, .gemini/skills/code-testing-agent, .github/skills/code-testing-agent and .opencode/skills/code-testing-agent in your project.

What does Code Testing Agent need to run?

SKILL.md names no scripts, command-line tools or credentials: Code Testing Agent is instructions for the agent only. Our summary lists: Python 3.

Does Code Testing Agent access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Code Testing Agent safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Code Testing Agent use?

Code Testing Agent is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Testing Agent use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Code Testing Agent?

Skills that share tags, products or a category with Code Testing Agent: TDD Guide (alirezarezvani/claude-skills, 28k stars), TDD Guide (LeoYeAI/openclaw-master-skills, 2.2k stars), TDD Guide (borghei/Claude-Skills, 874 stars) and TDD Guide (aAAaqwq/AGI-Super-Team, 105 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Testing Agent?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/testfx, which has 1,047 GitHub stars. The repository holds 44 skills in this directory. The repository was last updated on October 7, 2026.

Source: microsoft/testfx on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.