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 chetto1983

Creates custom Semgrep rules for detecting security vulnerabilities, bug patterns, and code patterns. Built for developers who write Semgrep rules or custom static analysis detections.

  • Score 74
  • 36 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/chetto1983/Aura /tmp/Aura && mkdir -p ~/.claude/skills && cp -r /tmp/Aura/.claude/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 guides an AI assistant through writing custom Semgrep rules. It follows a strict workflow: analyze the problem, write tests first, analyze the AST structure, write the rule, iterate until all tests pass, then optimize. It prioritizes taint mode for data flow issues where untrusted input reaches a dangerous sink.

Each rule is delivered as a directory named after the rule ID, containing one YAML rule file and one test file with ruleid and ok annotations. Tests are run with semgrep --test. The skill tells the assistant to read seven Semgrep and Trail of Bits documentation pages before writing rules. It is aimed at people who write custom Semgrep rules, not at running existing rulesets.

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

What it can do

  • Test-first rule workflowWrites test files before the rule and requires all tests to pass.
  • Taint mode rulesBuilds data flow rules that track untrusted input from sources to sinks.
  • Pattern matching rulesWrites simple syntactic Semgrep patterns when data flow is not needed.
  • AST analysisInspects how Semgrep parses code before writing the rule patterns.
  • Rule testingVerifies rules with semgrep --test using ruleid and ok annotations.
  • Rule packagingOutputs one YAML rule file and one test file in a directory named after the rule ID.

What you need

  • Semgrep CLI for running semgrep --test
  • WebFetch access to read Semgrep documentation

Try asking

  • Write a Semgrep taint rule that flags user input reaching eval() in Python
  • Create a Semgrep rule and tests for hardcoded API keys in my Python code
  • Build a custom Semgrep rule to enforce a coding standard in my project

Good to know

  • Does not run existing Semgrep rulesets
  • Allows one rule per YAML file and forbids generic language rules
  • Forbids todook and todoruleid test annotations

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .claude/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: Bash Read Write Edit Glob Grep WebFetch

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 rules?

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

What files does it produce 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 this skill prioritize taint mode?

The source says taint mode tracks data flow, so it alerts only when untrusted data reaches a sink. This reduces false positives for injection vulnerabilities.

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 74 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. 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.