solidity-best-practices

solidity-best-practices is a skill for Claude Code, Codex from nirholas/three.ws. It costs 29 tokens per session (1,109 once invoked), scanned A, original, Apache-2.0.

A guide to writing Solidity smart contracts that are secure, use less blockchain gas, and remain easier to maintain. Solidity is the programming language commonly used for contracts on Ethereum-compatible blockchains.

In plain words
What is it for?
Designing contracts, reviewing Solidity code, organizing projects, applying coding conventions, and improving gas usage.
Why use it?
It helps avoid common coding mistakes and inconsistent project structures that can cause security problems, higher transaction costs, or harder maintenance.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Designing contracts, reviewing Solidity code, organizing projects, applying coding conventions, and improving gas usage.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nirholas/three.ws/solidity-best-practices
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.

Any agent
npx skills add nirholas/three.ws --skill solidity-best-practices
Clone the repo
git clone --depth 1 https://github.com/nirholas/three.ws

Made for: Claude Code, Codex.

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-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/nirholas/three.ws/solidity-best-practices/github.svg)](https://agentmods.dev/skills/nirholas/three.ws/solidity-best-practices)
Your own site
<a href="https://agentmods.dev/skills/nirholas/three.ws/solidity-best-practices"><img src="https://agentmods.dev/badge/skills/nirholas/three.ws/solidity-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for solidity-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/nirholas/three.ws/solidity-best-practices"><img src="https://agentmods.dev/badge/skills/nirholas/three.ws/solidity-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,109 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00029 $0.01109
Opus 5.5 $0.00012 $0.00444
Sonnet 5.5 $0.00006 $0.00222
Haiku 4.5 $0.00003 $0.00111

Measured 2mo ago against content hash 7b51e86e0251, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

solidity-best-practices 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 2mo 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.

data/skills/development/solidity-best-practices/SKILL.md · 103 lines

How it starts

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

Solidity Best Practices

When to use this skill

Use when the user asks about:

  • Writing or reviewing Solidity code
  • Smart contract design patterns
  • Gas optimization techniques in Solidity
  • Security best practices for contract development
  • Structuring a Solidity project

Development Guidelines

1. Project Structure

Recommended contract organization:

  • contracts/ — main contract source files
  • contracts/interfaces/ — interface definitions (IProtocol.sol)
  • contracts/libraries/ — shared library code
  • contracts/utils/ — utility contracts (access control, pausable, etc.)
  • test/ — test files mirroring the contracts directory structure
  • script/ — deployment and interaction scripts

2. Coding Standards

Follow these Solidity style conventions:

  • Use Solidity 0.8.x or later (built-in overflow checks)
  • Specify exact compiler version with pragma solidity 0.8.24; (not floating ^)
  • Order contract elements: state variables, events, errors, modifiers, constructor, external, public, internal, private functions
  • Use custom errors instead of require strings (saves gas): error InsufficientBalance(uint256 available, uint256 required);
  • Use immutable for variables set once in the constructor
  • Use constant for compile-time known values
  • Prefix internal/private functions with underscore: _validateInput()
  • Use NatSpec comments for all public/external functions

3. Gas Optimization Patterns

High-impact optimizations:

  • Storage packing: Group variables smaller than 32 bytes together in a single storage slot (e.g., uint128 a; uint128 b; uses one slot vs two for uint256)
  • Calldata over memory: Use calldata for external function array/struct parameters that are read-only
  • Caching storage reads: Read a storage variable into a local variable if accessed multiple times in a function
  • Short-circuit conditions: Place cheap checks before expensive ones in require chains
  • Unchecked math: Use unchecked {} for arithmetic that provably cannot overflow (e.g., loop counters)
  • Avoid zero-to-nonzero writes: Initializing a storage slot from 0 costs 20,000 gas vs 5,000 for nonzero-to-nonzero
  • Use mappings over arrays when you don't need iteration — mappings have O(1) access
  • Batch operations: Combine multiple operations into single transactions where possible

Read the full file on GitHub · 103 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. 2mo ago First seen · 103 lines · 29 tokens per session scan A 7b51e86e0251

Subscribe to this mod's changes

solidity-best-practices is a skill published in the GitHub repository nirholas/three.ws (287 stars, last pushed yesterday), licensed Apache-2.0. It adds 29 tokens to every session and 1,109 once invoked, about $0.0001 per session on Opus 5.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

solidity-best-practices compared with skills from other repositories

solidity-best-practices next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
solidity-best-practicesnirholas/three.wsSkill287yesterdayApache-2.0A29Claude Code, Codex
pay-x402-servicenirholas/x402-payments-mcpSkill919d agoApache-2.0A51Claude Code
granite-pay-per-callnirholas/ibm-x402-mcpSkill919d agoApache-2.0A49Claude Code
pumpfun-token-researchnirholas/pumpfun-claims-botSkill2511d agononeA59Claude Code
jupiter-vrfdinternet-court/internet-court-skillSkill7.2k6d agononeA45Claude Code
vybe-token-market-intelvybenetwork/solana-mcp-vybeSkill3.2k3d agononeA60Claude Code, Codex
solana-security-reviewYD811/potbot-v2Skill223d agoMITA75Claude Code, Codex