solidity-coding

Installation
SKILL.md

Solidity Coding Standards

Language Rule

  • Always respond in the same language the user is using. If the user asks in Chinese, respond in Chinese. If in English, respond in English.

Coding Principles

  • Compiler: Use solc 0.8.24 and pragma solidity ^0.8.24; consistently across the project
  • Dependencies: Use OpenZeppelin Contracts 5.0.2 and its 5.x APIs/import paths; manage imports with the project's Foundry configuration
  • Error Handling: Prefer custom errors over require strings — saves gas and is more expressive
    • Define: error InsufficientBalance(uint256 available, uint256 required);
    • Use: if (balance < amount) revert InsufficientBalance(balance, amount);
  • Documentation: All public / external functions must have NatSpec (@notice, @param, @return)
  • Event Indexing: Only add indexed to address type parameters — add comment if indexing other types
  • Special Keywords: immutable / constant / unchecked / assembly must have inline comment explaining why

Initialization Strategy

Installs
136
GitHub Stars
4
First Seen
Feb 9, 2026