Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Defines how to minimize tests while preserving behavioral coverage via consolidation, paradigm matching, and anti-pattern review modules.
27% 91%+64 ptsof test cases passed
Passed 20 of 22 test cases with the skill, and 6 of 22 without it.
Before I rewrite a set of 30 example-based tests for our currency rounding rules, I want to know whether property-based testing or another test shape fits better. Which module should I consult?
Recommends loading nw-test-optimization-paradigm-match
3 of 3 safety checks passed
Minimize tests, maximize value, reduce feedback time, maintain quality. (Ale, 2026-04-28: "Bisogna minimizzare i test, massimizzare il valore per ridurre il tempo di feedback, mantenendo la qualità.")
This skill operationalizes that mission for /nw-optimize-tests invocations and scheduled test audits. An optimization is judged by preserved observable behavior and coverage under the same command and environment, never by a universal test-count budget or a commit artifact.
Budgets, per-feature derogations, the default CI suite ceiling (300 s unless a repository ADR sets another) and the infrastructure suite follow test:feedback-loop-budget in nw-cross-cutting-invariants; an optimization never moves a test into the infrastructure suite to meet a budget.
This is a lean core. The methodology is split into 6 one-job modules: two ship as separate skills and are loaded by name; the other four are summarised below so the core stands alone. Apply the job whose trigger matches the situation.
| Module | Kind | Trigger — load when |
|---|---|---|
nw-test-optimization-consolidation | KNOWLEDGE | "I have redundant tests — how do I collapse them without losing coverage" |
nw-test-optimization-paradigm-match | KNOWLEDGE | "which test paradigm fits this test shape — before authoring/migrating" |
Path form: ~/.claude/skills/{module}/SKILL.md.
| Job | Kind | Trigger — apply when | Rule |
|---|---|---|---|
| Behavior counting | KNOWLEDGE | "what counts as a behavior here / how many distinct behaviors does this scope expose" | A behavior is one observable outcome through a public port; count distinct observations, never tests, functions or lines. |
| Anti-pattern review | KNOWLEDGE | "is this test an anti-pattern — block at review" | Block language-guarantee, AST-shape and trivial-dataclass tests, mock-asserting-mock, parametrize-inflation, and never-collapsing migration nets. |
| Coverage validation | PROCEDURE | "before declaring an optimization done, prove no coverage was lost" | Run the same native selection before and after; every distinct observation and falsifier must survive. A lower test count is not lost coverage; a lost promised observation is. |
| Scope selection | KNOWLEDGE | "invoked without a specific scope — what do I attack first" | Rank by leverage: byte-identical file pairs, files with hundreds of collected tests, expensive per-test setup with read-only assertions, closed-world finite domains, language-guarantee or AST-shape files, aging migration paths. |
nw-test-optimization-consolidation, nw-test-optimization-paradigm-match./nw-refactor and the crafter scopeNext to this one in the catalogue, plus more from the same author.