Skill based on Foundry (foundry-rs/foundry), generated 2026-02-09. User docs: https://getfoundry.sh, book: https://book.getfoundry.sh
Foundry is a fast, portable Ethereum dev toolkit (Rust): Forge (build, test, fuzz, deploy), Cast (EVM interaction), Anvil (local node), Chisel (Solidity REPL). This skill focuses on agent capabilities — architecture, cheatcodes, scripting, debugging, custom networks, and the linter — from the in-repo dev docs.
Core References
| Topic |
Description |
Reference |
| Architecture |
evm, config, cli crates; where cheatcodes and CLI live |
core-architecture |
| Cheatcodes |
Vm address, Inspector, adding cheatcodes, Cheatcode trait, JSON spec |
core-cheatcodes |
| Config |
foundry.toml, profiles, compiler, paths, remappings |
core-config |
| Project layout |
forge init, src, test, script, lib |
core-project-layout |
Features
| Topic |
Description |
Reference |
| Forge build & test |
forge build, forge test, snapshot, gas report, fuzz |
features-forge-build-test |
| Forge fmt |
forge fmt, [fmt] config, --check |
features-forge-fmt |
| Contract size |
forge build --sizes, 24KB limit |
features-contract-size |
| Forge install |
forge install, remappings, lib layout |
features-forge-install |
| Scripting |
forge script flow, broadcast, resume, nonce, multi-chain |
features-scripting |
| Testing patterns |
vm.prank, expectRevert, expectEmit, forge-std Test |
features-testing-patterns |
| Coverage & verify |
forge coverage, forge verify-contract |
features-coverage-verify |
| Invariant testing |
invariant_* functions, runs, depth, stateful fuzz |
features-invariant |
| Fork testing |
createSelectFork, selectFork, activeFork, multi-fork |
features-fork-testing |
| FFI & signing |
vm.ffi, vm.sign, EIP-712 helpers |
features-ffi-signatures |
| State cheatcodes |
vm.deal, vm.mockCall, vm.etch |
features-state-cheatcodes |
| Cast |
cast call, send, ABI encode/decode, chain queries |
features-cast |
| Anvil |
Local node, fork, pre-funded accounts, block time |
features-anvil |
| Chisel |
Solidity REPL for snippets and quick checks |
features-chisel |
| Debugging |
RUST_LOG, tracing filters for forge/cast/anvil |
features-debugging |
| Custom Networks |
Custom precompiles, evm-networks crate |
features-networks |
| Lint (forge lint) |
Early/late passes, adding lint rules, testing |
features-lint |
Best Practices
External Links