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

  • Pragma: Use pragma solidity ^0.8.19; — keep consistent across all files in the project
  • Dependencies: OpenZeppelin Contracts 4.9.x, manage imports via remappings.txt
  • 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

Event Design Patterns

Related skills

More from 0xlayerghost/solidity-agent-kit

Installs
74
GitHub Stars
2
First Seen
Feb 9, 2026