/property-based-testing:property-based-testing [function | package | test file | failure output]from property-based-testing
Turns code with an algebraic shape (codecs, parsers, normalizers, validators, collections, numeric functions) into property tests in Go (native fuzz or rapid), Python (Hypothesis) or TypeScript (fast-check), audits property suites for tests that prove nothing, and sorts a shrunk counterexample into bug, wrong property, ambiguous spec or strategy artifact. Use when asked to cover a whole input space, add or audit property tests or classify a shrunk failure. Not for mutation campaigns or kill rate — use mutation-testing:mutation-testing; not for plain Go unit tests — use golang:test.
Ships in property-based-testing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Target: $ARGUMENTS
An example test checks one point. A property test states a rule and lets the library hunt for an input that breaks it, then shrinks that input to the smallest one that still breaks it. That pays off only when the code has a rule worth stating. This skill does three jobs: write property tests, review a suite that already exists, triage a shrunk failure. Pick the job from the request; a path to a test file means review, pasted failure output means triage.
| Request | Where it belongs |
|---|---|
| benchmarks, allocation counts | not a property test; answer directly |
| end-to-end or integration tests | not this skill |
| mutation campaign, surviving mutants, kill rate | mutation-testing:mutation-testing |
| line coverage | not a property test; answer directly |
| plain Go unit or table tests | golang:test |
| Language | Default | Notes |
|---|---|---|
| Go | native fuzz test (testing.F) | pgregory.net/rapid when go.mod already requires it |
| Python | Hypothesis | |
| TypeScript, JavaScript | fast-check |
Python or TypeScript without Hypothesis or fast-check: run the dependency gate; without a yes, write a seeded loop over pinned edge values and random draws from the standard library, and say it shrinks nothing. Other languages and libraries: use whichever the repo already imports, and say that the detail below was written for the three above. references/libraries.md has the idioms, settings and a skeleton for each.
Detect before writing. Search imports and manifests: rg -n 'hypothesis|fast-check|pgregory.net/rapid|func Fuzz'
over source plus the manifests (go.mod, requirements*.txt, pyproject.toml, package.json).
Read the manifest, then decide.
assume/t.Skip for a relation between values
that were already drawn; filtering after generation burns the budget and ends in a health
check failure.f(x) == f(x)) counts only where the output could really vary:
map or set serialization, hashing, iteration order, the clock.go test, then a time-boxed fuzz run, with the exact
invocation in references/libraries.md. Python and
TypeScript: the project's own runner.@given(, from hypothesis import, fc.assert, fc.property,
func Fuzz, rapid.Check.Ground the property before believing the failure. Authority, strongest first: an external spec or RFC, type annotations, the docstring or doc comment, existing tests, the function name. Then classify with the table in references/review-and-triage.md:
Precondition violations and documented undefined behaviour are never bugs.
Applies when the repo has no property library and the strongest approach needs one.
go.mod, go.sum, requirements*.txt, pyproject.toml or
package.json, and never run go get, go mod tidy, pip install or npm install.go test and go vet are pre-approved. Never pass -exec, -toolexec, -overlay, -o,
-c, -vettool, -mod=mod, -modfile, -coverprofile, -cpuprofile, -memprofile,
-blockprofile, -mutexprofile, -trace, -outputdir or -fuzzcachedir; they run other
programs, rewrite go.mod or write files outside the test files.python3 -m pytest, with no -p and no --basetemp. It is not
pre-approved (conftest.py and plugins run arbitrary code), so each run asks first; so do other
runners (pytest, npm test).rg is pre-approved: never pass --pre, which runs a command on every file.git grep is not pre-approved and asks first; never pass -O or --open-files-in-pager.<unit>_prop_test.go; keep it a _test.go file so plain go test replays seeds
and the saved testdata/fuzz/ corpus.What SKILL.md sets; muted values are Claude Code's defaults
lowOther plugins' skills for the same job
npx claudepluginhub flyoverhead/devops-plugins --plugin property-based-testing