semgrep-rule-creator

Generate custom Semgrep rules with test-first iterative validation.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/monmacllcapp/skill-forks --skill semgrep-rule-creator-monmacllcapp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: semgrep-rule-creator
Source: https://github.com/monmacllcapp/skill-forks/tree/main/skills/security/plugins/semgrep-rule-creator/skills/semgrep-rule-creator
Command: npx skills add https://github.com/monmacllcapp/skill-forks --skill semgrep-rule-creator-monmacllcapp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of custom Semgrep rules, ensuring accurate detection of security vulnerabilities and code patterns without false positives.

Core Features & Use Cases

  • Rule Generation: Guides users through writing production-quality Semgrep rules.
  • Test-Driven Development: Enforces writing tests before rules, ensuring robustness.
  • Taint Mode Prioritization: Guides users on effectively using taint mode for data flow analysis.
  • Use Case: You need to detect a specific type of insecure deserialization in your Python codebase. This Skill will help you write a precise Semgrep rule, including test cases for both vulnerable and safe code, to catch this vulnerability.

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 write a custom Semgrep rule to detect security vulnerabilities?

Writing custom Semgrep rules involves a test-first, iterative approach to detect security vulnerabilities accurately. You generate rules using pattern matching or taint mode analysis, prioritizing taint mode for data flow vulnerabilities and AST analysis for pattern precision to avoid false positives.

What is taint mode in static analysis and when should I use it for Semgrep rules?

Taint mode in static analysis tracks data flow from sources to sinks. You should use taint mode for Semgrep rules when detecting security vulnerabilities involving data propagation, as it prioritizes tracking data flow vulnerabilities more effectively than simple pattern matching.

How do I test Semgrep rules to ensure they catch code patterns without false positives?

You test Semgrep rules by enforcing a test-driven development approach, writing test cases for both vulnerable and safe code before generating the rule. This validation protocol ensures your rule accurately detects target code patterns without triggering false positives.

Does this Semgrep rule generation approach support pattern matching for code quality checks?

Yes, this approach supports pattern matching for code quality checks alongside taint mode analysis. It emphasizes AST analysis to ensure pattern precision, allowing you to detect specific insecure code patterns and enforce code quality standards accurately.

What is the best way to create Semgrep rules for detecting insecure deserialization in Python?

The best way to create Semgrep rules for insecure deserialization in Python is using a test-first, iterative approach. You write test cases for vulnerable and safe code, then generate rules using taint mode to track data flow and ensure accurate vulnerability detection.