property-based-testing
Provides guidance for property-based testing across multiple languages and smart contracts. Use when writing tests, reviewing code with serialization/validation/parsing patterns, designing features, or when property-based testing would provide stronger coverage than example-based tests.
npx skills add trailofbits/skills --skill property-based-testing --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Property-Based Testing Guide Use this skill proactively during development when you encounter patterns where PBT provides stronger coverage than example-based tests. ## When to Invoke (Automatic Detection) **Invoke this skill when you detect:** - **Serialization pairs**: `encode`/`decode`, `serialize`/`deserialize`, `toJSON`/`fromJSON`, `pack`/`unpack` - **Parsers**: URL parsing, config parsing, protocol parsing, string-to-structured-data - **Normalization**: `normalize`, `sanitize`, `clean`, `canonicalize`, `format` - **Validators**: `is_valid`, `validate`, `check_*` (especially with normalizers) - **Data structures**: Custom collections with `add`/`remove`/`get` operations - **Mathematical/algorithmic**: Pure functions, sorting, ordering, comparators - **Smart contracts**: Solidity/Vyper contracts, token operations, state invariants, access control **Priority by pattern:** | Pattern | Property | Priority | |---------|----------|----------| | encode/decode pair | Roundtrip | HIGH | | Pure function | Multiple | HIGH | | Validator | Valid after normalize | MEDIUM | | Sorting/ordering | Idempotence + ordering | MEDIUM | | Normalization | Idempotence | MEDIUM | | Builder/factory | O
- When to Invoke (Automatic Detection)
- When NOT to Use
- Property Catalog (Quick Reference)
- Decision Tree
- How to Suggest PBT
- When NOT to Use PBT
- Red Flags
- Rationalizations to Reject
What does the property-based-testing skill do?
Provides guidance for property-based testing across multiple languages and smart contracts. Use when writing tests, reviewing code with serialization/validation/parsing patterns, designing features, or when property-based testing would provide stronger coverage than example-based tests.
How do I install it?
Run `npx skills add trailofbits/skills --skill property-based-testing --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From trailofbits/skills, a repository with 6,426 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
