mutation-gate-barrel-leaf-extraction

Extracts leaf helpers from component barrels to shrink Stryker mutation test fan-out.

1|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/VilnaCRM-Org/claude-plugins --skill mutation-gate-barrel-leaf-extraction-vilnacrm-org
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mutation-gate-barrel-leaf-extraction
Source: https://github.com/VilnaCRM-Org/claude-plugins/tree/main/plugins/react-frontend-sdlc/skills/mutation-gate-barrel-leaf-extraction
Command: npx skills add https://github.com/VilnaCRM-Org/claude-plugins --skill mutation-gate-barrel-leaf-extraction-vilnacrm-org

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When a small helper (a style map, predicate, or formatting function) lives inside a component directory and is imported through that component's barrel, Stryker's jest runner with findRelatedTests pulls the component's entire suite set into every mutant run for consuming files, making mutation shards slow. ## Core Features & Use Cases - Fan-out measurement: Uses jest --listTests --findRelatedTests to count related suites and identify candidate files with roughly thirty or more reverse-dependency suites. - Guided extraction procedure: Moves qualifying leaf helpers (no hooks, no component state, no MUI imports) into a shared utils/ module under the source root, re-exports them from the barrel, and repoints consumers via path aliases. - Verification gates: Confirms type-check, dependency-cruiser, and Storybook build targets stay clean while the related-test count and shard timing drop. - Use Case: A mutation shard runs long because a srOnlySx style helper exported from a component barrel is imported across directories; this Skill moves it to utils/, cutting the per-mutant suite reload count. ## Quick Start Ask the assistant to measure the findRelatedTests fan-out for a helper imported through a component barrel and extract it into the shared utils directory if it qualifies as a leaf.

Frequently Asked Questions about mutation-gate-barrel-leaf-extraction

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

FAQPage Schema
How do I reduce Stryker mutation testing time in a React project?▼

Reduce Stryker mutation time by shrinking the related-test fan-out: move leaf helpers imported through component barrels into a shared utils module so jest findRelatedTests no longer pulls the whole component suite set into each mutant run. Measure suite counts before and after the move.

How do I check which tests jest runs for a mutated file?▼

Run jest --listTests --findRelatedTests on the file and count the output lines, for example with wc -l. Files with roughly thirty or more related suites are candidates for leaf extraction, since reverse-dependency fan-out drives per-mutant cost.

When should a helper be moved out of a component directory?▼

Move a helper only when it is a true leaf (no hooks, component state, or MUI imports), is consumed from outside its own directory, is reached through the component barrel, and is small and rarely edited. Keep a re-export in the barrel so the public API does not change.

Does this refactoring work with Next.js or component-library repositories?▼

It applies partially. Next.js shapes have enableFindRelatedTests on but a curated mutate list, so fan-out rarely dominates. Component-library shapes benefit only once enableFindRelatedTests is enabled in the Stryker config.

Why is a mutation shard still slow after moving the helper?▼

A shard stays slow when its files genuinely own many reverse-dependency suites; extraction only removes barrel-induced fan-out. That case needs a shard packer weighted by related-suite cost or more shards, not another file move.