semgrep-solidity

Installation
SKILL.md

Semgrep for Solidity

Semgrep is a lightweight static analysis tool that matches code patterns you define. For Solidity, it lets you write custom detection rules in YAML that catch vulnerabilities, anti-patterns, and protocol-specific bugs that generic analyzers miss. The killer combination: community rulesets for known issues + custom rules for your project's invariants.

What You Probably Got Wrong

LLMs hallucinate Semgrep features and misunderstand its Solidity support. These are the real facts.

  • Solidity support is community-driven, not official Semgrep Inc — Semgrep's Solidity parser is maintained by the community (tree-sitter-solidity). It works well for pattern matching but occasionally lags behind bleeding-edge Solidity syntax. Semgrep Inc focuses on their supported languages (Python, JS, Go, etc.) — Solidity is "community-supported."
  • decurity/semgrep-smart-contracts is the go-to ruleset — This is the most comprehensive open-source Semgrep ruleset for Solidity. It covers reentrancy, access control, unsafe delegatecall, unchecked return values, and more. Start here before writing your own rules.
  • Semgrep finds patterns, not bugs — Semgrep matches AST patterns you define. It does not reason about program state, symbolic execution, or constraint solving like Mythril or Manticore. If you don't write a rule for it, Semgrep won't find it.
  • Taint tracking is the killer feature — Semgrep's mode: taint lets you trace data flow from sources to sinks. This is how you detect "user input reaches dangerous operation" patterns that simple grep cannot catch.
  • Semgrep is NOT a replacement for Slither — Slither has 90+ built-in detectors with deep Solidity understanding (inheritance resolution, state variable tracking, CFG analysis). Semgrep excels at custom rules you write for YOUR codebase. Use both.
  • Autofix is real but limited — Semgrep can auto-apply fixes via the fix: key in rules. It works for simple pattern replacements but cannot handle complex refactoring.
  • --config auto does not include Solidity rules — Semgrep's auto config pulls from the Semgrep Registry, which has limited Solidity coverage. You need to point at specific rulesets or write your own.

Installation

Installs
1
First Seen
Aug 4, 2026
semgrep-solidity — justaname-id/cryptoskills