n-coverage-fix

Iteratively writes tests to kill survived Stryker mutants and raise mutation score.

Updated Jun 25, 2026
One-click install
npx skills add https://github.com/nitra/7n-test --skill n-coverage-fix-nitra
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n-coverage-fix
Source: https://github.com/nitra/7n-test/tree/main/npm/skills/coverage-fix
Command: npx skills add https://github.com/nitra/7n-test --skill n-coverage-fix-nitra

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @7n/test.

What problem does it solve? Mutation testing with Stryker often leaves survived mutants that indicate weak test coverage, but manually reading huge coverage reports and writing targeted tests for each mutant is slow and token-expensive. This Skill automates the loop: run coverage, read a compact index of survived mutants, delegate per-file test writing to subagents, and repeat until convergence. ## Core Features & Use Cases - Compact mutant index: Uses npx @7n/test coverage-fix index to get a small JSON summary of survived mutants instead of parsing megabyte-sized COVERAGE.md files. - Per-file subagent slices: Generates a self-contained prompt per source file via coverage-fix slice --file, including mutant locations, replacements, and surrounding context. - Iterative convergence loop: Re-runs coverage up to 3 iterations, stopping when the survived-mutant count no longer decreases, and normalizes test files into tests/ directories. - Use Case: After adding a new feature to a Bun/JavaScript project, run the Skill to automatically write tests that kill all newly survived mutants before committing. ## Quick Start Run the n-coverage-fix skill from the project root to analyze survived mutants and iteratively write tests until the mutation score converges.

Frequently Asked Questions about n-coverage-fix

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

FAQPage Schema
How do I fix survived mutants from Stryker mutation testing?

Run the coverage command to generate COVERAGE.md, then use the coverage-fix index command to list survived mutants per file. For each file, generate a slice prompt with mutant details and write targeted tests in the tests directory, repeating until the count stops decreasing.

How to improve mutation score in a JavaScript project automatically?

Use an iterative loop: run mutation coverage, extract a compact index of survived mutants, delegate test writing per affected file, verify all tests pass, then re-run coverage. The process repeats up to three iterations or until the mutant count converges.

Can I run multiple coverage-fix processes in parallel?

No, parallel runs are explicitly forbidden. Stryker writes mutation.json and incremental.json to a single directory, so concurrent executions corrupt both files even though the coverage command itself is serialized with a lock.

Why do some mutants survive even after writing tests?

Some mutants are unkillable due to equivalent mutations, protected external state, or nondeterministic logic. When the survived count stops decreasing between iterations, convergence is reached and remaining mutants are accepted as a normal outcome.

Where should test files be placed for mutation testing fixes?

Tests belong in a tests subdirectory next to the source file, named <basename>.test.mjs. Co-located test files are migrated into this structure with updated relative imports before new tests are written.