---
name: "solhint-linter-best-practices"
description: "Enforce Solidity code quality, style guides, and security rules with Solhint."
metadata:
  author: "Protofire"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "run solhint linter"
  - "configure .solhint.json"
  - "fix solidity security warnings"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Solhint Solidity Linter & Security Rule Sets

Lints smart contracts with Solhint: enforcing compiler version pragma rules, gas optimization warnings, avoiding tx.origin, and enforcing OpenZeppelin and ConsenSys security guidelines.

## When to Invoke
Invoke this skill whenever you need to:
- run solhint linter
- configure .solhint.json
- fix solidity security warnings

## Execution SOP & Rules
1. Initialize configuration: npx solhint --init.
2. Extend recommended security rules: { 'extends': 'solhint:recommended' } in .solhint.json.
3. Run npx solhint 'contracts/**/*.sol' in CI pipelines.
4. Forbid use of tx.origin for authorization; use msg.sender exclusively.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
