semgrep-rule-creator — community semgrep-rule-creator, LUGANODE_TASK1, community, ide skills

v1.0.0

关于此技能

非常适合需要为 bug 模式、安全漏洞和编码标准创建自定义 Semgrep 规则的代码分析代理。 Creates custom Semgrep rules for detecting security vulnerabilities, bug patterns, and code patterns. Use when writing Semgrep rules or building custom static analysis detections.

ananyashailesh ananyashailesh
[0]
[0]
更新于: 3/10/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 9/11

This page remains useful for teams, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution Quality floor passed for review
Review Score
9/11
Quality Score
54
Canonical Locale
en
Detected Body Locale
en

非常适合需要为 bug 模式、安全漏洞和编码标准创建自定义 Semgrep 规则的代码分析代理。 Creates custom Semgrep rules for detecting security vulnerabilities, bug patterns, and code patterns. Use when writing Semgrep rules or building custom static analysis detections.

核心价值

赋予代理创建生产级 Semgrep 规则的能力,具有适当的测试和验证,利用污点模式检测数据流漏洞,并通过自定义规则集强制执行编码标准,同时通过 Semgrep 的静态分析功能与现有代码库集成。

适用 Agent 类型

非常适合需要为 bug 模式、安全漏洞和编码标准创建自定义 Semgrep 规则的代码分析代理。

赋予的主要能力 · semgrep-rule-creator

为特定 bug 模式编写 Semgrep 规则
使用自定义规则在代码库中检测安全漏洞
通过自动静态分析强制执行编码标准

! 使用限制与门槛

  • 需要了解 Semgrep 及其规则语法
  • 不适合运行现有的 Semgrep 规则集
  • 仅限静态分析,无自定义规则

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

评审后的下一步

先决定动作,再继续看上游仓库材料

Killer-Skills 的主价值不应该停在“帮你打开仓库说明”,而是先帮你判断这项技能是否值得安装、是否应该回到可信集合复核,以及是否已经进入工作流落地阶段。

实验室 Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

常见问题与安装步骤

以下问题与步骤与页面结构化数据保持一致,便于搜索引擎理解页面内容。

? FAQ

semgrep-rule-creator 是什么?

非常适合需要为 bug 模式、安全漏洞和编码标准创建自定义 Semgrep 规则的代码分析代理。 Creates custom Semgrep rules for detecting security vulnerabilities, bug patterns, and code patterns. Use when writing Semgrep rules or building custom static analysis detections.

如何安装 semgrep-rule-creator?

运行命令:npx killer-skills add ananyashailesh/LUGANODE_TASK1/semgrep-rule-creator。支持 Cursor、Windsurf、VS Code、Claude Code 等 19+ IDE/Agent。

semgrep-rule-creator 适用于哪些场景?

典型场景包括:为特定 bug 模式编写 Semgrep 规则、使用自定义规则在代码库中检测安全漏洞、通过自动静态分析强制执行编码标准。

semgrep-rule-creator 支持哪些 IDE 或 Agent?

该技能兼容 Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer。可使用 Killer-Skills CLI 一条命令通用安装。

semgrep-rule-creator 有哪些限制?

需要了解 Semgrep 及其规则语法;不适合运行现有的 Semgrep 规则集;仅限静态分析,无自定义规则。

安装步骤

  1. 1. 打开终端

    在你的项目目录中打开终端或命令行。

  2. 2. 执行安装命令

    运行:npx killer-skills add ananyashailesh/LUGANODE_TASK1/semgrep-rule-creator。CLI 会自动识别 IDE 或 AI Agent 并完成配置。

  3. 3. 开始使用技能

    semgrep-rule-creator 已启用,可立即在当前项目中调用。

! 参考页模式

此页面仍可作为安装与查阅参考,但 Killer-Skills 不再把它视为主要可索引落地页。请优先阅读上方评审结论,再决定是否继续查看上游仓库说明。

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

semgrep-rule-creator

安装 semgrep-rule-creator,这是一款面向AI agent workflows and automation的 AI Agent Skill。查看评审结论、使用场景与安装路径。

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

Semgrep Rule Creator

Create production-quality Semgrep rules with proper testing and validation.

When to Use

Ideal scenarios:

  • Writing Semgrep rules for specific bug patterns
  • Writing rules to detect security vulnerabilities in your codebase
  • Writing taint mode rules for data flow vulnerabilities
  • Writing rules to enforce coding standards

When NOT to Use

Do NOT use this skill for:

  • Running existing Semgrep rulesets
  • General static analysis without custom rules (use static-analysis skill)

Rationalizations to Reject

When writing Semgrep rules, reject these common shortcuts:

  • "The pattern looks complete" → Still run semgrep --test --config <rule-id>.yaml <rule-id>.<ext> to verify. Untested rules have hidden false positives/negatives.
  • "It matches the vulnerable case" → Matching vulnerabilities is half the job. Verify safe cases don't match (false positives break trust).
  • "Taint mode is overkill for this" → If data flows from user input to a dangerous sink, taint mode gives better precision than pattern matching.
  • "One test is enough" → Include edge cases: different coding styles, sanitized inputs, safe alternatives, and boundary conditions.
  • "I'll optimize the patterns first" → Write correct patterns first, optimize after all tests pass. Premature optimization causes regressions.
  • "The AST dump is too complex" → The AST reveals exactly how Semgrep sees code. Skipping it leads to patterns that miss syntactic variations.

