Agent skill

Foundry Differential Tests

by aviggiano in aviggiano/security

Create Foundry differential tests comparing production Solidity contracts against an independent reference model.

MITAuto-check passedBackend & APIs

Install Foundry Differential Tests

skills CLI
$ npx skills add aviggiano/security --skill foundry-differential-tests -a claude-code

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

GitHub CLI
$ gh skill install aviggiano/security foundry-differential-tests --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/aviggiano/security.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/foundry-differential-tests .claude/skills/foundry-differential-tests && 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
foundry-differential-tests
GitHub stars
144
Token cost
~613 tokens
SKILL.md length
275 words
Files
2
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

Create Foundry differential tests comparing production Solidity contracts against an independent reference model.

  • Works in 5 steps: Start with deterministic scenarios that… → Execute the same operation on production… → Compare all relevant public state after… → …
  • Codex needs paired deployments
  • SKILL.md covers Setup, Test Construction, Equality And Tolerance and Failure Handling, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Foundry Differential Tests is an agent skill from aviggiano/security. Create Foundry differential tests comparing production Solidity contracts against an independent reference model. Use when Codex needs paired deployments, paired actions, public-view state comparisons, strict equality checks, and root-cause classification of production/reference divergence.

Its SKILL.md is about 610 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Backend & APIs, covering Deployment, Smart contracts and Root cause analysis. It works with Solidity. The repository describes itself as: Security Reviews and Audit Checklists. The licence is MIT.

When your agent uses it

  • Codex needs paired deployments
  • Public-view state comparisons
  • Strict equality checks
  • Root-cause classification of production/reference divergence

Example prompts

  • “/foundry-differential-tests”

Workflow steps

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

  1. Start with deterministic scenarios that each prove one public semantic.
  2. Execute the same operation on production and reference.
  3. Compare all relevant public state after each step.
  4. Add fuzzing only after deterministic coverage has pinned the behavior.
  5. Keep helpers symmetric: _placeLimitPair, _marketOrderPair, _batchPair, _assert...Pair.

What it can do on your machine

Read from SKILL.md and the folder at commit e18ce7d. 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.

    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

Foundry Differential Tests loads about 613 tokens when it runs. Until then it costs about 80 tokens; SKILL.md has 275 words of instructions outside code blocks.

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

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 aviggiano/security at commit e18ce7d, republished under its MIT licence (© aviggiano). 275 words, ~613 tokens.

Download SKILL.mdSave it as .claude/skills/foundry-differential-tests/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
foundry-differential-tests
description
Create Foundry differential tests comparing production Solidity contracts against an independent reference model. Use when Codex needs paired deployments, paired actions, public-view state comparisons, strict equality checks, and root-cause classification of production/reference divergence.

Foundry Differential Tests

Setup

Deploy production and reference systems side by side. Use shared actor setup, balances, markets, approvals, and configuration. Keep the paired-action helpers in a differential base contract.

Compare public behavior, not internals:

  • return values
  • ERC20/native balances
  • deposited/locked/available balances from view functions
  • public order/market/price-level views
  • public metadata and configuration views

Do not compare internal storage layout, packed ids, or implementation-private traversal state unless the public interface exposes it.

Test Construction

  1. Start with deterministic scenarios that each prove one public semantic.
  2. Execute the same operation on production and reference.
  3. Compare all relevant public state after each step.
  4. Add fuzzing only after deterministic coverage has pinned the behavior.
  5. Keep helpers symmetric: _placeLimitPair, _marketOrderPair, _batchPair, _assert...Pair.

Use typed interfaces for the reference boundary. Raw fallback calldata should only be modeled if the task explicitly includes fallback ABI behavior.

Equality And Tolerance

Default to strict equality. A one-unit mismatch is still a finding. Add tolerance only when the public spec defines tolerance or the user explicitly asks for an approximate property.

Failure Handling

When a differential test fails, classify before fixing:

  • harness defect: the paired setup is invalid or asymmetric
  • reference bug: the independent model does not match public/spec behavior
  • production bug: production diverges from public/spec behavior
  • spec mismatch: the test documents a behavior not satisfied by production and should intentionally remain failing

Fix harness defects and reference bugs when requested. Preserve production/spec failures unless the user explicitly asks to change production code.

Validation

Run focused tests first, then the differential suite. If the fixture has a reference-only switch, also run representative tests against the reference-only deployment to catch reference completeness gaps.

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

Files

SKILL.md and 1 other file in skills/foundry-differential-tests of aviggiano/security.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit e18ce7d

Compare with similar skills

Foundry Differential Tests 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.

