# forge

The forge rule configures Foundry workflows for Abstract and tells Claude Code to use the ZKsync mode for Solidity projects.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 1064 repo stars
- Author: jarrodwatts
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/jarrodwatts/claude-code-config/tree/HEAD/rules/forge.md
- Updated: 2026-01-21
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/forge

## What it does

The rule targets `*.sol` files and `foundry.toml`. It sets a working convention for Abstract Chain: use `foundry-zksync` and add `--zksync` to Foundry commands for builds, tests, scripts, and contract deployment.

Its configuration covers RPC endpoints for Abstract Mainnet and Abstract Testnet, chain IDs, verification URLs, and `etherscan` entries. Deployment uses `forge script` with `--broadcast`; verification uses `forge verify-contract`. The explorer key is read from `ABSCAN_API_KEY`. Without `--zksync`, a Foundry command is in the wrong mode for this ZKsync-based chain.

Place the rule at `.claude/rules/forge.md` in a Claude Code project. It only matches Solidity files and `foundry.toml`, so unrelated project files are outside its scope.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/forge.md` — The paths frontmatter field limits the files

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/forge.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/forge.instructions.md` — The applyTo field sets which files it applies to

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/forge.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/forge.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/jarrodwatts/claude-code-config/tree/HEAD/rules/forge.md

## When to use it
- build Solidity code with the ZKsync Foundry mode
- run tests against the required command setup
- deploy a script to Abstract Testnet or Mainnet
- verify a deployed contract through Abstract’s explorer
- keep Abstract RPC and verifier settings in `foundry.toml`

## Example prompts
- Build the contracts with `forge build --zksync`.
- Run the test suite using `forge test --zksync`.
- Deploy `script/Deploy.s.sol` to Abstract Testnet, then verify the contract.

## Similar
- [browser-act-skill-forge](https://affpapa.org/en/nevibecode/skills/browser-act-skill-forge.md) — skill · 85200 installs
- [bmad-forge-idea](https://affpapa.org/en/nevibecode/skills/bmad-forge-idea.md) — skill · 17000 installs
- [feature-forge](https://affpapa.org/en/nevibecode/skills/feature-forge.md) — skill · 4600 installs
- [vector-forge](https://affpapa.org/en/nevibecode/skills/vector-forge.md) — skill · 4400 installs
- [skill-forge](https://affpapa.org/en/nevibecode/skills/skill-forge.md) — skill · 4300 installs
- [plugin-forge](https://affpapa.org/en/nevibecode/skills/plugin-forge.md) — skill · 4000 installs

From the same set: [jarrodwatts/claude-code-config](https://affpapa.org/en/nevibecode/by/jarrodwatts/claude-code-config.md) — 20 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
