Agent skill

Fuzzing Patterns

by ccashwell in ccashwell/evm-cortex

A skill your agent uses when writing fuzz tests for Solidity contracts.

MITAuto-check passedSecurity

Install Fuzzing Patterns

skills CLI
$ npx skills add ccashwell/evm-cortex --skill fuzzing-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ccashwell/evm-cortex fuzzing-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/fuzzing-patterns .claude/skills/fuzzing-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
fuzzing-patterns
GitHub stars
131
Token cost
~1.6k tokens
SKILL.md length
201 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when writing fuzz tests for Solidity contracts.

  • Works in 5 steps: Copy the failing args into a concrete test → Add console2.log() to trace execution → Check if it's a real bug or a test… → …
  • Writing fuzz tests for Solidity contracts
  • SKILL.md covers Stateless vs Stateful Fuzzing, Basic Fuzz Test, Input Constraining and Fuzz Configuration, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Fuzzing Patterns is an agent skill from ccashwell/evm-cortex. Use when writing fuzz tests for Solidity contracts. Covers property-based testing, input constraining with vm.assume/vm.bound, stateful vs stateless fuzzing, configuring runs, seed corpus, and interpreting counterexamples.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Security, covering Fuzzing and Smart contracts. It works with Solidity. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Writing fuzz tests for Solidity contracts
  • Tasks that involve Fuzzing
  • Tasks that involve Smart contracts

Example prompts

  • “/fuzzing-patterns”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Copy the failing args into a concrete test
  2. Add console2.log() to trace execution
  3. Check if it's a real bug or a test constraint issue
  4. If real: fix the bug, keep the counterexample as a regression test
  5. If false positive: tighten bound() constraints

What it can do on your machine

Read from SKILL.md and the folder at commit f8f3301. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are solidity and toml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Fuzzing Patterns loads about 1.6k tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 201 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ccashwell/evm-cortex at commit f8f3301, republished under its MIT licence (© ccashwell). 201 words, ~1,609 tokens.

