Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

solidity-style

Skill by OpenZeppelin

Gives an AI assistant OpenZeppelin's Solidity style and safety conventions for .sol files under contracts/. Covers errors, events, NatSpec, imports, assembly, unchecked blocks and casts.

  • Score 91
  • 27k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install solidity-style

Built from the published package, never by AI.

git clone --depth 1 https://github.com/OpenZeppelin/openzeppelin-contracts /tmp/openzeppelin-contracts && mkdir -p ~/.claude/skills && cp -r /tmp/openzeppelin-contracts/.claude/skills/solidity-style ~/.claude/skills/solidity-style

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install solidity-style in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

The solidity-style skill gives an AI assistant the style and safety conventions for Solidity contract source files. It applies when writing or editing any .sol file under contracts/. The skill covers custom errors, events, NatSpec tags, imports, file order, assembly, unchecked blocks, narrowing casts, numeric literal formatting and inheritance ordering.

The source states that these conventions are not enforced by solhint, and it points to the project root CLAUDE.md for lint-enforced rules. It gives guidance such as preferring require with custom errors on pragma ^0.8.27 or later, using SafeCast for narrowing casts, and running npm run pragma to find the lowest compiling pragma. It is aimed at developers and contributors writing or reviewing Solidity in OpenZeppelin-style codebases.

Written from the project's SKILL.md and checked against it.

What it can do

  • ErrorsSets rules for custom errors, including require with custom errors and ERC-6093 naming.
  • EventsRequires emitting events after state changes, with past-tense CapWords names.
  • NatSpecDefines which NatSpec tags to use, such as @dev, and how to document overrides.
  • Imports and file structureSets named curly-brace imports, relative paths and the order of file contents.
  • AssemblyRequires memory-safe annotations and rules for hexadecimal and decimal literals.
  • Unchecked blocksRequires an invariant comment that names the bound for each unchecked block.
  • CastingRequires SafeCast for narrowing integer casts unless a bounds check is shown.
  • Inheritance orderingExplains keeping base order consistent and running the inheritance test after changes.

What you need

  • npm project with the scripts named in the source (npm run compile, npm run pragma, npm run test:inheritance)

Try asking

  • Write a new Solidity contract under contracts/ that follows the project's error conventions.
  • Review this .sol file for unchecked blocks and narrowing casts that break the style rules.
  • Add NatSpec @dev tags and events to this contract following the solidity-style conventions.

Good to know

  • The conventions are not enforced by solhint.
  • Files with a procedurally generated header should be edited through the templates, not directly.
  • The release-managed header line should not be added or edited by hand.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .claude/skills/solidity-style/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md9 KB

Alternatives to solidity-style

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

solidity-style: common questions

When should I use require instead of if with revert in Solidity?

The source says to prefer require(condition, CustomError(args)) in files with pragma ^0.8.27 or later. Keep if with revert when the pragma is lower, when error arguments are more than simple values, or when the check is part of an if/else chain.

How does the skill handle casting between integer types?

Any narrowing integer cast must use SafeCast.toUintXX() or the matching toIntXX function. Direct casts are allowed only after an explicit bounds check on a line that can be pointed to.

Who is this skill for?

The source describes it as conventions for contract source files under contracts/, so it targets developers writing or editing Solidity in that layout.

How do I install solidity-style?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is solidity-style free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is solidity-style safe to use?

It scores 91 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to solidity-style?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

solidity-style Install

Add to stack

Loading.