/foundry-agent:foundry-script-opsfrom foundry-agent
Multi-step on-chain agent operations with forge script (approve then deposit, multi-call sequences). Use when sequential cast send is error-prone. Prefer cast for single reads/writes.
Ships in foundry-agent. 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.
None: SKILL.md is the whole skill.
Run multi-step on-chain agent operations with forge script when sequential cast send is error-prone.
Confirm RPC/chain and env addresses before broadcast (see foundry-agent-safety). Review script source and env vars.
Always run without --broadcast first and review traces.
Prefer cast call / cast send for single-step ops (see cast-commands).
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {Script} from "forge-std/Script.sol";
import {IERC20} from "forge-std/interfaces/IERC20.sol";
contract AgentOp is Script {
function run() external {
uint256 pk = vm.envUint("PRIVATE_KEY");
address token = vm.envAddress("TOKEN");
address spender = vm.envAddress("SPENDER");
uint256 amount = vm.envUint("AMOUNT");
vm.startBroadcast(pk);
IERC20(token).approve(spender, amount);
// next calls...
vm.stopBroadcast();
}
}
# dry run (no broadcast)
forge script script/AgentOp.s.sol:AgentOp --rpc-url "$ETH_RPC_URL" -vvvv
# broadcast after user confirmation
forge script script/AgentOp.s.sol:AgentOp \
--rpc-url "$ETH_RPC_URL" \
--broadcast \
-vvvv
--broadcast first; review traces.foundry-agent-safety checklist before broadcasting.cast call / balances after broadcast.| Step | Tool |
|---|---|
| Single view | cast call |
| Single tx | cast send |
| Multi-step sequence | forge script --broadcast |
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
foundry-agent@cyotee is listed by cyotee/cyotee-claude-plugins — review the source before installing
npx claudepluginhub cyotee/cyotee-claude-plugins --plugin foundry-agent4 skills in this plugin
/anvil-nodeRun local Ethereum nodes with Anvil. Use when setting up local development environments, forking mainnet for testing, or running integration tests against a local node./cast-commandsInteract with EVM chains using Cast CLI. Use when querying blockchain data, sending transactions, calling contracts, or converting between formats. Cast is the Swiss Army knife for chain interaction./foundry-agent-safetySafety policy for AI agents using Foundry cast/forge on live chains. Use before any cast send, forge script --broadcast, or value transfer. Covers chain confirmation, secrets, dry-run, and confirmation gates.