skills/mutation-testing/SKILL.md
Use this skill when planning or executing mutation testing to evaluate whether a test suite catches meaningful defects, especially when coverage is high but confidence is low.
npx skillsauth add chatandbuild/chatchat-skills Mutation TestingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use mutation testing to measure whether tests actually catch behavioral changes.
JavaScript/TypeScript: Stryker (npx stryker run) with stryker.config.json. Use mutate to scope files; ignorePatterns to exclude generated or third-party code. Mutators: arithmetic (+->-), block statement removal, conditional boundary (<-><=), string literal replacement.
Java: PIT (pitest) via Maven/Gradle. Scope with targetClasses and targetTests. Mutators: CONDITIONALS_BOUNDARY, INCREMENTS, MATH, NEGATE_CONDITIONALS, VOID_METHOD_CALLS, REMOVE_CONDITIONALS.
Python: mutmut (mutmut run) or cosmic-ray. Scope with paths_to_mutate or --paths. Mutators: arithmetic, comparison, logical operator replacement; constant replacement; argument removal.
Mutation operator types: Arithmetic (e.g., +->-), relational (<-><=), logical (&&->||), conditional boundary, statement deletion, return value replacement. Some operators (e.g., constant replacement) produce many equivalent mutants; consider excluding them if they inflate noise.
Equivalent mutant detection: Mutants that produce identical behavior are undetectable by tests. Look for mutations in dead code, constants used only for logging, or symmetric operations. Mark equivalent mutants and exclude from score calculation to avoid chasing impossible kills.
Boundary condition mutants: Mutations like x < 5 -> x <= 5 often survive when tests only hit one side of the boundary. Add explicit boundary tests (e.g., x=4, x=5, x=6).
Operator replacement mutants: Surviving arithmetic or logical mutants indicate missing assertions or edge cases. Strengthen assertions to verify computed values, not just that code ran.
Incremental mutation testing: Run mutation only on changed files or PR-touched modules. Reduces feedback time; combine with periodic full runs.
PR-scoped mutation: Gate PRs on mutation score for modified files. Set threshold (e.g., 80%) with rationale; allow override for equivalent-mutant-heavy areas.
Baseline tracking: Store baseline scores per module; fail CI if score drops below baseline without justification.
## Mutation Testing Report
- Tool: <Stryker/pitest/mutmut/cosmic-ray>
- Scope: <paths/modules>
- Mutators enabled: <list>
- Baseline mutation score: <percent>
- Current mutation score: <percent>
- Equivalent mutants (excluded): <count>
## Surviving Mutants (Top Priorities)
| File/Function | Mutation type | Risk | Suggested fix |
|---------------|---------------|------|---------------|
| ... | ... | ... | ... |
## Test Improvements
- Added tests: <count>
- Strengthened assertions: <summary>
- Boundary tests added: <summary>
- Remaining gaps: <summary>
## CI Gate Recommendation
- Proposed threshold: <percent>
- Scope: <full/incremental/PR-scoped>
- Rationale: <short explanation>
tools
Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).
development
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.
development
Use this skill when turning messy workout information into clear logs, comparing user-provided sessions, surfacing trends or likely PRs, and suggesting realistic next-session steps.
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.