/foundry:foundry-projectfrom foundry
Set up and configure Foundry projects. Use when initializing new projects, configuring foundry.toml, managing dependencies, or structuring Solidity codebases.
Ships in foundry. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Initialize, configure, and manage Foundry projects.
# Create new project
forge init my-project
cd my-project
# Create from template
forge init my-project --template https://github.com/foundry-rs/forge-template
# Initialize in existing directory
forge init --force
# Clone and build
git clone https://github.com/some/project
cd project
forge build
my-project/
├── foundry.toml # Configuration
├── .env # Environment variables (gitignored)
├── .gitignore
├── README.md
├── lib/ # Dependencies
│ └── forge-std/ # Standard library
├── script/ # Deployment scripts
│ └── Deploy.s.sol
├── src/ # Source contracts
│ └── MyContract.sol
└── test/ # Tests
└── MyContract.t.sol
See config.md for all options.
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
solc = "0.8.24"
optimizer = true
optimizer_runs = 200
[profile.default.fuzz]
runs = 256
[profile.default.invariant]
runs = 256
depth = 15
[rpc_endpoints]
mainnet = "${MAINNET_RPC_URL}"
sepolia = "${SEPOLIA_RPC_URL}"
arbitrum = "${ARBITRUM_RPC_URL}"
[etherscan]
mainnet = { key = "${ETHERSCAN_API_KEY}" }
sepolia = { key = "${ETHERSCAN_API_KEY}" }
arbitrum = { key = "${ARBISCAN_API_KEY}" }
[profile.default]
remappings = [
"@openzeppelin/=lib/openzeppelin-contracts/",
"@uniswap/=lib/v3-periphery/contracts/",
"solmate/=lib/solmate/src/"
]
# Install forge-std (usually included by default)
forge install foundry-rs/forge-std
# Install OpenZeppelin
forge install OpenZeppelin/openzeppelin-contracts
# Install specific version
forge install OpenZeppelin/[email protected]
# Install without commit
forge install OpenZeppelin/openzeppelin-contracts --no-commit
# Update all
forge update
# Update specific
forge update lib/openzeppelin-contracts
forge remove openzeppelin-contracts
# OpenZeppelin contracts
forge install OpenZeppelin/openzeppelin-contracts
# OpenZeppelin upgradeable
forge install OpenZeppelin/openzeppelin-contracts-upgradeable
# Solmate (gas-optimized)
forge install transmissions11/solmate
# Solady (ultra-optimized)
forge install Vectorized/solady
# PRB Math (fixed-point math)
forge install PaulRBerg/prb-math
# Uniswap V3
forge install Uniswap/v3-core
forge install Uniswap/v3-periphery
# Generate remappings from lib/
forge remappings > remappings.txt
forge-std/=lib/forge-std/src/
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/
solmate/=lib/solmate/src/
[profile.default]
remappings = [
"forge-std/=lib/forge-std/src/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/"
]
# Build all contracts
forge build
# Build with sizes
forge build --sizes
# Clean and rebuild
forge clean && forge build
# Build specific contract
forge build --contracts src/MyContract.sol
[profile.default]
optimizer = true
optimizer_runs = 200
[profile.ci]
optimizer = true
optimizer_runs = 200
fuzz = { runs = 1000 }
[profile.lite]
optimizer = false
[profile.production]
optimizer = true
optimizer_runs = 10000
via_ir = true
# Use CI profile
FOUNDRY_PROFILE=ci forge test
# Use production profile for deployment
FOUNDRY_PROFILE=production forge script script/Deploy.s.sol --broadcast
# .env
MAINNET_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/your-key
SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/your-key
ETHERSCAN_API_KEY=your-etherscan-key
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
# Load before commands
source .env && forge script script/Deploy.s.sol
# Or use dotenv in scripts
export $(cat .env | xargs) && forge test
contract DeployScript is Script {
function run() public {
uint256 deployerKey = vm.envUint("PRIVATE_KEY");
address owner = vm.envAddress("OWNER_ADDRESS");
string memory rpcUrl = vm.envString("RPC_URL");
vm.startBroadcast(deployerKey);
// ...
}
}
forge test # All tests
forge test -vvv # With traces
forge test --match-test test_Deposit # Specific test
forge test --watch # Watch mode
forge test --gas-report # Gas report
forge script script/Deploy.s.sol # Dry run
forge script script/Deploy.s.sol --broadcast # Execute
forge script script/Deploy.s.sol --verify # Verify contracts
forge doc # Generate docs
forge doc --serve # Serve locally
forge doc --out docs # Output to docs/
forge fmt # Format code
forge fmt --check # Check formatting
forge snapshot # Gas snapshot
forge snapshot --diff # Compare with previous
# Foundry
/out
/cache
/broadcast
# Environment
.env
.env.*
!.env.example
# Dependencies (if not using git submodules)
# /lib
# Coverage
lcov.info
coverage/
What SKILL.md sets; muted values are Claude Code's defaults
foundry@cyotee is listed by cyotee/cyotee-claude-plugins — review the source before installing
npx claudepluginhub cyotee/cyotee-claude-plugins --plugin foundry6 skills in this plugin
/forge-deploymentDeploy and verify smart contracts with Foundry. Use when deploying contracts, writing deployment scripts, verifying on block explorers, or managing multi-chain deployments./forge-fuzz-testingProperty-based testing with Foundry's fuzzer. Use when writing fuzz tests, invariant tests, or testing edge cases. Covers fuzz test structure, input constraints, fixtures, and invariant testing patterns./forge-signingSign messages with Foundry cheatcodes for testing signature verification. Use when testing EIP-712 signatures, Permit2, or any signed data verification.Other plugins' skills for the same job