Download SKILL.mdSave it as .claude/skills/fuzzing-patterns/SKILL.md (or your agent's skills folder).
name
fuzzing-patterns
description
Use when writing fuzz tests for Solidity contracts. Covers property-based testing, input constraining with vm.assume/vm.bound, stateful vs stateless fuzzing, configuring runs, seed corpus, and interpreting counterexamples.

Fuzz Testing Patterns

Stateless vs Stateful Fuzzing

TypeHow It WorksUse Case
StatelessRandom inputs per test, fresh state each runIndividual function properties
StatefulRandom sequences of calls, accumulated stateSystem-level invariants

Stateless = function testFuzz_*(uint256 x) — Foundry randomizes x each run. Stateful = invariant tests with handlers (see invariant-testing skill).

Basic Fuzz Test

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {Test} from "forge-std/Test.sol";
import {Vault} from "../src/Vault.sol";

contract VaultFuzzTest is Test {
    Vault vault;

    function setUp() public {
        vault = new Vault(address(token));
        deal(address(token), address(this), type(uint128).max);
        token.approve(address(vault), type(uint256).max);
    }

    // Property: deposit then redeem never yields more than deposited
    function testFuzz_depositRedeemNoProfit(uint256 assets) public {
        assets = bound(assets, 1, type(uint128).max);

        uint256 shares = vault.deposit(assets, address(this));
        uint256 received = vault.redeem(shares, address(this), address(this));

        assertLe(received, assets, "profit from round-trip");
    }

    // Property: transfer preserves total supply
    function testFuzz_transferPreservesSupply(
        address to,
        uint256 mintAmount,
        uint256 transferAmount
    ) public {
        vm.assume(to != address(0) && to != address(this));
        mintAmount = bound(mintAmount, 1, type(uint128).max);
        transferAmount = bound(transferAmount, 0, mintAmount);

        vault.deposit(mintAmount, address(this));
        uint256 supplyBefore = vault.totalSupply();

        vault.transfer(to, transferAmount);
        uint256 supplyAfter = vault.totalSupply();

        assertEq(supplyBefore, supplyAfter, "supply changed on transfer");
    }
}

Input Constraining

bound() vs vm.assume()
solidity
// PREFER bound() — maps input to valid range without discarding runs
function testFuzz_bounded(uint256 x) public {
    x = bound(x, 1e18, 1_000_000e18);
    // x is always in [1e18, 1_000_000e18]
}

// AVOID vm.assume() for wide ranges — discards too many inputs
function testFuzz_assumed(uint256 x) public {
    vm.assume(x > 0 && x < 1000); // 99.99% of inputs discarded!
    // Only use for conditions that are hard to express with bound()
}
When to Use vm.assume()
solidity
// Valid: exclude specific addresses
function testFuzz_transfer(address to, uint256 amount) public {
    vm.assume(to != address(0));
    vm.assume(to != address(vault));
    vm.assume(to.code.length == 0); // no contracts
    amount = bound(amount, 1, balanceOf(address(this)));
    // ...
}

Fuzz Configuration

In foundry.toml:

toml
[fuzz]
runs = 1000            # number of random inputs per test (default: 256)
max_test_rejects = 65536  # max vm.assume rejections before fail
seed = "0x1234"        # fixed seed for reproducibility
dictionary_weight = 40  # % of inputs from extracted constants

[invariant]
runs = 256
depth = 64
fail_on_revert = false

Property Categories

Algebraic Properties
solidity
// Commutativity: f(a, b) == f(b, a)
function testFuzz_addCommutative(uint256 a, uint256 b) public {
    assertEq(target.add(a, b), target.add(b, a));
}

// Associativity: f(f(a, b), c) == f(a, f(b, c))
// Identity: f(a, 0) == a
// Idempotency: f(f(a)) == f(a)
Roundtrip Properties
solidity
// encode then decode returns original
function testFuzz_encodeDecodeRoundtrip(uint256 value) public {
    bytes memory encoded = target.encode(value);
    uint256 decoded = target.decode(encoded);
    assertEq(decoded, value);
}

// deposit then withdraw returns (approximately) original
function testFuzz_depositWithdrawRoundtrip(uint256 amount) public {
    amount = bound(amount, 1e18, 1_000_000e18);
    uint256 shares = vault.deposit(amount, address(this));
    uint256 returned = vault.redeem(shares, address(this), address(this));
    assertApproxEqAbs(returned, amount, 1); // within 1 wei
}
Monotonicity Properties
solidity
// More input -> more output (or equal)
function testFuzz_depositMonotonic(uint256 a, uint256 b) public {
    a = bound(a, 1e18, 1_000_000e18);
    b = bound(b, a, 1_000_000e18); // b >= a

    uint256 sharesA = vault.previewDeposit(a);
    uint256 sharesB = vault.previewDeposit(b);
    assertGe(sharesB, sharesA, "more deposit should give more shares");
}
Boundary Properties
solidity
// No overflow at max values
function testFuzz_noOverflow(uint256 a, uint256 b) public {
    a = bound(a, 0, type(uint128).max);
    b = bound(b, 0, type(uint128).max);
    // Should not revert with overflow
    target.safeMultiply(a, b);
}

Interpreting Counterexamples

When a fuzz test fails, Foundry shows the failing input:

[FAIL. Reason: profit from round-trip]
    Counterexample: calldata=0x..., args=[115792089237316195423570985008687907853269984665640564039457584007913129639935]

Steps:

  1. Copy the failing args into a concrete test
  2. Add console2.log() to trace execution
  3. Check if it's a real bug or a test constraint issue
  4. If real: fix the bug, keep the counterexample as a regression test
  5. If false positive: tighten bound() constraints
solidity
// Regression test from fuzzer counterexample
function test_regression_overflowOnMaxDeposit() public {
    uint256 amount = type(uint256).max;
    vm.expectRevert();
    vault.deposit(amount, address(this));
}

Checklist

  • Use bound() over vm.assume() to minimize discarded runs
  • Properties categorized: algebraic, roundtrip, monotonicity, boundary
  • Fuzz runs set to 1000+ for CI, 256 for local development
  • Counterexamples from failures preserved as regression tests
  • Fixed seed used for reproducible CI results
  • Separate fuzz tests from unit tests (naming convention testFuzz_)
  • Edge values tested explicitly alongside fuzzing (0, 1, max)
  • Properties verified against known-correct reference implementation

© ccashwell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/fuzzing-patterns of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Fuzzing Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Fuzzing Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Fuzzing Patterns this skillccashwell/evm-cortex131—~1.6kAutomated safety check: PassMIT
Fizzpashov/skills1.2k2 repos~11kAutomated safety check: PassMIT
Stateful Invariant Testingaviggiano/security144—~2.8kAutomated safety check: PassMIT
Property Based Testingtrailofbits/skills7.4k—~1.1kAutomated safety check: PassCC-BY-SA-4.0
Fizz Convertpashov/skills1.2k2 repos~3.7kAutomated safety check: PassMIT
Fuzz Generatoralt-research2/SolidityGuard104—~763Automated safety check: NotesCustom licence

Similar skills

  • Fizz

    pashov/skills

    Generate Echidna/Medusa-compatible Solidity fuzz suites from Foundry or Hardhat projects.

    1.2k GitHub starsUsed in 2 repos~11k tokens
    SecurityAuto-check passed
  • Stateful Invariant Testing

    aviggiano/security

    Build metric-driven Chimera/create-chimera-app stateful invariant testing campaigns for Solidity projects.

    144 GitHub stars~2.8k tokensUpdated 21 days ago
    SecurityAuto-check passed
  • Property Based Testing

    trailofbits/skills

    Official

    Writes, reviews, and debugs property-based tests — Hypothesis, fast-check, proptest, jqwik, rapid, and Echidna or Medusa for Solidity invariants.

    7.4k GitHub stars~1.1k tokensUpdated 5 days ago
    SecurityAuto-check passed
  • Fizz Convert

    pashov/skills

    Convert English-language properties in PROPERTIES.md (produced by the Fizz skill) into Solidity assertions inside the existing fuzz harness, then flip their checkboxes.

    1.2k GitHub starsUsed in 2 repos~3.7k tokens
    Backend & APIsAuto-check passed
  • Fuzz Generator

    alt-research2/SolidityGuard

    Generates Foundry invariant tests and Echidna property-based fuzz tests for Solidity contracts.

    104 GitHub stars~763 tokensUpdated 3 mo ago
    Backend & APIsAuto-check: notes
  • Flounder

    adshao/flounder

    Operates Flounder, an autonomous white-hat security auditor.

    517 GitHub stars~9.2k tokensUpdated yesterday
    SecurityAuto-check passed

More from ccashwell/evm-cortex

All 89 skills in this repo
  • Xray Pre Audit

    ccashwell/evm-cortex

    A skill your agent uses when preparing for a security audit, performing reconnaissance on a new codebase, or creating a protocol overview.

    131 GitHub stars~25k tokensUpdated 7 days ago
    Auto-check passed
  • Aave Integration

    ccashwell/evm-cortex

    A skill your agent uses when integrating with Aave V3 for lending, borrowing, flash loans, or building on top of Aave markets.

    131 GitHub stars~1.3k tokensUpdated 7 days ago
    Auto-check passed
  • Access Control Patterns

    ccashwell/evm-cortex

    Access control design patterns for Solidity protocols. An agent skill from ccashwell/evm-cortex.

    131 GitHub stars~1.8k tokensUpdated 7 days ago
    Auto-check passed
  • Anvil Patterns

    ccashwell/evm-cortex

    A skill your agent uses when running a local Ethereum node with Anvil.

    131 GitHub stars~1.3k tokensUpdated 7 days ago
    Auto-check passed
  • Audit Breadth Scan

    ccashwell/evm-cortex

    A skill your agent uses when performing systematic breadth-first review of all contracts during a security audit.

    131 GitHub stars~1.4k tokensUpdated 7 days ago
    Auto-check passed
  • Audit Depth Analysis

    ccashwell/evm-cortex

    A skill your agent uses when performing deep analysis of specific findings or high-risk areas during a security audit.

    131 GitHub stars~1.6k tokensUpdated 7 days ago
    Auto-check passed

Works with

Categories

Questions about Fuzzing Patterns

What does Fuzzing Patterns do?

A skill your agent uses when writing fuzz tests for Solidity contracts. Fuzzing Patterns is an agent skill from ccashwell/evm-cortex. Use when writing fuzz tests for Solidity contracts.

When should I use Fuzzing Patterns?

Fuzzing Patterns fits situations like: writing fuzz tests for Solidity contracts; tasks that involve Fuzzing; tasks that involve Smart contracts.

How do I install Fuzzing Patterns in Claude Code?

Run `npx skills add ccashwell/evm-cortex --skill fuzzing-patterns -a claude-code`. Or copy the skill folder (skills/fuzzing-patterns in ccashwell/evm-cortex) into .claude/skills/fuzzing-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Fuzzing Patterns in Codex?

Run `npx skills add ccashwell/evm-cortex --skill fuzzing-patterns -a codex`. Or copy the skill folder (skills/fuzzing-patterns in ccashwell/evm-cortex) into .agents/skills/fuzzing-patterns in your project. Codex loads it when a task matches its description.

Can I use Fuzzing Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ccashwell/evm-cortex --skill fuzzing-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fuzzing-patterns, .gemini/skills/fuzzing-patterns, .github/skills/fuzzing-patterns and .opencode/skills/fuzzing-patterns in your project.

What does Fuzzing Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Fuzzing Patterns is instructions for the agent only.

Does Fuzzing Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Fuzzing Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Fuzzing Patterns use?

Fuzzing Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Fuzzing Patterns use?

About 1.6k tokens (SKILL.md is roughly 6.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Fuzzing Patterns?

Skills that share tags, products or a category with Fuzzing Patterns: Fizz (pashov/skills, 1.2k stars), Stateful Invariant Testing (aviggiano/security, 144 stars), Property Based Testing (trailofbits/skills, 7.4k stars) and Fizz Convert (pashov/skills, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Fuzzing Patterns?

ccashwell (a GitHub user) maintains it in ccashwell/evm-cortex, which has 131 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on September 30, 2026.

Source: ccashwell/evm-cortex on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.