semgrep-rule-creator

Generate and validate Semgrep rules with YAML and test files.

Updated Mar 17, 2026
One-click install
npx skills add https://github.com/Avi977/ace-claude-toolkit --skill semgrep-rule-creator-avi977
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: semgrep-rule-creator
Source: https://github.com/Avi977/ace-claude-toolkit/tree/main/skills/semgrep-rule-creator
Command: npx skills add https://github.com/Avi977/ace-claude-toolkit --skill semgrep-rule-creator-avi977

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing Semgrep rules and validating them is error-prone and slow without a guided workflow.

Core Features & Use Cases

  • Test-driven rule development: write tests before deploying patterns to catch false positives and ensure coverage.
  • Structured rule delivery: each rule lives in its own directory with a YAML rule and a test file.
  • Cross-language safety patterns: supports taint analysis and pattern-based rules to detect security issues across languages.

Quick Start

Use the semgrep-rule-creator to scaffold, test, and validate a new rule against your codebase.

Frequently Asked Questions about semgrep-rule-creator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write and validate Semgrep rules for security vulnerabilities?

To write and validate Semgrep rules, use a test-driven workflow that generates a rule YAML and a test file together, ensuring detections for security vulnerabilities are reliable and catch false positives before deployment.

What is taint analysis in static analysis and when do I need it for code patterns?

Taint analysis in static analysis tracks untrusted data flow through code to detect security issues. You need it when pattern-based matching is insufficient for tracing vulnerabilities across complex function calls.

How to create Semgrep rules with test files included?

Create Semgrep rules with test files by enforcing a one-rule-per-directory workflow, outputting both the rule YAML and its corresponding test file simultaneously to validate pattern matching and ensure coverage.

Does this test-driven rule development support cross-language static analysis?

Yes, test-driven rule development supports cross-language static analysis by applying pattern-based rules and taint analysis to detect security issues consistently across multiple programming languages.

What is the best way to structure Semgrep rules for maintainable detections?

The best way to structure Semgrep rules for maintainable detections is a one-rule-per-directory workflow, isolating each rule YAML with its mandatory test file to ensure repeatable validation and long-term reliability.

Why do my Semgrep rules have false positives and how do I prevent them?

Semgrep rules produce false positives when deployed without validation; prevent them by writing tests before deploying patterns to catch incorrect matches and ensure accurate code pattern coverage.