← Catalog

No. 020 · code-quality

Semgrep Rules

Create and refine vulnerability detection rules

Version 1.0.0 License MIT Format SKILL.md

Write Semgrep rules that detect specific vulnerability patterns. Covers rule syntax, pattern matching, taint tracking, and testing rules against known-good and known-bad code.

When to use this skill

  • Writing a custom lint rule
  • Detecting a specific vulnerability pattern
  • Enforcing a coding standard

Core concepts

This skill provides guidance on semgrep rules best practices, patterns, and common pitfalls. It is designed to be loaded on demand when a relevant task is detected.

Installation

curl -LO https://opencode-skills.example/downloads/code-quality/semgrep-rules.zip
unzip semgrep-rules.zip -d ~/.config/opencode/skills/

Restart OpenCode — the skill loads automatically.

When it triggers

  • writing a custom lint rule
  • detecting a specific vulnerability pattern
  • enforcing a coding standard