property-based-testing — Claude Code skill: tests and installation
This skill helps create and inspect tests that check rules across generated inputs. Use it for parsers, serialization pairs, data structures, and Solidity contract invariants.
npx skills add trailofbits/skills --skill property-based-testing -a claude-codeWhat property-based-testing does
The skill helps choose meaningful claims about code, such as whether a conversion can be reversed or a normalization step stays stable when repeated. It can draft tests, assess an existing suite, and investigate a failure to distinguish a flawed claim from a defect in the code.
It covers Hypothesis, fast-check, proptest, jqwik, and rapid, plus Echidna and Medusa for Solidity invariants. Its supporting guides address generators, test review, failure analysis, library selection, and code changes that expose a testable property.
For a project without a property-testing library, adding that dependency remains the user's call; the skill suggests a test rather than installing a library. It is not aimed at binary fuzzing, mutation testing, static analysis, benchmarks, or end-to-end UI checks.
What it helps with
- Test that encoding can be reversed by decoding
- Define useful claims for a parser or normalizer
- Spot vacuous or self-confirming test assertions
- Determine whether a shrunk counterexample reveals a bug
- Check state invariants in Solidity contracts
Example prompts for the agent
- Write property-based tests for the encode and decode pair.
- Review the
@giventests and find assertions that cannot catch a bug. - Inspect this failing test's counterexample and decide whether its property is sound.
How to install property-based-testing
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill property-based-testing -a claude-code2Manually: put the files in place
~/.claude/skills/property-based-testing/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/property-based-testing/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill property-based-testing -a codex2Manually: put the files in place
.agents/skills/property-based-testing/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill property-based-testing -a cursor2Manually: put the files in place
.cursor/skills/property-based-testing/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install trailofbits/skills property-based-testing2Manually: put the files in place
.github/skills/property-based-testing/SKILL.md1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill property-based-testing -a gemini-cli2Platform CLI
gemini skills install https://github.com/trailofbits/skills --path plugins/property-based-testing/skills/property-based-testingManually: put the files in place
.devin/skills/property-based-testing/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add trailofbits/skills --skill property-based-testing -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about property-based-testing
How do I install property-based-testing in Claude Code?
Run npx skills add trailofbits/skills --skill property-based-testing -a claude-code. The skill file is at ~/.claude/skills/property-based-testing/SKILL.md.
What does property-based-testing do?
It helps build and review tests that check defined rules against generated inputs. It also guides analysis of failed tests.
Will the skill add a testing library to my project?
No. If the project does not already use a property-testing library, the user decides whether to add that dependency.