Foundry Differential Tests compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Foundry Differential Tests this skillaviggiano/security144—~613Automated safety check: PassMIT
New Configlidofinance/diffyscan142—~1kAutomated safety check: PassMIT
Validate Configlidofinance/diffyscan142—~1.1kAutomated safety check: PassMIT
function Object() { [native code] } Patternsccashwell/evm-cortex131—~1.7kAutomated safety check: PassMIT
Cross Chain Securityccashwell/evm-cortex131—~1.7kAutomated safety check: PassMIT
Test Fixturesccashwell/evm-cortex131—~1.9kAutomated safety check: PassMIT

Similar skills

  • New Config

    lidofinance/diffyscan

    Creates or extends a Diffyscan verification config for a deployed contract or deployment.

    142 GitHub stars~1k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Validate Config

    lidofinance/diffyscan

    Reviews an existing Diffyscan YAML or JSON config for load errors, runtime prerequisites, pinned sources, address mappings and broad exceptions.

    142 GitHub stars~1.1k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Cross Chain Security

    ccashwell/evm-cortex

    Cross-chain security patterns for multi-chain Solidity deployments and bridge interactions.

    131 GitHub stars~1.7k tokensUpdated 10 days ago
    Backend & APIsAuto-check passed
  • Test Fixtures

    ccashwell/evm-cortex

    A skill your agent uses when setting up test environments for Solidity protocols.

    131 GitHub stars~1.9k tokensUpdated 10 days ago
    Backend & APIsAuto-check passed
  • Library Patterns

    ccashwell/evm-cortex

    Library design patterns for reusable Solidity code. An agent skill from ccashwell/evm-cortex.

    131 GitHub stars~1.6k tokensUpdated 10 days ago
    DevelopmentAuto-check passed

More from aviggiano/security

All 10 skills in this repo
  • Foundry Deploy Fixtures

    aviggiano/security

    Create or refactor Foundry deployment fixtures for Solidity tests.

    144 GitHub stars~634 tokensUpdated 24 days ago
    Auto-check passed
  • Foundry Fuzz Mirrors

    aviggiano/security

    Create Foundry fuzz tests from deterministic unit tests. An agent skill from aviggiano/security.

    144 GitHub stars~584 tokensUpdated 24 days ago
    Auto-check passed
  • Foundry Spec Properties

    aviggiano/security

    Turn whitepapers, protocol specs, and public documentation into Foundry property tests.

    144 GitHub stars~489 tokensUpdated 24 days ago
    Auto-check passed
  • Foundry Test Campaign

    aviggiano/security

    Master skill for running an end-to-end multi-pass Foundry testing campaign for Solidity projects.

    144 GitHub stars~1.6k tokensUpdated 24 days ago
    Auto-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 24 days ago
    Auto-check passed
  • Foundry Failure Triage

    aviggiano/security

    Classify failing Foundry fuzz, property, invariant, and differential tests.

    144 GitHub stars~637 tokensUpdated 24 days ago
    Auto-check passed

Works with

Categories

Questions about Foundry Differential Tests

What does Foundry Differential Tests do?

Create Foundry differential tests comparing production Solidity contracts against an independent reference model. Foundry Differential Tests is an agent skill from aviggiano/security. Create Foundry differential tests comparing production Solidity contracts against an independent reference model.

When should I use Foundry Differential Tests?

Foundry Differential Tests fits situations like: Codex needs paired deployments; public-view state comparisons; strict equality checks; root-cause classification of production/reference divergence.

How do I install Foundry Differential Tests in Claude Code?

Run `npx skills add aviggiano/security --skill foundry-differential-tests -a claude-code`. Or copy the skill folder (skills/foundry-differential-tests in aviggiano/security) into .claude/skills/foundry-differential-tests in your project. Claude Code loads it when a task matches its description.

How do I install Foundry Differential Tests in Codex?

Run `npx skills add aviggiano/security --skill foundry-differential-tests -a codex`. Or copy the skill folder (skills/foundry-differential-tests in aviggiano/security) into .agents/skills/foundry-differential-tests in your project. Codex loads it when a task matches its description.

Can I use Foundry Differential Tests 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 aviggiano/security --skill foundry-differential-tests -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/foundry-differential-tests, .gemini/skills/foundry-differential-tests, .github/skills/foundry-differential-tests and .opencode/skills/foundry-differential-tests in your project.

What does Foundry Differential Tests need to run?

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

Does Foundry Differential Tests 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 Foundry Differential Tests 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 Foundry Differential Tests use?

Foundry Differential Tests 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 Foundry Differential Tests use?

About 613 tokens (SKILL.md is roughly 2.5k 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 Foundry Differential Tests?

Skills that share tags, products or a category with Foundry Differential Tests: New Config (lidofinance/diffyscan, 142 stars), Validate Config (lidofinance/diffyscan, 142 stars), function Object() { [native code] } Patterns (ccashwell/evm-cortex, 131 stars) and Cross Chain Security (ccashwell/evm-cortex, 131 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Foundry Differential Tests?

aviggiano (a GitHub user) maintains it in aviggiano/security, which has 144 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on September 15, 2026.

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