Anti-Patterns

Too broad - matches everything, useless for detection:

yaml
1# BAD: Matches any function call 2pattern: $FUNC(...) 3 4# GOOD: Specific dangerous function 5pattern: eval(...)

Missing safe cases in tests - leads to undetected false positives:

python
1# BAD: Only tests vulnerable case 2# ruleid: my-rule 3dangerous(user_input) 4 5# GOOD: Include safe cases to verify no false positives 6# ruleid: my-rule 7dangerous(user_input) 8 9# ok: my-rule 10dangerous(sanitize(user_input)) 11 12# ok: my-rule 13dangerous("hardcoded_safe_value")

Overly specific patterns - misses variations:

yaml
1# BAD: Only matches exact format 2pattern: os.system("rm " + $VAR) 3 4# GOOD: Matches all os.system calls with taint tracking 5mode: taint 6pattern-sinks: 7 - pattern: os.system(...)

Strictness Level

This workflow is strict - do not skip steps:

  • Read documentation first: See Documentation before writing Semgrep rules
  • Test-first is mandatory: Never write a rule without tests
  • 100% test pass is required: "Most tests pass" is not acceptable
  • Optimization comes last: Only simplify patterns after all tests pass
  • Avoid generic patterns: Rules must be specific, not match broad patterns
  • Prioritize taint mode: For data flow vulnerabilities
  • One YAML file - one Semgrep rule: Each YAML file must contain only one Semgrep rule; don't combine multiple rules in a single file
  • No generic rules: When targeting a specific language for Semgrep rules - avoid generic pattern matching (languages: generic)
  • Forbidden todook and todoruleid test annotations: todoruleid: <rule-id> and todook: <rule-id> annotations in tests files for future rule improvements are forbidden

Overview

This skill guides creation of Semgrep rules that detect security vulnerabilities and code patterns. Rules are created iteratively: analyze the problem, write tests first, analyze AST structure, write the rule, iterate until all tests pass, optimize the rule.

Approach selection:

  • Taint mode (prioritize): Data flow issues where untrusted input reaches dangerous sinks
  • Pattern matching: Simple syntactic patterns without data flow requirements

Why prioritize taint mode? Pattern matching finds syntax but misses context. A pattern eval($X) matches both eval(user_input) (vulnerable) and eval("safe_literal") (safe). Taint mode tracks data flow, so it only alerts when untrusted data actually reaches the sink—dramatically reducing false positives for injection vulnerabilities.

Iterating between approaches: It's okay to experiment. If you start with taint mode and it's not working well (e.g., taint doesn't propagate as expected, too many false positives/negatives), switch to pattern matching. Conversely, if pattern matching produces too many false positives on safe cases, try taint mode instead. The goal is a working rule—not rigid adherence to one approach.

Output structure - exactly 2 files in a directory named after the rule-id:

<rule-id>/
├── <rule-id>.yaml     # Semgrep rule
└── <rule-id>.<ext>    # Test file with ruleid/ok annotations

Quick Start

yaml
1rules: 2 - id: insecure-eval 3 languages: [python] 4 severity: HIGH 5 message: User input passed to eval() allows code execution 6 mode: taint 7 pattern-sources: 8 - pattern: request.args.get(...) 9 pattern-sinks: 10 - pattern: eval(...)

Test file (insecure-eval.py):

python
1# ruleid: insecure-eval 2eval(request.args.get('code')) 3 4# ok: insecure-eval 5eval("print('safe')")

Run tests (from rule directory): semgrep --test --config <rule-id>.yaml <rule-id>.<ext>

Quick Reference

  • For commands, pattern operators, and taint mode syntax, see quick-reference.md.
  • For detailed workflow and examples, you MUST see workflow.md

Workflow

Copy this checklist and track progress:

Semgrep Rule Progress:
- [ ] Step 1: Analyze the Problem
- [ ] Step 2: Write Tests First
- [ ] Step 3: Analyze AST structure
- [ ] Step 4: Write the rule
- [ ] Step 5: Iterate until all tests pass (semgrep --test)
- [ ] Step 6: Optimize the rule (remove redundancies, re-test)
- [ ] Step 7: Final Run

Documentation

REQUIRED: Before writing any rule, use WebFetch to read all of these 4 links with Semgrep documentation:

  1. Rule Syntax
  2. Pattern Syntax
  3. ToB Testing Handbook - Semgrep
  4. Constant propagation
  5. Writing Rules Index

相关技能

寻找 semgrep-rule-creator 的替代方案 (Alternative) 或可搭配使用的同类 community Skill?探索以下相关开源技能。

查看全部

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

为prompts.chat的信息反馈系统生成可定制的插件小部件

149.6k
0
AI

flags

Logo of vercel
vercel

React 框架

138.4k
0
浏览器

pr-review

Logo of pytorch
pytorch

Python中具有强大GPU加速的张量和动态神经网络

98.6k
0
开发者工具