solidity-security — Claude Code skill: what it does, install
This skill helps write and audit Solidity contracts against common vulnerabilities. Use it for DeFi work, security checks, and audit preparation.
/plugin marketplace add wshobson/agents
/plugin install blockchain-web3@claude-code-workflowsWhat solidity-security does
solidity-security covers secure Solidity development patterns and common vulnerability prevention. It helps inspect contracts for reentrancy, integer overflow, access-control issues, attack vectors, and gas use where security must remain intact.
Detailed patterns and worked examples are stored in references/details.md. The source includes Hardhat tests for reentrancy, overflow, and unauthorized withdrawals, plus a documented contract example using the Checks-Effects-Interactions pattern.
The skill is available for Claude Code, Codex, and Cursor. Install it when you write or review Solidity contracts; it is a poor fit for projects without smart-contract code.
What it helps with
- check a contract for reentrancy
- find integer overflow risks
- review function access control
- prepare Solidity code for an audit
- test unauthorized withdrawals
Example prompts for the agent
- Audit this Solidity contract for reentrancy and access-control issues.
- Write Hardhat tests for overflow protection and unauthorized withdrawals.
- Review this contract before a professional audit and list the required fixes.
How to install solidity-security
1Plugin marketplace
/plugin marketplace add wshobson/agents/plugin install blockchain-web3@claude-code-workflowsThis installs the whole blockchain-web3 plugin with all its skills
2Skills CLI (Vercel)
npx skills add wshobson/agents --skill solidity-security -a claude-code3Manually: put the files in place
~/.claude/skills/solidity-security/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/solidity-security/
1Skills CLI (Vercel)
npx skills add wshobson/agents --skill solidity-security -a codex2Manually: put the files in place
.agents/skills/solidity-security/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add wshobson/agents --skill solidity-security -a cursor2Manually: put the files in place
.cursor/skills/solidity-security/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install wshobson/agents solidity-security2Manually: put the files in place
.github/skills/solidity-security/SKILL.mdPlatform CLI
gemini skills install https://github.com/wshobson/agents --path plugins/blockchain-web3/skills/solidity-securityManually: put the files in place
.devin/skills/solidity-security/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set213
The whole set →Similar
Questions about solidity-security
How do I install solidity-security in Claude Code?
Run npx skills add wshobson/agents --skill solidity-security -a claude-code. The skill file is placed at ~/.claude/skills/solidity-security/SKILL.md.
What does solidity-security do?
It supports secure Solidity development and contract audits. The skill covers reentrancy, integer overflow, access control, attack vectors, and Hardhat security tests.
What security tests are included?
The source includes Hardhat examples for blocking reentrancy, preventing integer overflow, and rejecting unauthorized withdrawals.
Source text
SKILL.md · MIT
---
name: solidity-security
description: Master smart contract security best practices to prevent common vulnerabilities and implement secure Solidity patterns. Use when writing smart contracts, auditing existing contracts, or implementing security measures for blockchain applications.
---
# 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
```javascript
// 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",
);
});
});
```
## Audit Preparation
```solidity
contract WellDocumentedContract {
/**
* @title Well Documented Contract
* @dev Example of proper documentation for audits
* @notice This contract handles user deposits and withdrawals
*/
/// @notice Mapping of user balances
mapping(address => uint256) public balances;
/**
* @dev Deposits ETH into the contract
* @notice Anyone can deposit funds
*/
function deposit() public payable {
require(msg.value > 0, "Must send ETH");
balances[msg.sender] += msg.value;
}
/**
* @dev Withdraws user's balance
* @notice Follows CEI pattern to prevent reentrancy
* @param amount Amount to withdraw in wei
*/
function withdraw(uint256 amount) public {
// CHECKS
require(amount <= balances[msg.sender], "Insufficient balance");
// EFFECTS
balances[msg.sender] -= amount;
// INTERACTIONS
(bool success, ) = msg.sender.call{value: amount}("");
require(success, "Transfer failed");
}
}
```
© Seth Hobson · MIT · wshobson/agents