mutation-gate

Validate test strength with mutation testing across twelve language-specific tools.

10|7|Updated Feb 23, 2026
One-click install
npx skills add https://github.com/xiaolai/tdd-guardian-for-claude --skill mutation-gate-xiaolai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mutation-gate
Source: https://github.com/xiaolai/tdd-guardian-for-claude/tree/main/skills/tdd-guardian/mutation-gate
Command: npx skills add https://github.com/xiaolai/tdd-guardian-for-claude --skill mutation-gate-xiaolai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code coverage proves lines were executed but not that assertions would catch real bugs. This Skill runs mutation testing to detect weak assertions by introducing controlled code changes (mutants) and checking whether the test suite kills them. ## Core Features & Use Cases - Per-language tool guidance: Canonical install and run commands for Stryker (JS/TS/.NET/Scala), PIT (JVM), Infection (PHP), mutmut and cosmic-ray (Python), go-mutesting and gremlins (Go), cargo-mutants (Rust), mutant (Ruby), and muter (Swift). - Surviving-mutant diagnosis: Catalogs common survivor patterns (off-by-one loops, boolean short-circuits, string-literal leaks, void side effects) with the exact assertion fix for each. - Mutation operator reference: Maps operator families (conditional boundary, arithmetic, logical, statement removal) to the test patterns that kill them. - Use Case: A Rust project's tests pass with 95% coverage, but cargo mutants reveals survivors in boundary comparisons; the Skill directs adding exact boundary-value tests (n, n-1, n+1) until the score threshold passes. ## Quick Start Run mutation testing on my project with the appropriate tool for its language and report any surviving mutants with fixes.

Frequently Asked Questions about mutation-gate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run mutation testing on my test suite?

Install the mutation tool matching your language and test runner, then run its canonical command, such as npx stryker run for JavaScript or cargo mutants for Rust. The tool's exit code and configured score threshold determine pass or fail.

What mutation testing tool should I use for Python?

Use mutmut as the primary Python mutation tool, configured in pyproject.toml with paths_to_mutate and a pytest runner. cosmic-ray is a supported alternative that reports via cr-report --json.

Stryker vs PIT for mutation testing, which is stronger?

PIT is the strongest mutation tool in any ecosystem and is preferred for JVM projects. Stryker covers JavaScript and TypeScript, while Stryker.NET and stryker4s serve C# and Scala respectively.

Why do mutants survive even with high code coverage?

Coverage proves lines executed, not that assertions checked the result. Survivors typically come from missing boundary values, untested default branches, or assertions on mock calls instead of observable behavior.

When is it acceptable to ignore a surviving mutant?

Ignore only equivalent mutants, infeasible code paths, or performance-only constants, and declare each explicitly with tool-specific disable syntax. Never ignore a survivor because of flakiness; fix the flake first.

Does mutation testing work for Elixir, Erlang, or Haskell?

These ecosystems lack mature mutation tools, so requireMutation should stay false for them. Rely on assertion-hierarchy rules instead rather than forcing an immature tool.