solidity-style

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

Updated Aug 10, 2026
One-click install
npx skills add https://github.com/isreal916/pistis --skill solidity-style-isreal916
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: solidity-style
Source: https://github.com/isreal916/pistis/tree/main/contracts/lib/openzeppelin-contracts/.claude/skills/solidity-style
Command: npx skills add https://github.com/isreal916/pistis --skill solidity-style-isreal916

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Solidity codebases accumulate inconsistent error handling, NatSpec documentation, import styles, and pragma versions that linters like solhint do not enforce. This Skill encodes the OpenZeppelin Contracts conventions so every .sol file you write or edit follows the same rules for errors, events, documentation, assembly, and inheritance. ## Core Features & Use Cases - Error and event conventions: Enforces ERC-6093 custom error naming, domain prefixes, error placement priority, and past-tense event naming emitted after state changes. - NatSpec and file structure rules: Standardizes @dev documentation, @inheritdoc overrides, named imports, file header ordering, and interface design rules for ERC specs. - Safety patterns: Covers memory-safe assembly annotation, numeric literal formatting, unchecked block invariants, SafeCast narrowing casts, and globally consistent inheritance ordering verified by CI. - Use Case: When adding a new ERC-20 extension contract, use this Skill to place custom errors in the right interface, write compliant NatSpec, order the file correctly, and run the pragma minimizer and inheritance checks 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 ERC<number> or the 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 library.

How should I document Solidity contracts with NatSpec?

Use @dev as the primary tag since it is the only tag rendered by the OpenZeppelin documentation engine. Document public and internal functions, events, errors, and constructors, and use @inheritdoc for pure relay overrides.

How do I choose the right Solidity pragma version for a file?

Run npm run pragma, which compiles each file against every candidate solc and writes back the lowest compatible version. The script picks >= for interfaces and ^ for implementations, respecting the 0.8.20 floor.

When is it safe to use unchecked blocks in Solidity?

Only use unchecked with an inline invariant comment naming the bound, such as why overflow is impossible. The comment can be omitted only when the reason is immediately apparent from the line directly above.

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 my Solidity inheritance order cause CI failures?

The relative order of bases in any is A, B, C list must be globally consistent across the library. After changing an is list, run npm run compile && npm run test:inheritance to detect conflicts against compiled artifacts.