# Property based testing

> Property based testing is an open-source agent skill for developer tools. Lets your agent write, review and debug property-based tests across languages. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/trailofbits/skills/tree/main/plugins/property-based-testing/skills/property-based-testing
- **Repository:** https://github.com/trailofbits/skills
- **GitHub stars:** 8,553
- **License:** CC-BY-SA-4.0
- **Skill name:** property-based-testing
- **Collection:** https://github.com/trailofbits/skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-30

## About

This skill guides an agent through property-based testing, where a rule is asserted over a whole input domain and a generator searches for counterexamples instead of checking a fixed list of examples. It covers choosing properties such as roundtrips, inverses, oracles, idempotence and invariants, and ranks them so the agent aims for the strongest property the code supports.

The guidance also covers the common ways property tests end up checking nothing, including tautological assertions that restate the implementation and vacuous assume() filters, and it steers the agent toward putting constraints into strategies. When code has no clear property yet, the skill suggests refactorings that expose one, such as extracting a pure core or returning values instead of mutating state. It also helps triage a failing property by separating a wrong property from a genuine bug.

The skill ships reference files for generator design, reviewing existing suites, interpreting failures and selecting libraries, including Echidna and Medusa for Solidity invariants. It has no scripts. Work is done in the project's own test framework, and the skill asks before adding a new PBT dependency to a project that lacks one.

## When your agent uses it

> Writes, reviews, and debugs property-based tests — Hypothesis, fast-check, proptest, jqwik, rapid, and Echidna or Medusa for Solidity invariants. Use whenever tests should cover a whole input domain instead of a hand-picked list of examples: encode/decode and serialize/deserialize pairs, parsers, canonicalizers and normalizers, validators, numeric and Decimal types, comparators and sort order, data structures, and smart-contract state invariants. Also use when adding cases to an existing @given, fast-check, or proptest suite, when judging whether existing property tests assert anything real, and when a generator has shrunk a counterexample and you need to tell a wrong property from a genuine bug. Not for coverage-guided binary fuzzing (libFuzzer, AFL), mutation-testing campaigns, static analysis, benchmarking, or end-to-end UI tests.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/trailofbits/skills/tree/HEAD/plugins/property-based-testing/skills/property-based-testing)
- [License: CC-BY-SA-4.0](https://github.com/trailofbits/skills/tree/HEAD/plugins/property-based-testing/skills/property-based-testing)

## Features

- **Property selection guidance:** Helps choose roundtrip, inverse, oracle, idempotence or invariant properties that fit the code under test.
- **Test quality review:** Flags tautological assertions and vacuous assume() filters in existing property tests.
- **Strategy design:** Pushes input constraints into generators so tests produce valid inputs directly rather than filtering them.
- **Refactoring for testability:** Suggests rearrangements, such as extracting a pure core, that expose a property in impure code.
- **Failure triage:** Separates a wrong property from an ambiguous specification or a real bug after a counterexample shrinks.
- **Smart contract invariants:** Covers Echidna and Medusa for asserting state invariants in Solidity contracts.

## Good for

- Write property tests for an encode and decode pair
- Review whether existing Hypothesis tests assert anything meaningful
- Turn a hand-picked example suite into a property-based one
- Work out whether a shrunk counterexample is a bug or a wrong property
- Write Echidna invariants for a Solidity contract's state

## Install

### Claude Code

This skill ships in the `property-based-testing` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add trailofbits/skills
/plugin install property-based-testing@trailofbits
```

Or copy only this skill to `~/.claude/skills/property-based-testing`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/trailofbits/skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/property-based-testing &&
cp -R "$tmp/plugins/property-based-testing/skills/property-based-testing" ~/.claude/skills/property-based-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/property-based-testing` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/property-based-testing` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/trailofbits/skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/property-based-testing &&
cp -R "$tmp/plugins/property-based-testing/skills/property-based-testing" ~/.agents/skills/property-based-testing &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/property-based-testing` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/property-based-testing` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/trailofbits/skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/property-based-testing &&
cp -R "$tmp/plugins/property-based-testing/skills/property-based-testing" ~/.cursor/skills/property-based-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/property-based-testing` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/trailofbits/skills.git --path plugins/property-based-testing/skills/property-based-testing
```

Or copy the folder to `~/.gemini/skills/property-based-testing` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/property-based-testing`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/trailofbits/skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/property-based-testing &&
cp -R "$tmp/plugins/property-based-testing/skills/property-based-testing" ~/.copilot/skills/property-based-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/property-based-testing` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/trailofbits/skills.git
```

Then copy `skills/plugins/property-based-testing/skills/property-based-testing` into your agent's skills folder as `property-based-testing`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need from my project?

It works with the project's own test framework and does not require a new dependency. If the project lacks a PBT library, the skill offers to add one and leaves the decision to you.

### Which libraries does Property based testing cover?

Hypothesis, fast-check, proptest, jqwik, rapid, and Echidna or Medusa for Solidity invariants.

### When does Property based testing trigger?

When tests should cover a whole input domain, when adding cases to an existing property suite, when judging existing property tests, or when a generator has shrunk a counterexample.

### Does Property based testing cover coverage-guided fuzzing?

No. Binary fuzzing with libFuzzer or AFL, mutation testing, static analysis, benchmarking and end-to-end UI tests are out of scope.

### How do I install Property based testing in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/property-based-testing to use it in all your projects, or to .claude/skills/property-based-testing in one project. Or install the property-based-testing plugin, which includes it: /plugin marketplace add trailofbits/skills, then /plugin install property-based-testing@trailofbits.

### Does Property based testing run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Property based testing?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Property based testing?

The closest alternatives to Property based testing are Principle test behavior not implementation, Testing strategy, TDD, Create formal verification skill and Unittest skill.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Principle test behavior not implementation](https://ai-powered.com/skills/principle-test-behavior-not-implementation): Principle test behavior not implementation is an open-source agent skill for developer tools.
- [Testing strategy](https://ai-powered.com/skills/testing-strategy): Testing strategy is an open-source agent skill for developer tools.
- [TDD](https://ai-powered.com/skills/tdd): TDD is an open-source agent skill for developer tools.
- [Create formal verification skill](https://ai-powered.com/skills/create-formal-verification-skill): Create formal verification skill is an open-source agent skill for developer tools.
- [Unittest skill](https://ai-powered.com/skills/unittest-skill): Unittest skill is an open-source agent skill for developer tools.
- [Xunit skill](https://ai-powered.com/skills/xunit-skill): Xunit skill is an open-source agent skill for developer tools.
- [Testunit skill](https://ai-powered.com/skills/testunit-skill): Testunit skill is an open-source agent skill for developer tools.
- [Pytest skill](https://ai-powered.com/skills/pytest-skill): Pytest skill is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/property-based-testing
