semgrep-rule-creator

Create Semgrep rules using a test-first methodology with AST analysis and taint mode.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/keremtoker468-dotcom/restoran --skill semgrep-rule-creator-keremtoker468-dotcom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: semgrep-rule-creator
Source: https://github.com/keremtoker468-dotcom/restoran/tree/main/.claude/skills/semgrep-rule-creator
Command: npx skills add https://github.com/keremtoker468-dotcom/restoran --skill semgrep-rule-creator-keremtoker468-dotcom

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation of custom Semgrep rules, ensuring they are well-tested, accurate, and adhere to best practices for detecting security vulnerabilities and code patterns.

Core Features & Use Cases

  • Rule Development: Guides users through writing Semgrep rules for specific bug patterns, security vulnerabilities, or coding standards.
  • Test-Driven Approach: Emphasizes writing tests first and iterating until all test cases pass, minimizing false positives and negatives.
  • Taint Mode Prioritization: Recommends and guides the use of taint mode for precise data flow analysis.
  • Use Case: A security engineer needs to create a new Semgrep rule to detect instances where user input is directly passed to an eval() function in Python. This Skill will guide them through defining the rule, writing vulnerable and safe test cases, and ensuring the rule is effective.

Quick Start

Use the semgrep-rule-creator skill to write a new Semgrep rule for detecting insecure deserialization in Python.

Frequently Asked Questions about semgrep-rule-creator

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

FAQPage Schema
How do I create custom Semgrep rules for static analysis?

To create custom Semgrep rules for static analysis, you need to define patterns or taint mode configurations that match specific code structures. This process involves AST analysis, writing syntax patterns, and optimizing rules to detect security vulnerabilities accurately.

What is the best way to write Semgrep rules for vulnerability detection?

The best way to write Semgrep rules for vulnerability detection is to prioritize taint mode for precise data flow tracking. This approach maps how untrusted user input travels to dangerous sinks, minimizing false positives and negatives while enforcing production-quality code analysis.

How do I test Semgrep rules to minimize false positives?

You minimize false positives in Semgrep rules by adopting a test-driven approach: write vulnerable and safe test cases first, then iterate on your AST patterns until all cases pass. This ensures your static analysis rules are accurate before production deployment.

When should I use taint mode instead of pattern matching in Semgrep?

You should use taint mode in Semgrep when you need to trace untrusted user input flowing through an application to dangerous sinks, such as eval functions. Pattern matching is better suited for matching isolated, static bug patterns or enforcing specific coding standards.

Can I use Semgrep rules to enforce internal coding standards?

Yes, you can write Semgrep rules to enforce internal coding standards by defining pattern matches for specific code structures. Guiding AST analysis allows you to target and flag deviations from your required formatting and structural conventions during static analysis.