Agent skill

Forge Scripting

by ccashwell in ccashwell/evm-cortex

A skill your agent uses when writing Forge deployment and interaction scripts.

MITAuto-check passedDevOps & Cloud

Install Forge Scripting

skills CLI
$ npx skills add ccashwell/evm-cortex --skill forge-scripting -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ccashwell/evm-cortex forge-scripting --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/forge-scripting .claude/skills/forge-scripting && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
forge-scripting
GitHub stars
131
Token cost
~1.9k tokens
SKILL.md length
109 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when writing Forge deployment and interaction scripts.

  • Works in 7 steps: Always dry-run first: Run without… → Pin dependencies: Use exact compiler and… → Chain-specific config: Use block.chainid… → …
  • Writing Forge deployment and interaction scripts
  • SKILL.md covers Basic Deployment Script, Running Scripts, Deployment Script Template and Multi-Chain Deployment, plus 5 more sections
  • Needs ETHERSCAN_API_KEY and DEPLOYER_PRIVATE_KEY

What it does

Forge Scripting is an agent skill from ccashwell/evm-cortex. Use when writing Forge deployment and interaction scripts. Covers broadcast transactions, multi-chain deployment, verification, dry-run vs broadcast, cheatcodes, and environment variable usage.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in DevOps & Cloud, covering Deployment and Secrets management. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Writing Forge deployment and interaction scripts
  • Tasks that involve Deployment
  • Tasks that involve Secrets management

Example prompts

  • “/forge-scripting”

Requirements

  • A credential in DEPLOYER_PRIVATE_KEY
  • A credential in ETHERSCAN_API_KEY

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Always dry-run first: Run without --broadcast to simulate
  2. Pin dependencies: Use exact compiler and dependency versions
  3. Chain-specific config: Use block.chainid for per-chain settings
  4. Post-deploy verification: Assert critical state after deployment
  5. Idempotent scripts: Check if contracts exist before deploying
  6. Save addresses: Write deployed addresses to a registry file
  7. Use --slow for mainnet: Wait for confirmations on high-value deploys

What it can do on your machine

Read from SKILL.md and the folder at commit f8f3301. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are solidity and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • ETHERSCAN_API_KEY
    • DEPLOYER_PRIVATE_KEY
    • PRIVATE_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Forge Scripting loads about 1.9k tokens when it runs. Until then it costs about 52 tokens; SKILL.md has 109 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~52
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ccashwell/evm-cortex at commit f8f3301, republished under its MIT licence (© ccashwell). 109 words, ~1,948 tokens.

