foundry-testing

Automate Solidity test writing with Foundry/Forge cheatcodes and forge-std assertions.

120|12|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ccashwell/evm-cortex --skill foundry-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundry-testing
Source: https://github.com/ccashwell/evm-cortex/tree/main/skills/foundry-testing
Command: npx skills add https://github.com/ccashwell/evm-cortex --skill foundry-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing robust Solidity tests with Foundry can be verbose and error-prone; this skill provides a reusable set of patterns and cheatcodes to accelerate test authoring and ensure consistent test quality.

Core Features & Use Cases

  • Cheatcodes and forge-std assertions for deterministic tests.
  • Fork testing patterns to validate behavior on forked networks.
  • Gas reporting and optimization guidance to track performance.
  • Event testing and test organization patterns for scalable suites.
  • Real-world scenarios: unit tests, integration tests, and forks in Foundry projects.

Quick Start

Create a new Foundry test file under test/ and begin with a simple test using forge-std.

Frequently Asked Questions about foundry-testing

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

FAQPage Schema
How do I write reliable Solidity tests using Foundry cheatcodes?

Foundry fork testing allows you to validate contract behavior on forked networks by copying mainnet state locally. It uses cheatcodes to guide test organization and pattern usage for reliable integration and fork testing scenarios.

Does forge-std support event testing and gas reporting in Solidity?

Yes, forge-std supports event testing and gas reporting in Solidity. It provides specific assertions to verify emitted events and tracks gas usage to guide optimization, ensuring scalable and reliable test suites.

What is the best way to organize Foundry test suites for scalability?

The best way to organize Foundry test suites for scalability is applying test organization patterns that separate unit, integration, and fork testing scenarios. This approach uses forge-std assertions to maintain consistent test quality.

Can I use Foundry fork testing to validate behavior on forked networks?

Yes, you can use Foundry fork testing to validate behavior on forked networks. It provides patterns to copy network state locally, enabling reliable and reproducible integration testing for Foundry-based projects.

Why does writing robust Solidity tests with Foundry become error-prone?

Writing robust Solidity tests with Foundry becomes error-prone due to verbosity and lack of consistent patterns. Applying reusable cheatcodes, forge-std assertions, and test organization patterns accelerates authoring and ensures consistent quality.