This skill helps you follow Solidity best practices by enforcing NatSpec, file layout, naming conventions, and code style across contracts.
npx playbooks add skill kyzooghost/skills --skill developing-smart-contracts
Best practices for developing Solidity smart contracts. Contains
rules covering documentation, naming, structure, and code style.
Reference these guidelines when:
// SPDX-License-Identifier: Apache-2.0// SPDX-License-Identifier: AGPL-3.0| Priority | Category | Impact | Rule File |
| -------- | -------------- | -------- | ------------------------ |
| 1 | NatSpec | CRITICAL | rules/natspec.md |
| 2 | File Layout | HIGH | rules/file-layout.md |
| 3 | Naming | HIGH | rules/naming-conventions.md |
| 4 | Imports | MEDIUM | rules/imports.md |
| 5 | Visibility | MEDIUM | rules/visibility.md |
| 6 | General Rules | LOW | rules/general-rules.md |
ALWAYS use NatSpec for all public/external items.
@notice@param _paramName (in signature order)@return variableNameSee [rules/natspec.md](rules/natspec.md) for examples.
Interface structure:
Contract structure:
See [rules/file-layout.md](rules/file-layout.md) for templates.
| Item | Convention | Example |
| ----------------------- | ---------------- | -------------------------------- |
| Public state | camelCase | uint256 messageCount |
| Private/internal state | _camelCase | uint256 _internalCounter |
| Constants | UPPER_SNAKE_CASE | bytes32 DEFAULT_ADMIN_ROLE |
| Function params | _camelCase | function send(address _to) |
| Return variables | camelCase | returns (bytes32 messageHash) |
| Mappings | descriptive keys | mapping(uint256 id => bytes32) |
| Init functions | __Contract_init | __PauseManager_init() |
See [rules/naming-conventions.md](rules/naming-conventions.md) for details.
Always use named imports:
// CORRECT
import { IMessageService } from "../interfaces/IMessageService.sol";
// WRONG
import "../interfaces/IMessageService.sol";
See [rules/imports.md](rules/imports.md) for details.
internal unless explicitly needed publicexternal/public surface areathis.functionCall() patternSee [rules/visibility.md](rules/visibility.md) for details.
pnpm run lint:fix before committingSee [rules/general-rules.md](rules/general-rules.md) for deployment, testing, and more.
Before submitting a PR:
@notice, @param, @return)internal unless needed publicpnpm run lint:fix)Read individual rule files for detailed explanations and code examples:
rules/natspec.md
rules/file-layout.md
rules/naming-conventions.md
Each rule file contains:
For the complete guide with all rules expanded: [AGENTS.md](AGENTS.md)
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.