Skip to content
Development
Skill

/nw-test-optimization-paradigm-match

Decision rule matching test SHAPE to the right paradigm before authoring/migrating - closed-world vs multi-step-setup vs state-mutation vs unbounded-invariant vs few-examples, plus the falsifier-gate that blocks PBT on finite domains

From plugin
nwave
635183 skills37 agents

Claude Code

$ npx -y skills add nWave-ai/nWave --skill nw-test-optimization-paradigm-match --agent claude-code

SKILL.md

nw-test-optimization-paradigm-match.SKILL.md
name: nw-test-optimization-paradigm-match
description: Decision rule matching test SHAPE to the right paradigm before authoring/migrating - closed-world vs multi-step-setup vs state-mutation vs unbounded-invariant vs few-examples, plus the falsifier-gate that blocks PBT on finite domains
user-invocable: false
disable-model-invocation: true

Paradigm-Match Decision (KNOWLEDGE)

**Kind**: KNOWLEDGE (decision rule / taste). **One trigger**: "which test paradigm fits this test shape — before I author or migrate" — fires at the recon stage of any optimization/authoring where the paradigm is not yet fixed. Mismatched paradigm = ceremony without value (or correctness loss). Composed by `nw-test-optimization`.

Decision table

| Test shape | Paradigm | Empirical anchor | |---|---|---| | **Closed-world finite input** (N known files, M known event types, K known skill names) — assertion shape identical across instances | Native finite-case/table facility collapse → consolidation §3.1 / Dict-iteration → §3.2 | `c2637f6c8` set-difference 155-test → 1 (8.9× faster) | | **Multi-step contract on shared expensive setup** — independent assertions on post-setup read-only state | Single-lifecycle consolidation → §3.7 | `defc07f0d` 24-test 152s → 63s (2.4× faster) | | **User-observable state mutation** (installer/uninstaller/sync/hooks/settings) — N tests verifying same lifecycle's side effects | State-delta paradigm → §3.8 | Task #12 pilot (13% compression / 17% wall-clock) | | **Unbounded input domain** with universal invariant (algorithm, serialization, business rule) — "for all X in DOMAIN, P(X) holds" | Property-based testing with the project's native property engine — see `nw-property-based-testing` | Standard PBT literature; nWave-internal scope = unbounded ONLY | | **Single happy-path + 1-3 sad paths** with distinct error messages | Example-based unit tests, no consolidation needed | n/a — already minimal |

Falsifier-gate before adopting PBT

Closed-world finite input is NOT PBT territory. A property engine's startup and per-example bookkeeping is **slower** than the language's native finite-case/table facility when the input set is finite + enumerable. The facility is whatever the project already uses (illustrations only: Python `pytest.mark.parametrize`, Go table-driven subtests, Rust `rstest`/macro-generated cases, JUnit `@ParameterizedTest`, .NET xUnit `[Theory]`, TS `test.each`, C/C++ data-driven/parameterized test macros); the property engine likewise (Hypothesis, `testing/quick`/rapid, proptest/quickcheck, jqwik, FsCheck, fast-check, RapidCheck, ...). If neither exists natively, record an EVIDENCE_GAP with cause; never change the stack. Apply the gate:

1. **Enumerate the input domain**. Is it finite + listable (`SKILL_NAMES_149`, `EVENT_TYPES_5`, `SUPPORTED_RUNTIMES_3`)? → finite-case collapse, NOT PBT. 2. **Is the invariant value-independent** (holds for ANY valid X, not specific Xs)? → PBT candidate. 3. **Run cost-benefit**: if domain ≤ 10× the typical PBT example budget (100), the native finite-case facility wins on wall-clock + readability + shrinking-from-trivial-counterexamples cost.

**Empirical anchor 2026-05-18** (Python project): PBT migration attempt on 155-file closed-world skill registry was correctly aborted at recon stage by the falsifier-gate. Solution was set-difference finite-case collapse (`c2637f6c8`, 5.42s → 0.71s, 8.9× faster). Documented in memory `feedback_state_transition_test_paradigm` (revised 2026-05-05).

Decision tree (concise)

Test shape?
├─ Same assertion, varying inputs from finite known set?
│   └─ native finite-case/table collapse (§3.1) OR dict/map-iteration (§3.2)
├─ N independent assertions on same post-setup read-only state?
│   └─ single-lifecycle consolidation (§3.7)
├─ State-mutation lifecycle with delta assertions?
│   └─ state-delta paradigm (§3.8)
├─ Universal invariant over unbounded domain?
│   └─ PBT (nw-property-based-testing)
└─ Few specific examples with distinct outcomes?
    └─ example-based, no consolidation

The consolidation mechanics (§3.x) live in `nw-test-optimization-consolidation`; PBT lives in `nw-property-based-testing`.

Read more
@nwave-ai
Ships withnwave

nWave supplies specialist roles and a host-led delivery workflow for software teams.

635183 skills37 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
635
Star history of nWave-ai/nWave on GitHub, a chart by star-history.com

Other skills on nwave.

nw-ab-agent-template

nw-ab-agent-template

KNOWLEDGE — the canonical agent-spec template (frontmatter + body skeleton). Reference loaded by the create/migrate procedures;…

@nwave-ai@nwave-aiInstall Skill
nw-ab-anti-patterns

nw-ab-anti-patterns

KNOWLEDGE — agent/skill/command anti-pattern catalog with fixes. Reference scanned by validate-spec; no sequence.

@nwave-ai@nwave-aiInstall Skill
nw-ab-create-agent

nw-ab-create-agent

PROCEDURE — create a NEW agent via the 5-phase workflow (ANALYZE→DESIGN→CREATE→VALIDATE→REFINE). Trigger: build a new AI agent.…

@nwave-ai@nwave-aiInstall Skill
nw-ab-examples

nw-ab-examples

KNOWLEDGE — canonical worked examples for agent creation, migration, and command optimization. Reference for the relevant…

@nwave-ai@nwave-aiInstall Skill
nw-ab-house-style

nw-ab-house-style

KNOWLEDGE — caveman-native authoring house style + by-construction guarantees (Reasoning Mandate injection, measured-gain…

@nwave-ai@nwave-aiInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about nw-test-optimization-paradigm-match.

Which coding agents can use nw-test-optimization-paradigm-match?
nw-test-optimization-paradigm-match 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.