solidity-style

Applies Solidity style and safety conventions when writing or editing contract source files.

1|Updated Jul 3, 2026
One-click install
npx skills add https://github.com/urufu-labs/urufu-launchpad --skill solidity-style-urufu-labs
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: solidity-style
Source: https://github.com/urufu-labs/urufu-launchpad/tree/main/contracts/lib/openzeppelin-contracts/.claude/skills/solidity-style
Command: npx skills add https://github.com/urufu-labs/urufu-launchpad --skill solidity-style-urufu-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Solidity codebases accumulate inconsistent error handling, NatSpec, imports, and pragma versions that linters like solhint do not enforce, leading to review friction and subtle safety bugs. This Skill encodes the OpenZeppelin contract conventions so every .sol file edit follows the same rules. ## Core Features & Use Cases - Error and event conventions: Enforces ERC-6093 custom errors with domain prefixes, correct declaration location, and past-tense event naming emitted after state changes. - NatSpec and file structure: Standardizes @dev documentation, named imports, SPDX/pragma ordering, and member ordering inside contract bodies. - Safety rules for low-level code: Governs assembly memory-safe annotations, numeric literal bases, unchecked blocks with invariant comments, SafeCast narrowing casts, and inheritance ordering verified by CI. - Use Case: When adding a new ERC-20 extension contract, apply these conventions to declare errors in the right interface, write compliant NatSpec, and run the pragma minimizer before committing. ## Quick Start Review my new Solidity contract under contracts/ and rewrite it to follow the project's style and safety conventions.

Frequently Asked Questions about solidity-style

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write custom errors in Solidity following ERC-6093?▼

Use if (condition) revert CustomError(args) with a domain prefix like the ERC number or component name, and include offending values as arguments. Declare the error in the interface or library that owns the concept, and never duplicate error names across the codebase.

What NatSpec tags should I use in Solidity contracts?▼

Use @dev as the primary tag since it is the only one rendered by the OpenZeppelin documentation engine. Reserve @notice, @param, and @return for interface files, and use @inheritdoc for pure relay overrides.

How do I choose the right Solidity pragma version?▼

Do not pick the pragma floor by hand; run npm run pragma, which compiles each file against candidate solc versions and writes back the lowest compatible version. The script selects >= for interfaces and ^ for implementations automatically.

When is it safe to use unchecked blocks in Solidity?▼

Only use unchecked with an inline comment naming the bound that makes overflow impossible, such as a value constrained by a balance or totalSupply. Reviewers should re-derive the bound for every code path reaching the block.

Can I use direct integer casts instead of SafeCast in Solidity?▼

Narrowing casts like uint256 to uint48 must use SafeCast.toUintXX. Direct Solidity casts are only permitted after an explicit bounds check on a line you can point to.

Why does inheritance ordering matter in Solidity contracts?▼

The relative order of base contracts in any is A, B, C list must be globally consistent across the project to avoid linearization conflicts. After changing an is list, run npm run compile and npm run test:inheritance to verify.