Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

semgrep-rule-creator

Skill by sickn33

Creates custom Semgrep rules that detect security vulnerabilities, bug patterns and code patterns. It is for developers and security engineers who write their own static analysis checks.

  • Score 90
  • 51k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install semgrep-rule-creator

Built from the published package, never by AI.

git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/semgrep-rule-creator ~/.claude/skills/semgrep-rule-creator

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install semgrep-rule-creator in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

The semgrep-rule-creator skill helps an AI assistant write custom Semgrep rules for security vulnerabilities, bug patterns and code patterns. It follows a strict, test-first workflow: analyze the problem, write tests, inspect the AST, write the rule, then iterate until semgrep --test passes. Taint mode is preferred for data flow issues, with pattern matching as an alternative.

Each rule is delivered as exactly two files in a directory named after the rule ID: a YAML rule file and a test file with ruleid and ok annotations. The skill tells the assistant to read current Semgrep documentation before writing rules. It is aimed at developers and security engineers who build custom static analysis detections. It is not meant for running existing rulesets.

Written from the project's SKILL.md and checked against it.

What it can do

  • Taint mode rulesWrites data flow rules that track untrusted input from sources to dangerous sinks.
  • Pattern matching rulesWrites syntactic Semgrep patterns when no data flow tracking is needed.
  • Test-first workflowWrites ruleid and ok test cases before writing the rule itself.
  • Test executionRuns semgrep --test against the rule and test file until all tests pass.
  • Rule and test outputProduces a YAML rule and a matching test file in a directory named after the rule ID.
  • Documentation lookupFetches current Semgrep documentation on rule syntax, pattern syntax and data flow before writing rules.

What you need

  • Semgrep CLI
  • Bash access to run semgrep --test
  • Read and write access to the rule directory

Try asking

  • Write a Semgrep taint rule that flags request input passed to eval in Python
  • Create a Semgrep rule and test file for os.system calls built from user input
  • Write a Semgrep rule that enforces a coding standard in my Python project

Good to know

  • Only SKILL.md is bundled, so quick-reference.md and workflow.md are unavailable.
  • Each YAML file must contain only one rule.
  • Rules for a specific language must not use languages: generic.
  • todoruleid and todook test annotations are forbidden.

Security check

B
  • Allowed to use Bash, Write, Edit without limitsIn SKILL.md

Checked automatically: skills/semgrep-rule-creator/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

Allowed tools: BashReadWriteEditGlobGrepWebFetch

  • SKILL.md8 KB

Alternatives to semgrep-rule-creator

All alternatives →

Compare with function_health, windows-privilege-escalation or github-actions-advanced

semgrep-rule-creator: common questions

Does this skill run existing Semgrep rulesets?

No. The source says not to use it for running existing rulesets, and points to the static-analysis skill for general analysis without custom rules.

What files does it create for each rule?

Exactly two files in a directory named after the rule ID: a YAML rule file and a test file with ruleid and ok annotations.

Why does the skill prefer taint mode?

The source says taint mode tracks data flow from untrusted input to a sink, which gives better precision than plain pattern matching for injection issues.

How do I install semgrep-rule-creator?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is semgrep-rule-creator free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is semgrep-rule-creator safe to use?

It scores 90 of 100. Grades: maintenance A, licence A, quality A. Security check: grade B (allowed to use bash, write, edit without limits). Review the code before you install. How grades work.

What are alternatives to semgrep-rule-creator?

Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.

semgrep-rule-creator Install

Add to stack

Loading.