Solidity Security

SkillSecurity

Solidity-security is a skill that gives an AI agent knowledge of smart contract security best practices. It guides the agent to write and audit smart contracts using secure Solidity patterns and to avoid common vulnerabilities when building blockchain applications.

Use Solidity Security in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add Solidity Security and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the Solidity Security skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Have an agent setup that supports loading skills.

Solidity SecurityStart free

What your AI can do with it

  • Apply smart contract security best practices while writing contracts
  • Audit existing contracts for common vulnerabilities
  • Implement secure Solidity patterns
  • Support security measures for blockchain applications

Getting started

  1. Have an agent setup that supports loading skills.
  2. Add the solidity-security skill to the agent's available skills.
  3. Ask the agent to write, audit, or add security measures to a smart contract, and it will apply the skill.

What this skill tells your AI

The instructions your AI receives, as published by wshobson/agents in plugins/blockchain-web3/skills/solidity-security/SKILL.md and read by ahel’s review.

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",
    );
  });
});

Audit Preparation

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");
    }
}

Signals

GitHub stars
40k
Forks
4k
Last commit
Sep 2026

Questions

When should this skill be used?
Use it when writing smart contracts, auditing existing contracts, or implementing security measures for blockchain applications.
What does the skill cover?
It covers smart contract security best practices, common vulnerabilities to prevent, and secure Solidity patterns.
Advanced
Item type
skill
Key
solidity-security-wshobson
Source
github.com/wshobson/agents