foundry-template AGENTS.md

foundry-template AGENTS.md is an instructions file for Codex, OpenCode from PaulRBerg/foundry-template. It costs 1,484 tokens per session, scanned C, original, MIT.

Repository instructions for a Foundry project, a toolkit for developing Solidity smart contracts that run on blockchain networks. They document the Solidity version, libraries, Bun package setup, and Forge commands.

In plain words
What is it for?
Use them to compile, test, fuzz, format, measure coverage, inspect contract sizes, and prepare Solidity deployments.
Why use it?
They provide the exact development and checking commands, helping avoid incompatible code or incomplete contract changes.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/paulrberg/foundry-template/agents-md
Clone the repo
git clone --depth 1 https://github.com/PaulRBerg/foundry-template

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for foundry-template AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/paulrberg/foundry-template/agents-md.svg)](https://agentmods.dev/instructions/paulrberg/foundry-template/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/paulrberg/foundry-template/agents-md"><img src="https://agentmods.dev/badge/instructions/paulrberg/foundry-template/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,484 This file is loaded in full into every session.
When invoked 1,484 The same file — it is already loaded in full.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01484 $0.01484
Opus 5 $0.00742 $0.00742
Sonnet 5 $0.00297 $0.00297
Haiku 4.5 $0.00148 $0.00148

Measured 4d ago against content hash 45ade8b2b2e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

foundry-template AGENTS.md scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- `bun run clean` — `rm -rf cache out`
AGENTS.md · 92 lines

How it starts

The opening of the file, as written. The whole thing — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

Foundry-based template for developing Solidity smart contracts. Dependencies are managed as Node.js packages (via Bun) and remapped through remappings.txt instead of git submodules.

Stack

  • Solidity 0.8.29 (pragma >=0.8.29), EVM target shanghai, optimizer on (10,000 runs)
  • Foundry (forge) — compile, test, fuzz, format, deploy
  • Forge Std v1.9.7 — test and scripting framework
  • OpenZeppelin Contracts 5.3.0 — pre-installed contract library
  • Bun — dependency manager (deps installed as Node.js packages, remapped in remappings.txt)
  • Prettier 3.5 — formatter for JSON/Markdown/YAML
  • Solhint 5.1 — Solidity linter

Commands

Forge

  • forge build — compile contracts
  • forge build --sizes — compile and print contract sizes (CI build step)
  • forge test — run the test suite
  • forge test -vvv — run tests with console2 logs shown
  • forge test --gas-report — run tests with a gas report
  • forge coverage — generate a coverage report
  • forge fmt — format Solidity
  • forge fmt --check — check Solidity formatting without writing
  • forge clean — delete out/ and cache/
  • forge config — print the resolved Foundry config
  • forge script script/Deploy.s.sol --broadcast --fork-url http://localhost:8545 — deploy Foo to a local node (requires MNEMONIC or ETH_FROM)
  • forge script script/DeployBrowser.s.sol --broadcast --fork-url http://localhost:8545 --browser — deploy Foo to a local node (requires you to connect your wallet at localhost:9545)

Bun scripts (package.json)

  • bun install — install Node.js dependencies (add a matching entry to remappings.txt afterward)
  • bun run buildforge build
  • bun run testforge test
  • bun run cleanrm -rf cache out
  • bun run forge-checkforge fmt --check
  • bun run forge-writeforge fmt
  • bun run solhint-check — Solhint over {script,src,tests}/**/*.sol
  • bun run prettier:check — Prettier check over **/*.{json,md,yml}
  • bun run prettier:write — Prettier write over **/*.{json,md,yml}
  • bun run full-checkforge-check + solhint-check + prettier:check (the CI lint gate)
  • bun run full-writeforge-write + prettier:write (auto-fix formatting)

Read the full file on GitHub · 92 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 92 lines · 1,484 tokens per session scan C 45ade8b2b2e9

Subscribe to this mod's changes

foundry-template AGENTS.md is an instructions file published in the GitHub repository PaulRBerg/foundry-template (645 stars, last pushed 1mo ago), licensed MIT. It adds 1,484 tokens to every session, about $0.0074 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.