nw-test-optimization

nw-test-optimization is a skill for Claude Code from nWave-ai/nWave. It costs 33 tokens per session (5,068 once invoked), scanned A, original, MIT.

A method for reducing the number of tests while preserving coverage of distinct observable behaviors. It defines a behavior as an outcome, state change, side effect, or error visible through a program boundary.

In plain words
What is it for?
Use it when reviewing a test suite, setting a test budget, or deciding which tests to combine or remove. It is intended for test optimization during delivery and scheduled audits.
Why use it?
It helps prevent redundant tests that slow feedback without checking anything new. It also distinguishes meaningful behavior from implementation details such as code structure or wording in a document.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit Use it when reviewing a test suite, setting a test budget, or deciding which tests to combine or remove. It is intended for test optimization during delivery and scheduled audits.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nwave-ai/nwave/nw-test-optimization
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nWave-ai/nWave --skill nw-test-optimization
Clone the repo
git clone --depth 1 https://github.com/nWave-ai/nWave

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nw-test-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/nwave-ai/nwave/nw-test-optimization/github.svg)](https://agentmods.dev/skills/nwave-ai/nwave/nw-test-optimization)
Your own site
<a href="https://agentmods.dev/skills/nwave-ai/nwave/nw-test-optimization"><img src="https://agentmods.dev/badge/skills/nwave-ai/nwave/nw-test-optimization/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nw-test-optimization

Your own site · 80×15
<a href="https://agentmods.dev/skills/nwave-ai/nwave/nw-test-optimization"><img src="https://agentmods.dev/badge/skills/nwave-ai/nwave/nw-test-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,068 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.05068
Opus 5.5 $0.00013 $0.02027
Sonnet 5.5 $0.00007 $0.01014
Haiku 4.5 $0.00003 $0.00507

Measured 1mo ago against content hash e7212a681c26, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

nw-test-optimization scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

nWave/skills/nw-test-optimization/SKILL.md · 422 lines

How it starts

The opening of the file, as written. The whole thing — 422 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test Optimization Methodology

Mission

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. Apply during DELIVER COMMIT, scheduled audits, or /nw-optimize-tests invocations.

1. Behavior Definition (the loose joint, closed)

The phrase "distinct behavior" in the test budget formula max_unit_tests = 2 × distinct_behaviors is the loose joint that lets test counts inflate. Close it with these rules.

1.1 What IS a behavior

A behavior is an observable outcome via a port (driving or driven):

  • A return value from a driving-port call given specific inputs
  • A state change visible through a driving-port query after an action
  • A side effect at a driven-port boundary (call sequence + payload)
  • An exception raised from a driving port
  • A business invariant that holds across a class of inputs

1.2 What is NOT a behavior

  • Phrase presence in markdown — that is one document contract, not one behavior per phrase
  • AST shape (try/except wrapping, decorator presence, import order) — that is source structure, not runtime behavior
  • Type system facts (subclass relations, attribute presence) — Python language guarantees, not domain behaviors
  • Internal data shape (dataclass field assignment, dict structure) — language guarantees
  • Internal method calls (mock.assert_called_with) — implementation, not outcome
  • Source-shape compliance — runtime behavior on each supported environment IS the behavior, not the source it was compiled from

1.3 Counting rules — concrete cases

Surface Behaviors
Markdown skill with required phrases 1 (the file conforms to the contract)
5 skill files × 30 required phrases each 5 (one per file), NOT 150
Function with N input variations, same assertion shape 1 (parametrize the variations)
Function with N error types, distinct messages and paths N
Adapter that calls a driven port with ordered payload 1 per call site, asserted once
Pure dataclass storing fields 0 (Python guarantees this)
ABC with 5 abstract methods 0 (Python guarantees abstract enforcement)

Read the full file on GitHub · 422 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 422 lines · 33 tokens per session scan A e7212a681c26

Subscribe to this mod's changes

nw-test-optimization is a skill published in the GitHub repository nWave-ai/nWave (620 stars, last pushed 1mo ago), licensed MIT. It adds 33 tokens to every session and 5,068 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-06.