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.
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-creatorRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/chetto1983/Aura /tmp/Aura && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/Aura/.claude/skills/semgrep-rule-creator ~/.gemini/antigravity-cli/skills/semgrep-rule-creatorAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install semgrep-rule-creator in Antigravity CLI
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
ANo 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 →Retrieves lab biomarker results and clinician notes from Function Health through its FHIR API. It is for people who want an AI assistant to review their own lab history and notes.
Gives an AI assistant a methodology for finding and exploiting privilege escalation weaknesses on Windows systems during authorized penetration tests. It is for security testers and defenders validating escalation paths.
Guides the assistant through designing, debugging and hardening GitHub Actions CI/CD workflows. It is aimed at teams that run production pipelines on GitHub.
Develops evidence-backed structural security hardening proposals from disclosures, findings, source code, or Codex Security scans. It is for teams that need systemic fixes and architectural tradeoffs.
Claude Security scans code for security issues with Claude Code. It covers whole repositories, branch or pull request diffs, single commits, and existing findings from SARIF files or earlier reports.
Turns vulnerability notes, disclosure reports, PoCs, source code, or Codex Security findings into self-contained vulnerability reports. Built for security researchers who need claims the evidence supports.
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.
