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 vigolium

Creates custom Semgrep rules that detect security vulnerabilities, bug patterns and code patterns. Built for developers and security engineers who need their own static analysis detections.

  • Score 83
  • 1.2k stars
  • NOASSERTION
  • 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/vigolium/vigolium /tmp/vigolium && mkdir -p ~/.claude/skills && cp -r /tmp/vigolium/platform/vigolium-audit/src/content/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, iterate until tests pass, then optimize. Taint mode is preferred for data flow issues where untrusted input reaches a dangerous sink, while pattern matching is used for simple syntactic patterns.

Each rule is delivered as a directory named after the rule ID, containing a YAML rule file and a test file with ruleid and ok annotations. The skill requires safe-case tests, one rule per YAML file and specific patterns rather than broad ones. It is intended for developers and security engineers writing custom static analysis detections. It is not meant for running existing Semgrep rulesets.

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

What it can do

  • Problem analysisAnalyzes the bug pattern or vulnerability before any rule is written.
  • Test-first rule writingWrites ruleid and ok test cases before writing the Semgrep rule.
  • Taint mode rulesBuilds data flow rules that track untrusted input to dangerous sinks.
  • Pattern matching rulesWrites syntactic pattern rules for simple code patterns without data flow.
  • AST structure analysisInspects the AST to see how Semgrep parses the code before writing patterns.
  • Test iterationRuns semgrep --test and repeats until all tests pass.
  • Rule optimizationSimplifies patterns after all tests pass and re-runs the tests.
  • Rule packagingOutputs exactly two files in a directory named after the rule ID.

What you need

  • Semgrep CLI
  • WebFetch access to Semgrep documentation

Try asking

  • Write a Semgrep taint mode rule for user input passed to eval() in Python
  • Create a Semgrep rule and test file for a custom bug pattern in my code
  • Build a Semgrep rule that flags dangerous os.system calls with tests

Good to know

  • Each YAML file must contain only one Semgrep rule
  • Rules targeting a specific language must not use languages: generic
  • The todook and todoruleid test annotations are forbidden
  • Not for running existing Semgrep rulesets; use the static-analysis skill for that

Security check

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

Checked automatically: platform/vigolium-audit/src/content/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.md7 KB
  • references/quick-reference.md5 KB
  • references/workflow.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 prefer taint mode or pattern matching?

It prioritizes taint mode for data flow vulnerabilities. Pattern matching is used for simple syntactic patterns, and the workflow allows switching between the two if one approach is not working.

How are the generated rules tested?

Tests are written first and run with semgrep --test. The workflow requires a 100% pass rate and includes safe cases marked with ok annotations to catch false positives.

What files does the skill produce for each rule?

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

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 NOASSERTION licence. The service it connects to may have its own pricing.

Is semgrep-rule-creator safe to use?

It scores 83 of 100. Grades: maintenance A, licence F, 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.