/nw-optimize-tests
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.
Claude Code
$ npx -y skills add nWave-ai/nWave --skill nw-optimize-tests --agent claude-code
Codex
$ npx skills add nWave-ai/nWave --skill nw-optimize-tests -a codex -y
Cursor
$ npx skills add nWave-ai/nWave --skill nw-optimize-tests -a cursor -y
Gemini CLI
$ npx skills add nWave-ai/nWave --skill nw-optimize-tests -a gemini-cli -y
GitHub Copilot
$ npx skills add nWave-ai/nWave --skill nw-optimize-tests -a github-copilot -y
OpenCode
$ npx skills add nWave-ai/nWave --skill nw-optimize-tests -a opencode -y
Windsurf
$ npx skills add nWave-ai/nWave --skill nw-optimize-tests -a windsurf -y
SKILL.md
nw-optimize-tests.SKILL.mdname: nw-optimize-tests
description: Consolidates a test scope to the fewest tests that preserve coverage and behavior, deleting duplication, parametrize inflation, language-guarantee tests, AST-shape tests, and stale migration nets. An independent read-only reviewer with veto always validates the result.
user-invocable: true
argument-hint: '[scope] - a path, a feature-id (resolves to tests/<id>/), or omit for the full unit suite.'
NW-OPTIMIZE-TESTS
Act when invoked. Do not wait for approval, do not present a plan table, and do not produce a report artifact.
Dispatch `nw-test-optimizer` over `{scope}` (methodology: `nw-test-optimization`).
Invariants:
- Run the exact project-declared command vector before and after, in the same
environment and over the same scope. Compare terminal process timing only.
- Production files in the diff: zero.
- Coverage and observed behavior preserved; any drop is justified in the reply.
- Consolidate by deletion, never by adding a test to cover a removed one.
- Tests must prove observable behavior, never source prose or AST shape.
After the mutation, always dispatch `nw-test-optimizer-reviewer` over the resulting diff. It reads only, and it holds veto: production drift, coverage or behavior loss, and any deletion not mapped to a stated pattern are refusals the optimizer must repair before the work is done. Its verdict is prose in the reply, not an artifact or a schema.
Out of scope: authoring new tests, production refactoring, test infrastructure.
Read more
name: nw-optimize-tests description: Consolidates a test scope to the fewest tests that preserve coverage and behavior, deleting duplication, parametrize inflation, language-guarantee tests, AST-shape tests, and stale migration nets. An independent read-only reviewer with veto always validates the result. user-invocable: true argument-hint: '[scope] - a path, a feature-id (resolves to tests/<id>/), or omit for the full unit suite.'
NW-OPTIMIZE-TESTS
Act when invoked. Do not wait for approval, do not present a plan table, and do not produce a report artifact.
Dispatch `nw-test-optimizer` over `{scope}` (methodology: `nw-test-optimization`).
Invariants:
- Run the exact project-declared command vector before and after, in the same
environment and over the same scope. Compare terminal process timing only.
- Production files in the diff: zero.
- Coverage and observed behavior preserved; any drop is justified in the reply.
- Consolidate by deletion, never by adding a test to cover a removed one.
- Tests must prove observable behavior, never source prose or AST shape.
After the mutation, always dispatch `nw-test-optimizer-reviewer` over the resulting diff. It reads only, and it holds veto: production drift, coverage or behavior loss, and any deletion not mapped to a stated pattern are refusals the optimizer must repair before the work is done. Its verdict is prose in the reply, not an artifact or a schema.
Out of scope: authoring new tests, production refactoring, test infrastructure.
AI agents that guide you from idea to working code, with human judgment at every gate. nWave runs inside Claude Code. It breaks feature delivery into seven waves (discover, diverge, discuss, design, devops, distill, deliver).
Other skills on nwave.
More skills from other plugins.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
ask-matt
Ask which skill or flow fits your situation. A router over the skills in this repo.
Questions about nw-optimize-tests.
- Which coding agents can use nw-optimize-tests?
- nw-optimize-tests installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

