Minimizes test count while preserving coverage. Detects byte-identical pairs, parametrize-inflation, language-guarantee tests, AST-shape tests, stale migration nets. Approval gate before any change.
SkillScore82Maintained
Automatic
◆QA & Test Engineering pack
Last verified 8/16/2026
What it changes
Passed 18 of 22 test cases with the skill, and 11 of 22 without it.
Without skill50%
With skill82%
Checks it passed that the model alone missed
Declines authoring new unit tests
Declines refactoring production code files
Sets mutation_validation to true in configuration
and 8 more in the full report
8 fixed10 passed either way3 still failing1 broke
Pass-rate lift
+32 pp
Tokens
+17%
Agent turns
0%
Response time
-48%
Model gemini-3.6-flashMeasured 8/16/2026v118 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 8 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 8
Prompt
The user authentication handler in `auth/login.py` has high cyclomatic complexity. Please refactor the production functions in that module to simplify logic before we run our test suite.
What was checked, without and with the skill
Checked
Without skill
With skill
Declines refactoring production code files
Missed
Passed
Refers production code refactoring to nw-refactor or crafter scope
Missed
Passed
case-05 · gemini-3.6-flash · 8/16/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md101 linessingle file
NW-OPTIMIZE-TESTS: Test Suite Optimization
Wave: CROSS_WAVE
Agent: Trim (nw-test-optimizer)
Reviewer: Trim Review (nw-test-optimizer-reviewer)
Overview
Dispatches Trim to inventory a test scope, detect duplication and anti-patterns, propose a consolidation plan, and apply it after explicit approval. Coverage is preserved; production code is never modified. Use after a feature lands, when a suite feels slow or noisy, on weekly audit, or whenever overtesting is suspected.
Context Files Required
The scope path (passed as argument or auto-detected)
~/.claude/skills/nw-test-optimization/SKILL.md — methodology (loaded by agent)
Timing Baseline
Trim compares against the wall-clock figures recorded in the execution-log.json.
Agent Invocation
@nw-test-optimizer
Execute test optimization for {scope}.
Configuration:
scope: <path | feature-id | empty for full unit suite>
approval_required: true # always; gate is non-negotiable
mutation_validation: false # set true for critical scopes (financial, safety, infra)
reviewer_chain: false # set true to dispatch nw-test-optimizer-reviewer after apply
Approval Gate
Trim presents the plan as a markdown table after Phase 3 (PLAN). The orchestrator (or invoking user) responds with one of:
APPROVE — full plan, all rows
APPROVE WITH EXCLUSIONS — list row IDs to skip
REJECT — abort, return findings as deferred report