solidity-security

solidity-security is a skill for Claude Code, Codex from wshobson/agents. It costs 38 tokens per session (733 once invoked), scanned A, original, MIT.

A guide to writing and checking Solidity smart contracts, which are programs that run on blockchains.

In plain words
What is it for?
Use it when writing contracts, auditing existing code, building decentralised finance systems, or preparing contracts for security review.
Why use it?
It helps prevent common contract flaws such as reentrancy, arithmetic errors, and incorrect access controls that can put blockchain applications at risk.

Skill for Claude CodeCodex

Part of the blockchain-web3 plugin — 4 skills, 1 agent shipped together

About the project

Agentic Plugin Marketplace is a collection of reusable plugins, agents, skills, commands, and rules for coding-agent tools including Claude Code, Codex CLI, Cursor, OpenCode, Antigravity CLI, and GitHub Copilot. It is for developers assembling agentic workflows across multiple harnesses from shared Markdown sources, and the catalogue entries are examples or subsets of those workflow components.

wshobson/agents · 39,428 stars · on GitHub

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 skills/wshobson/agents/solidity-security
Any agent
npx skills add wshobson/agents --skill solidity-security
Clone the repo
git clone --depth 1 https://github.com/wshobson/agents

Made for: Claude Code, Codex.

Or install blockchain-web3, the plugin that ships this one along with the rest of its 4 skills, 1 agent.

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 solidity-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/wshobson/agents/solidity-security.svg)](https://agentmods.dev/skills/wshobson/agents/solidity-security)
Your own site
<a href="https://agentmods.dev/skills/wshobson/agents/solidity-security"><img src="https://agentmods.dev/badge/skills/wshobson/agents/solidity-security.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 733 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00038 $0.00733
Opus 5 $0.00019 $0.00367
Sonnet 5 $0.00008 $0.00147
Haiku 4.5 $0.00004 $0.00073

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

Security

Grade A, and why

solidity-security scanned grade A with 0 findings 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/blockchain-web3/skills/solidity-security/SKILL.md · 113 lines

How it starts

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

Solidity Security

Master smart contract security best practices, vulnerability prevention, and secure Solidity development patterns.

When to Use This Skill

  • Writing secure smart contracts
  • Auditing existing contracts for vulnerabilities
  • Implementing secure DeFi protocols
  • Preventing reentrancy, overflow, and access control issues
  • Optimizing gas usage while maintaining security
  • Preparing contracts for professional audits
  • Understanding common attack vectors

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Testing for Security

// Hardhat test example
const { expect } = require("chai");
const { ethers } = require("hardhat");

describe("Security Tests", function () {
  it("Should prevent reentrancy attack", async function () {
    const [attacker] = await ethers.getSigners();

    const VictimBank = await ethers.getContractFactory("SecureBank");
    const bank = await VictimBank.deploy();

    const Attacker = await ethers.getContractFactory("ReentrancyAttacker");
    const attackerContract = await Attacker.deploy(bank.address);

    // Deposit funds
    await bank.deposit({ value: ethers.utils.parseEther("10") });

    // Attempt reentrancy attack
    await expect(
      attackerContract.attack({ value: ethers.utils.parseEther("1") }),
    ).to.be.revertedWith("ReentrancyGuard: reentrant call");
  });

  it("Should prevent integer overflow", async function () {
    const Token = await ethers.getContractFactory("SecureToken");
    const token = await Token.deploy();

    // Attempt overflow
    await expect(token.transfer(attacker.address, ethers.constants.MaxUint256))
      .to.be.reverted;
  });

  it("Should enforce access control", async function () {
    const [owner, attacker] = await ethers.getSigners();

    const Contract = await ethers.getContractFactory("SecureContract");
    const contract = await Contract.deploy();

    // Attempt unauthorized withdrawal
    await expect(contract.connect(attacker).withdraw(100)).to.be.revertedWith(
      "Ownable: caller is not the owner",
    );
  });
});

Read the full file on GitHub · 113 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 113 lines · 38 tokens per session scan A ce1b1bce04f8

Subscribe to this mod's changes

solidity-security is a skill published in the GitHub repository wshobson/agents (39,428 stars, last pushed 3d ago), licensed MIT. It adds 38 tokens to every session and 733 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

Coinbase Automation

Coinbase Automation: list and manage cryptocurrency wallets, accounts, and portfolio data via Coinbase CDP SDK.

openteams-lab/openteams · 24 tokens

sera

Multi-currency settlement skill — quote, swap, and settle across 40 stablecoins via Sera Protocol.

sera-cx/sera-agents · 24 tokens

sera

Multi-currency settlement for AI agents. Quote, swap, and settle across 40 stablecoins (USDC, USDT, EURC, XSGD, JPYC, MYRT, TGBP, BRZ, MXNT, IDRT, AUDD, and more) and 22 fiat currencies via Sera Protocol. 55 tools — quotes, swaps, treasury management, FX deal scanning, and a maker spread ladder.

sera-cx/sera-agents · 90 tokens

sera-protocol

Build, review, or explain integrations with Sera Protocol for stablecoin FX, multi-currency settlement, Sera MCP, Sera Agents, or x402. Use for quotes, corridors, settlement workflows, agent integrations, and Sera Protocol API or contract questions.

sera-cx/sera-agents · 58 tokens

x402-server

Add x402 payment protection to any API endpoint using @dexterai/x402/server. Trigger when the user wants to monetize an API, add a paywall, accept crypto payments on their server, set up Stripe settlement, configure dynamic pricing, create access passes, or enable sponsored access (ads for agents).

Dexter-DAO/opendexter-ide · 66 tokens

x402-client

Integrate one-shot x402 payments into a Node.js or browser application with @dexterai/x402/client. Trigger when the user wants to call a paid API, use payAndFetch, create application-owned wallets, set spending limits, inspect receipts, or handle sponsored recommendations.

Dexter-DAO/opendexter-ide · 60 tokens