rust-proptest

Design property-based tests for Rust using hegel generators and shrinking.

Updated Feb 27, 2026
One-click install
npx skills add https://github.com/cfcosta/duskpi --skill rust-proptest
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-proptest
Source: https://github.com/cfcosta/duskpi/tree/main/skills/rust-proptest
Command: npx skills add https://github.com/cfcosta/duskpi --skill rust-proptest

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enables teams to design and implement robust property-based tests for Rust projects, using generators, shrinking, and server-backed execution to ensure deterministic and reproducible test suites.

Core Features & Use Cases

  • Property-based testing guidance: craft meaningful laws, invariants, and metamorphic relations for Rust code.
  • Generator composition and shrinking: design inputs that are valid by construction and shrink toward semantic simplicity.
  • Model-based and differential testing patterns: compare SUT against reference implementations or models to surface real defects.
  • Deterministic CI workflows: enable reproducible test runs with deterministic seeds and server-backed test execution for CI.

Quick Start

Provide a minimal Rust crate and enable property-based tests with hegel to generate inputs and verify invariants.

Frequently Asked Questions about rust-proptest

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write property-based tests in Rust using generators and shrinking?

Property-based tests in Rust use generators to create inputs and shrinking to reduce counterexamples. This Skill guides you through crafting invariants, composing valid generators, and shrinking failures toward semantic simplicity using the hegel framework.

What is model-based testing and how does it apply to Rust property tests?

Model-based testing in Rust compares your system under test against a reference implementation or model to surface defects. This Skill provides patterns for defining meaningful laws and metamorphic relations to verify your code against expected behaviors.

How do I set up deterministic property testing for Rust CI workflows?

Deterministic property testing for Rust CI uses fixed seeds and server-backed test execution to ensure reproducible runs. This Skill helps configure deterministic test suites using hegeltest 0.4.x, Rust 2024 edition, and the uv runtime.

Does property testing in Rust work with the hegel framework and uv runtime?

Property testing in Rust works with the hegel framework and uv runtime, requiring hegeltest 0.4.x and Rust 2024 edition. It supports #[hegel::test], DefaultGenerator derive, and composite generators for input generation and shrinking.

How do I shrink counterexamples in Rust property tests to find the minimal failing input?

Shrinking counterexamples in Rust property tests reduces generated inputs toward semantic simplicity to isolate the exact failure. This Skill guides you through designing generators that shrink effectively using the hegel framework's built-in shrinking capabilities.

Can I use composite generators to create valid-by-construction inputs for Rust property tests?

Composite generators in Rust property tests create inputs that are valid by construction, preventing false failures from invalid data. This Skill shows how to use DefaultGenerator derive and compose generators using the hegel framework.