property-based-testing

property-based-testing is a skill for Claude Code from KunanonJ/ai-skills-hub. It costs 67 tokens per session (4,852 once invoked), scanned A, a copy of property-based-testing, MIT.

A guide to property-based testing, where software creates many varied test inputs automatically instead of checking only hand-picked examples. It uses fast-check for TypeScript and JavaScript and Hypothesis for Python.

In plain words
What is it for?
Use it to test parsers, encoders, data transformations, API rules, mathematical behavior, and other code with properties that should always remain true.
Why use it?
It helps uncover unusual inputs and edge cases that people may not think to write tests for. When a test fails, it can reduce the failure to a smaller example that is easier to understand.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the TodoWrite tool; installed under .agents/ (shared by several agents).

Good fit Use it to test parsers, encoders, data transformations, API rules, mathematical behavior, and other code with properties that should always remain true.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kunanonj/ai-skills-hub/property-based-testing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add KunanonJ/ai-skills-hub --skill property-based-testing
Clone the repo
git clone --depth 1 https://github.com/KunanonJ/ai-skills-hub

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for property-based-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/kunanonj/ai-skills-hub/property-based-testing/github.svg)](https://agentmods.dev/skills/kunanonj/ai-skills-hub/property-based-testing)
Your own site
<a href="https://agentmods.dev/skills/kunanonj/ai-skills-hub/property-based-testing"><img src="https://agentmods.dev/badge/skills/kunanonj/ai-skills-hub/property-based-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for property-based-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/kunanonj/ai-skills-hub/property-based-testing"><img src="https://agentmods.dev/badge/skills/kunanonj/ai-skills-hub/property-based-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,852 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00067 $0.04852
Opus 5 $0.00034 $0.02426
Sonnet 5 $0.00013 $0.00970
Haiku 4.5 $0.00007 $0.00485

Measured 8d ago against content hash 5cfca7ca913e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

property-based-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to property-based-testing — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/property-based-testing/SKILL.md · 823 lines

How it starts

The opening of the file, as written. The whole thing — 823 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Property-Based Testing

Expert knowledge for property-based testing - automatically generating test cases to verify code properties rather than testing specific examples.

Core Expertise

Property-Based Testing Concept

  • Traditional testing: Test specific examples
  • Property-based testing: Test properties that should hold for all inputs
  • Generators: Automatically create diverse test inputs
  • Shrinking: Minimize failing cases to simplest example
  • Coverage: Explore edge cases humans might miss

When to Use Property-Based Testing

  • Mathematical operations (commutative, associative properties)
  • Encoders/decoders (roundtrip properties)
  • Parsers and serializers
  • Data transformations
  • API contracts
  • Invariants and constraints

TypeScript/JavaScript (fast-check)

Installation

# Using Bun
bun add -d fast-check

# Using npm
npm install -D fast-check

Basic Example

import { test } from 'vitest'
import * as fc from 'fast-check'

// Traditional example-based test
test('reverse twice returns original', () => {
  expect(reverse(reverse([1, 2, 3]))).toEqual([1, 2, 3])
})

// Property-based test
test('reverse twice returns original - property based', () => {
  fc.assert(
    fc.property(
      fc.array(fc.integer()), // Generate random arrays of integers
      (arr) => {
        expect(reverse(reverse(arr))).toEqual(arr)
      }
    )
  )
})
// fast-check automatically generates 100s of test cases!

Built-in Generators

import * as fc from 'fast-check'

// Numbers
fc.integer()                          // Any integer
fc.integer({ min: 0, max: 100 })      // Range
fc.nat()                              // Natural numbers (≥ 0)
fc.float()                            // Floating-point
fc.double()                           // Double precision

// Strings
fc.string()                           // Any string
fc.string({ minLength: 1, maxLength: 10 })
fc.hexaString()                       // Hex strings
fc.asciiString()                      // ASCII only
fc.unicodeString()                    // Unicode
fc.emailAddress()                     // Email format

// Arrays and Objects
fc.array(fc.integer())                // Array of integers
fc.array(fc.string(), { minLength: 1, maxLength: 5 })
fc.set(fc.integer())                  // Unique values
fc.record({                           // Objects
  name: fc.string(),
  age: fc.nat(),
})

// Booleans and Constants
fc.boolean()
fc.constant('value')
fc.constantFrom('a', 'b', 'c')        // Pick from options

// Dates
fc.date()
fc.date({ min: new Date('2020-01-01') })

// Complex Types
fc.tuple(fc.string(), fc.integer())   // Fixed-size tuple
fc.oneof(fc.string(), fc.integer())   // Union type
fc.option(fc.string())                // string | null

Read the full file on GitHub · 823 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 823 lines · 67 tokens per session scan A 5cfca7ca913e

Subscribe to this mod's changes

property-based-testing is a skill published in the GitHub repository KunanonJ/ai-skills-hub (5 stars, last pushed yesterday), licensed MIT. It adds 67 tokens to every session and 4,852 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to property-based-testing, differing in 0 lines, and is treated as a copy.