wf-property-test

Generates property-based and metamorphic tests that assert invariants across fabricated inputs.

Updated May 9, 2026
One-click install
npx skills add https://github.com/23min/aiwf --skill wf-property-test-23min
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wf-property-test
Source: https://github.com/23min/aiwf/tree/main/internal/skills/embedded-rituals/plugins/wf-rituals/skills/wf-property-test
Command: npx skills add https://github.com/23min/aiwf --skill wf-property-test-23min

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Example-based tests only check the cases the author already imagined, leaving invariant-bearing code like parsers, ledgers, state machines, and allocators exposed to unthought-of inputs. This Skill turns a crisp English invariant into a generative property test that fabricates many inputs and asserts the property across all of them, producing a real mechanical gate that runs in CI. ## Core Features & Use Cases - Invariant Scoping: Decides whether a unit has a one-sentence crisp invariant before writing any test, redirecting glue, IO, and UI code to example-based TDD instead. - Property Family Selection: Maps invariants to proven shapes — conservation, round-trip, idempotence, order-independence, monotonicity, invariant-preservation, and metamorphic relations. - Framework-Grounded Generation: Uses the language's native property or fuzz framework (Go testing/quick and Fuzz*, Python Hypothesis, JS fast-check, Rust proptest) rather than hand-rolled generators. - Vacuity Self-Check: Requires deliberately breaking the implementation to confirm the property goes red with a shrunk counterexample before declaring done. - Use Case: While implementing a slugify function, generate a Go fuzz test asserting idempotence — Slugify(Slugify(x)) == Slugify(x) — then commit discovered counterexamples as regression seeds under testdata/fuzz/. ## Quick Start Ask the AI to use wf-property-test to write a property-based test for the round-trip invariant of your parser, asserting parse(render(x)) == x over generated inputs.

Frequently Asked Questions about wf-property-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a property-based test instead of example tests?

State the invariant in one sentence, pick its family (round-trip, idempotence, conservation, and so on), then use your language's property framework to generate inputs and assert the invariant. Run it green, then break the implementation to confirm the property goes red with a counterexample.

What property testing framework should I use for Go, Python, or JavaScript?

Use the language's native framework rather than hand-rolling a generator: Go uses testing/quick or native Fuzz* tests, Python uses Hypothesis, JavaScript/TypeScript uses fast-check, Rust uses proptest, and Haskell/Scala use QuickCheck or ScalaCheck.

When should I not use property-based testing?

Avoid property tests on glue, IO, or UI code that has no crisp invariant — forcing one there is high-cost and low-yield. If you cannot state the invariant in one sentence without enumerating cases, use example-based TDD instead.

Does a passing property test prove my code is correct?

No. A property test samples the input space rather than proving the invariant for all inputs — exhaustive proof is what a formal verifier provides. Describe results as checked over generated inputs, not verified.

Why does my property test stay green even when the code is broken?

A property that survives a real bug is vacuous — it asserts nothing, often because the generator is over-constrained to the happy path. Broaden the generator and deliberately break the implementation to confirm the test can fail.