agentleFS
minikinminikin/keeler/skills/property-testing/SKILL.md

property-testing

Skill4 starsChanged 2 months agoMITView on GitHub

Catalog of property-test invariants and proptest patterns for Rust. Use when writing tests during /keeler:tdd or strengthening tests after /keeler:mutants — whenever code has an invariant worth pinning (round-trips, ordering, idempotence, bounds, merging) or a surviving mutant points at a general gap rather than a missing example.

5 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. nyxandro/property-testing-skill★ 4same name
    2. adam-paterson/skills★ 1same name
    3. DROOdotFOO/agent-skills★ 1same name
    4. clnnn/playbook★ 0same name
    5. lengrufeng2008/dsh-skill-library★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When proptest finds a failure it writes a seed file under proptest-regressions/ — commit it.

    line 50

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Property-Testing Patterns

A property test doesn't check one example — it states a law and lets randomness hunt for a counterexample. When a mutant survives, ask first: "is there a law this mutant breaks?" — one strengthened property usually kills a whole family of mutants that example tests would need one-by-one.

Invariant catalog

Scan the code for these shapes; each maps to a ready-made property:

Shape in the codeLaw to pin
Parse + Display pairRound-trip: parse(display(x)) == x
Normalization / canonicalizationIdempotence: f(f(x)) == f(x)
Sort / merge / dedupShape: output sorted, no overlaps/duplicates (check windows(2))
Aggregation (len, sum, count)Consistency: len() == iter().count(); total equals sum of parts
Membership + constructionCross-check: contains(p) ⇔ some input covers p
Saturating / clamping arithmeticBounds: result within [min, max] for any input
Order-insensitive operationsPermutation: shuffling input doesn't change output
Two implementations (fast + naive)Oracle: fast(x) == naive(x) for all x

Proptest mechanics

mod properties {
    use super::*;
    use proptest::prelude::*;

    proptest! {
        #[test]
        fn round_trips(pairs in prop::collection::vec((1u16..=65535, 1u16..=65535), 1..10)) {
            // build input from generated pairs, then assert the law
        }
    }
}
  • Generate the input the user could type, not the internal representation — the parser is part of what's under test.
  • Constrain strategies to valid domain (e.g. 1u16..=65535), and write a separate property for invalid input if rejection is a law too.
  • prop_assert!/prop_assert_eq! (not assert!) — they report the minimal counterexample after shrinking.
  • When proptest finds a failure it writes a seed file under proptest-regressions/ — commit it; it pins the counterexample forever.
  • Boundary traps love u16/u32 edges: always let strategies reach the extremes (=65535, u64::MAX) — off-by-one mutants live there.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.