Download SKILL.mdSave it as .claude/skills/forge-scripting/SKILL.md (or your agent's skills folder).
name
forge-scripting
description
Use when writing Forge deployment and interaction scripts. Covers broadcast transactions, multi-chain deployment, verification, dry-run vs broadcast, cheatcodes, and environment variable usage.

Forge Script Deployment Patterns

Basic Deployment Script

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {Script, console2} from "forge-std/Script.sol";
import {MyToken} from "../src/MyToken.sol";

contract DeployScript is Script {
    function run() external {
        uint256 deployerKey = vm.envUint("DEPLOYER_PRIVATE_KEY");
        address deployer = vm.addr(deployerKey);

        console2.log("Deployer:", deployer);
        console2.log("Balance:", deployer.balance);

        vm.startBroadcast(deployerKey);

        MyToken token = new MyToken("My Token", "MTK", 1_000_000e18);
        console2.log("Token deployed at:", address(token));

        vm.stopBroadcast();
    }
}

Running Scripts

bash
# Dry run (simulation only, no tx sent)
forge script script/Deploy.s.sol --rpc-url $ETH_RPC_URL

# Broadcast (send real transactions)
forge script script/Deploy.s.sol --rpc-url $ETH_RPC_URL --broadcast

# Broadcast + verify on Etherscan
forge script script/Deploy.s.sol --rpc-url $ETH_RPC_URL \
  --broadcast --verify --etherscan-api-key $ETHERSCAN_API_KEY

# With specific sender
forge script script/Deploy.s.sol --rpc-url $ETH_RPC_URL \
  --broadcast --sender 0xDeployer

# Resume failed broadcast
forge script script/Deploy.s.sol --rpc-url $ETH_RPC_URL --resume

# Slow mode (wait for each tx confirmation)
forge script script/Deploy.s.sol --rpc-url $ETH_RPC_URL --broadcast --slow

Deployment Script Template

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {Script, console2} from "forge-std/Script.sol";
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
import {MyProtocol} from "../src/MyProtocol.sol";
import {Treasury} from "../src/Treasury.sol";

contract DeployProtocol is Script {
    struct DeployConfig {
        address admin;
        address treasury;
        uint256 feeRate;
        address weth;
    }

    function getConfig() internal view returns (DeployConfig memory) {
        if (block.chainid == 1) {
            return DeployConfig({
                admin: vm.envAddress("MAINNET_ADMIN"),
                treasury: vm.envAddress("MAINNET_TREASURY"),
                feeRate: 30, // 0.3%
                weth: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
            });
        } else if (block.chainid == 8453) {
            return DeployConfig({
                admin: vm.envAddress("BASE_ADMIN"),
                treasury: vm.envAddress("BASE_TREASURY"),
                feeRate: 30,
                weth: 0x4200000000000000000000000000000000000006
            });
        } else if (block.chainid == 11155111) {
            return DeployConfig({
                admin: msg.sender,
                treasury: msg.sender,
                feeRate: 100,
                weth: address(0)
            });
        } else {
            revert("Unsupported chain");
        }
    }

    function run() external {
        DeployConfig memory cfg = getConfig();
        uint256 deployerKey = vm.envUint("DEPLOYER_PRIVATE_KEY");

        vm.startBroadcast(deployerKey);

        // Deploy implementation
        MyProtocol impl = new MyProtocol();
        console2.log("Implementation:", address(impl));

        // Deploy proxy
        bytes memory initData = abi.encodeCall(
            MyProtocol.initialize, (cfg.admin, cfg.treasury, cfg.feeRate, cfg.weth)
        );
        ERC1967Proxy proxy = new ERC1967Proxy(address(impl), initData);
        console2.log("Proxy:", address(proxy));

        // Deploy treasury
        Treasury treasury = new Treasury(address(proxy));
        console2.log("Treasury:", address(treasury));

        // Post-deploy configuration
        MyProtocol(address(proxy)).setTreasury(address(treasury));

        vm.stopBroadcast();

        // Verify deployment (runs after broadcast)
        _verify(address(proxy), cfg);
    }

    function _verify(address proxy, DeployConfig memory cfg) internal view {
        MyProtocol protocol = MyProtocol(proxy);
        require(protocol.admin() == cfg.admin, "Admin mismatch");
        require(protocol.feeRate() == cfg.feeRate, "Fee mismatch");
        console2.log("Verification passed");
    }
}

Multi-Chain Deployment

solidity
contract MultiChainDeploy is Script {
    function deployToChain(string memory rpcAlias) internal {
        vm.createSelectFork(rpcAlias);
        uint256 deployerKey = vm.envUint("DEPLOYER_PRIVATE_KEY");

        vm.startBroadcast(deployerKey);
        MyContract c = new MyContract();
        console2.log("Chain", block.chainid, "deployed at:", address(c));
        vm.stopBroadcast();
    }

    function run() external {
        deployToChain("mainnet");
        deployToChain("base");
        deployToChain("optimism");
    }
}
bash
# Deploy to multiple chains
forge script script/MultiChainDeploy.s.sol --broadcast \
  --multi --verify --etherscan-api-key $ETHERSCAN_API_KEY

Cheatcodes in Scripts

solidity
// Environment variables
uint256 key = vm.envUint("PRIVATE_KEY");
address addr = vm.envAddress("ADMIN_ADDRESS");
string memory rpc = vm.envString("RPC_URL");
bool isProd = vm.envBool("IS_PRODUCTION");
uint256 optionalVal = vm.envOr("OPTIONAL_VAL", uint256(42));

// Broadcasting
vm.startBroadcast(key);     // All subsequent calls are real txs
vm.stopBroadcast();

vm.broadcast(key);           // Only next call is a real tx

// File I/O
string memory json = vm.readFile("config.json");
vm.writeFile("output.json", data);

// JSON parsing
bytes memory raw = vm.parseJson(json, ".deploy.address");
address deployed = abi.decode(raw, (address));

// Compute CREATE2 address
address predicted = vm.computeCreate2Address(
    salt, keccak256(type(MyContract).creationCode), factory
);

Broadcast Artifacts

After --broadcast, Foundry saves transaction data to:

broadcast/
└── Deploy.s.sol/
    ├── 1/            # Chain ID
    │   ├── run-latest.json    # Latest broadcast
    │   └── run-1234567.json   # Timestamped
    └── 8453/
        └── run-latest.json

Each file contains:

  • Transaction hashes
  • Contract addresses
  • Gas used
  • Constructor arguments

Verification in Scripts

bash
# Auto-verify during broadcast
forge script script/Deploy.s.sol --broadcast --verify \
  --etherscan-api-key $ETHERSCAN_API_KEY

# Verify after deployment
forge verify-contract 0xContractAddress MyContract \
  --chain-id 1 --etherscan-api-key $ETHERSCAN_API_KEY \
  --constructor-args $(cast abi-encode "constructor(address,uint256)" 0xAdmin 100)

Script Best Practices

  1. Always dry-run first: Run without --broadcast to simulate
  2. Pin dependencies: Use exact compiler and dependency versions
  3. Chain-specific config: Use block.chainid for per-chain settings
  4. Post-deploy verification: Assert critical state after deployment
  5. Idempotent scripts: Check if contracts exist before deploying
  6. Save addresses: Write deployed addresses to a registry file
  7. Use --slow for mainnet: Wait for confirmations on high-value deploys
solidity
// Idempotent deploy pattern
function run() external {
    address existing = vm.envOr("EXISTING_CONTRACT", address(0));
    if (existing != address(0) && existing.code.length > 0) {
        console2.log("Already deployed at:", existing);
        return;
    }
    // ... deploy
}

Gas Estimation

bash
# Estimate gas without broadcasting
forge script script/Deploy.s.sol --rpc-url $ETH_RPC_URL -vvvv

# The -vvvv output shows gas used per transaction

© ccashwell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/forge-scripting of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Forge Scripting next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Forge Scripting compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Forge Scripting this skillccashwell/evm-cortex131—~1.9kAutomated safety check: PassMIT
LangBot Deployment Guidelangbot-app/LangBot18k—~1.2kAutomated safety check: NotesApache-2.0
Azure Bicep Skilltimothywarner-org/claude-code224—~2.9kAutomated safety check: PassMIT
Monstermq Broker Configvogler75/monster-mq143—~2.2kAutomated safety check: PassGPL-3.0
Deploymentmatrixorigin/memoria608—~1.6kAutomated safety check: NotesApache-2.0
Letta Configurationletta-ai/skills147—~1.3kAutomated safety check: NotesMIT

Similar skills

  • LangBot Deployment Guide

    langbot-app/LangBot

    Deploys and configures a LangBot instance with Docker Compose or Kubernetes, covering config.yaml, the Box sandbox runtime, the plugin runtime and the global API key.

    18k GitHub stars~1.2k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Azure Bicep Skill

    timothywarner-org/claude-code

    A skill your agent uses when authoring, reviewing, or refactoring Azure Bicep code.

    224 GitHub stars~2.9k tokensUpdated 2 mo ago
    DevOps & CloudAuto-check passed
  • Monstermq Broker Config

    vogler75/monster-mq

    Guide for configuring, deploying, and operating the MonsterMQ broker.

    143 GitHub stars~2.2k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Deployment

    matrixorigin/memoria

    Deploy Memoria with Docker Compose or Kubernetes. An agent skill from matrixorigin/memoria.

    608 GitHub stars~1.6k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Letta Configuration

    letta-ai/skills

    Configure LLM models and providers for Letta agents and servers.

    147 GitHub stars~1.3k tokensUpdated 6 days ago
    DevOps & CloudAuto-check: notes
  • Env Manager

    bobmatnyc/claude-mpm

    Environment variable validation, synchronization, and management across local development, CI/CD, and deployment platforms

    155 GitHub stars~2k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check: notes

More from ccashwell/evm-cortex

All 89 skills in this repo
  • Xray Pre Audit

    ccashwell/evm-cortex

    A skill your agent uses when preparing for a security audit, performing reconnaissance on a new codebase, or creating a protocol overview.

    131 GitHub stars~25k tokensUpdated 8 days ago
    Auto-check passed
  • Aave Integration

    ccashwell/evm-cortex

    A skill your agent uses when integrating with Aave V3 for lending, borrowing, flash loans, or building on top of Aave markets.

    131 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Access Control Patterns

    ccashwell/evm-cortex

    Access control design patterns for Solidity protocols. An agent skill from ccashwell/evm-cortex.

    131 GitHub stars~1.8k tokensUpdated 8 days ago
    Auto-check passed
  • Anvil Patterns

    ccashwell/evm-cortex

    A skill your agent uses when running a local Ethereum node with Anvil.

    131 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Audit Breadth Scan

    ccashwell/evm-cortex

    A skill your agent uses when performing systematic breadth-first review of all contracts during a security audit.

    131 GitHub stars~1.4k tokensUpdated 8 days ago
    Auto-check passed
  • Audit Depth Analysis

    ccashwell/evm-cortex

    A skill your agent uses when performing deep analysis of specific findings or high-risk areas during a security audit.

    131 GitHub stars~1.6k tokensUpdated 8 days ago
    Auto-check passed

Categories

Questions about Forge Scripting

What does Forge Scripting do?

A skill your agent uses when writing Forge deployment and interaction scripts. Forge Scripting is an agent skill from ccashwell/evm-cortex. Use when writing Forge deployment and interaction scripts.

When should I use Forge Scripting?

Forge Scripting fits situations like: writing Forge deployment and interaction scripts; tasks that involve Deployment; tasks that involve Secrets management.

How do I install Forge Scripting in Claude Code?

Run `npx skills add ccashwell/evm-cortex --skill forge-scripting -a claude-code`. Or copy the skill folder (skills/forge-scripting in ccashwell/evm-cortex) into .claude/skills/forge-scripting in your project. Claude Code loads it when a task matches its description.

How do I install Forge Scripting in Codex?

Run `npx skills add ccashwell/evm-cortex --skill forge-scripting -a codex`. Or copy the skill folder (skills/forge-scripting in ccashwell/evm-cortex) into .agents/skills/forge-scripting in your project. Codex loads it when a task matches its description.

Can I use Forge Scripting in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ccashwell/evm-cortex --skill forge-scripting -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/forge-scripting, .gemini/skills/forge-scripting, .github/skills/forge-scripting and .opencode/skills/forge-scripting in your project.

What does Forge Scripting need to run?

Going by SKILL.md and its folder, Forge Scripting needs credentials named ETHERSCAN_API_KEY, DEPLOYER_PRIVATE_KEY and PRIVATE_KEY. Our summary lists: A credential in DEPLOYER_PRIVATE_KEY; A credential in ETHERSCAN_API_KEY.

Does Forge Scripting access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Forge Scripting safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Forge Scripting use?

Forge Scripting is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Forge Scripting use?

About 1.9k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Forge Scripting?

Skills that share tags, products or a category with Forge Scripting: LangBot Deployment Guide (langbot-app/LangBot, 18k stars), Azure Bicep Skill (timothywarner-org/claude-code, 224 stars), Monstermq Broker Config (vogler75/monster-mq, 143 stars) and Deployment (matrixorigin/memoria, 608 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Forge Scripting?

ccashwell (a GitHub user) maintains it in ccashwell/evm-cortex, which has 131 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on September 30, 2026.

Source: ccashwell/evm-cortex on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.