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 JantonioFC

Creates custom Semgrep rules for detecting security vulnerabilities, bug patterns, and code patterns. It is for developers who write Semgrep rules or build custom static analysis checks.

  • Score 67
  • 8 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/JantonioFC/skillsbank /tmp/skillsbank && mkdir -p ~/.claude/skills && cp -r /tmp/skillsbank/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

This skill guides an AI assistant through writing custom Semgrep rules. It follows a test-first workflow: the assistant reads the Semgrep documentation, writes test files with ruleid and ok annotations, analyzes the AST, writes the rule, and iterates until the tests pass. Each rule is saved as a directory with one YAML rule file and one test file.

The skill prefers taint mode for data flow issues, where untrusted input reaches a dangerous sink, and uses pattern matching for simple syntactic patterns. It is meant for developers who want to write Semgrep rules for specific bug patterns, security issues, or coding standards in their own codebase. Running existing Semgrep rulesets is not covered and should use another skill.

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 simple syntactic Semgrep rules when data flow tracking is not needed.
  • Test file creationCreates test files with ruleid and ok annotations for vulnerable and safe cases.
  • Test-first workflowRequires tests before rules and runs semgrep --test until all tests pass.
  • Documentation readingReads the Semgrep rule syntax, pattern syntax, and data flow docs before writing rules.
  • Rule structure checksEnforces one rule per YAML file and a fixed two-file output per rule directory.

What you need

  • Semgrep CLI, since the workflow runs semgrep --test
  • Access to WebFetch to read the Semgrep documentation links

Try asking

  • Write a Semgrep taint rule that flags user input passed to eval in Python.
  • Create a Semgrep rule and test file for a bug pattern in my Python code.
  • Add safe and vulnerable test cases with ruleid and ok annotations for my rule.

Good to know

  • Each YAML file must contain only one Semgrep rule.
  • Generic language rules (languages: generic) are not allowed when a specific language is targeted.
  • The todoruleid and todook test annotations are forbidden.
  • Not for running existing Semgrep rulesets.

Security check

A

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

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

Alternatives to semgrep-rule-creator

All alternatives →

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

semgrep-rule-creator: common questions

What does the semgrep-rule-creator skill do?

It helps an AI assistant write custom Semgrep rules for security vulnerabilities, bug patterns, and code patterns, with tests for each rule.

Does it prefer taint mode or pattern matching?

The skill prioritizes taint mode for data flow vulnerabilities. It uses pattern matching for simple syntactic patterns that do not need data flow tracking.

What files does it create for each rule?

It creates a directory named after the rule ID with one YAML file for the Semgrep rule and one 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 MIT licence. The service it connects to may have its own pricing.

Is semgrep-rule-creator safe to use?

It scores 67 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.