Solidity smart contract development guidelines for Linea blockchain. Use when writing, reviewing, or refactoring Solidity contracts, or when the user asks about Solidity best practices, contract structure, or NatSpec docstrings. Covers NatSpec documentation, naming conventions, file layout, and code style.
91
86%
Does it follow best practices?
Impact
99%
1.47xAverage score across 3 eval scenarios
Passed
No known issues
Best practices for developing Solidity smart contracts on Linea blockchain. Contains rules covering documentation, naming, structure, and code style.
Reference: Linea Contract Style Guide
Reference these guidelines when:
// SPDX-License-Identifier: Apache-2.0 OR MIT
0.8.33 (exact)^0.8.33 (caret)| Priority | Category | Impact | Rule File |
|---|---|---|---|
| 1 | Gas optimization | CRITICAL | rules/gas-optimization.md |
| 2 | NatSpec Docstrings | HIGH | rules/natspec.md |
| 3 | File Layout | HIGH | rules/file-layout.md |
| 4 | Naming | HIGH | rules/naming-conventions.md |
| 5 | Imports | MEDIUM | rules/imports.md |
| 6 | Visibility | MEDIUM | rules/visibility.md |
| 7 | General Rules | MEDIUM | rules/general-rules.md |
Read individual rule files for detailed explanations and code examples (correct and incorrect).
Gas efficiency is critical for Linea contracts. Apply these rules unless there is a documented safety, audit, or readability reason to deviate.
See rules/gas-optimization.md for details.
ALWAYS use NatSpec docstrings for all public/external items.
Consult rules/natspec.md for NatSpec docstring rules and examples
Interface structure:
Contract structure:
See rules/file-layout.md for templates.
See rules/naming-conventions.md for symbol naming conventions.
Always use named imports. Always insert a blank line after imports.
See rules/imports.md for details.
See rules/visibility.md for rules on applying visibility modifiers (internal, external, public, etc).
See rules/general-rules.md for inheritance and general style rules
Before making a commit, please verify:
@notice, @param, @return)rules/*.md have been appliedpnpm -F contracts run lint:fix)For commands for testing and linting, refer to rules/commands.md
8ff65cd
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.