writing-foundry-tests

Official

Write robust Foundry tests with confidence.

Authoridchain-world
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Writing robust Foundry tests for Solidity contracts can be challenging without clear patterns and best practices. This Skill provides a structured guide to help engineers write deterministic tests, use cheatcodes correctly, and organize tests with invariant checks and fuzzing.

Core Features & Use Cases

  • Enforces test naming conventions (test_, testFuzz_, invariant_) and isolation via setUp to ensure reliable CI outcomes.
  • Demonstrates practical cheatcodes usage (makeAddr, deal, vm.prank, vm.expectRevert) and pattern-driven test patterns for readability.
  • Covers invariants and handler-based fuzzing to catch deep edge cases and maintain global contract health.

Quick Start

Create a new Foundry test file following the conventions shown, then run forge test to validate contract behavior.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: writing-foundry-tests
Download link: https://github.com/idchain-world/id-agents/archive/main.zip#writing-foundry-tests

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.