semgrep-rule-creator

Generate custom Semgrep rules for security vulnerabilities using test-first development.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/ofelixdev/cc-kit --skill semgrep-rule-creator-ofelixdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: semgrep-rule-creator
Source: https://github.com/ofelixdev/cc-kit/tree/main/template/skills/semgrep-rule-creator
Command: npx skills add https://github.com/ofelixdev/cc-kit --skill semgrep-rule-creator-ofelixdev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of custom Semgrep rules, enabling precise detection of security vulnerabilities, bug patterns, and code standards within your codebase.

Core Features & Use Cases

  • Rule Generation: Guides users through writing production-quality Semgrep rules, including taint mode rules.
  • Test-Driven Development: Enforces writing tests before rules and ensures all tests pass.
  • Pattern Optimization: Assists in refining rules for accuracy and efficiency.
  • Use Case: You need to detect a specific type of insecure deserialization vulnerability in your Python application. This Skill will help you write a precise Semgrep rule to catch it, complete with test cases for both vulnerable and safe code.

Quick Start

Use the semgrep-rule-creator skill to generate 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 custom Semgrep rules for security vulnerabilities?

Creating custom Semgrep rules involves a test-first approach where you define vulnerable and safe code cases, analyze the AST, and write patterns. Taint mode is prioritized for tracking data flow vulnerabilities during static analysis.

What is taint mode in Semgrep and when should I use it?

Taint mode in Semgrep tracks data flow from untrusted sources to dangerous sinks to detect vulnerabilities. Use taint mode when analyzing data flow vulnerabilities, such as insecure deserialization, where user input triggers a security flaw.

How do I test Semgrep rules for static analysis before deploying them?

Test Semgrep rules by adopting a test-driven development approach, writing vulnerable and safe code samples in Python, YAML, or Bash. Ensure all tests pass to validate pattern accuracy and optimization before deployment.

Can I use Semgrep rules to detect insecure deserialization in Python?

Yes, you can use Semgrep rules to detect insecure deserialization in Python. The rule creation process guides you through writing precise patterns and test cases to catch specific vulnerable code patterns accurately.

Does this approach to rule creation support YAML and Bash scripting?

Yes, custom Semgrep rule creation supports Python, YAML, and Bash scripting for both rule generation and testing. This ensures broad coverage for static analysis across different scripting environments.