foundry

Automate Solidity testing with Foundry for integration, fuzz, fork, and invariant tests.

7|Updated Nov 27, 2025
One-click install
npx skills add https://github.com/sablier-labs/plugin-marketplace --skill foundry
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundry
Source: https://github.com/sablier-labs/plugin-marketplace/tree/main/plugins/testing/skills/foundry
Command: npx skills add https://github.com/sablier-labs/plugin-marketplace --skill foundry

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Solidity projects require reliable Foundry-based tests and scripts to validate behavior and guard against regressions through structured, repeatable testing.

Core Features & Use Cases

  • Test types: Integration, fuzz, fork, and invariant tests, plus deployment scripts.
  • Guided workflows: Patterns and references to accelerate test authoring within tests/ and scripts/ directories.
  • Use Case: When maintaining a complex smart contract system, scaffold tests, run benchmarks, and verify invariants.

Quick Start

Use this Skill to begin writing Foundry tests and scripts following the included references and patterns, then run them with forge test.

Frequently Asked Questions about foundry

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

FAQPage Schema
How do I write integration and fuzz tests for Solidity contracts?

Integration and fuzz tests in Foundry validate contract behavior under normal and randomized inputs. Foundry's integration tests execute full contract workflows, while fuzz tests automatically generate varied inputs to uncover edge cases. Both run with forge test and support assertions across state changes and function calls.

What are invariant tests and how do I implement them in Foundry?

Invariant tests verify properties that must always hold true in your contract, regardless of input sequences. Foundry's invariant testing framework generates random function call sequences and checks that your defined invariants remain valid throughout execution, catching violations that break contract assumptions.

Can I run fork and deployment tests with Foundry?

Fork tests simulate mainnet or testnet states locally, letting you test against real contract states without testnet dependency. Foundry supports fork testing via RPC endpoints. Deployment scripts in the scripts/ directory automate contract deployment across environments using forge script for consistent, repeatable deployment workflows.

Do I need to install Foundry tooling separately to use these tests?

Yes, Foundry tooling must be installed on your system to write and execute tests. This Skill requires access to Foundry's command-line tools and bundled references that document patterns, cheat codes, and test structure for building robust test suites in the tests/ and scripts/ directories.

How do I structure my Solidity project to organize tests and scripts?

Foundry follows standard conventions: place test files in the tests/ directory and deployment or utility scripts in the scripts/ directory. This Skill provides patterns and references to guide file organization, naming conventions, and test authoring workflows that align with Foundry's expected project layout.

What's the best way to prevent regressions in complex smart contract systems?

Structured, repeatable Foundry tests catch regressions by validating contract behavior across integration, fuzz, fork, and invariant test types. This Skill automates test authoring and provides guided workflows to scaffold reliable test suites that guard against state and logic regressions throughout contract development.