Token导航 LogoToken导航

Agent Skill · 研究检索

semgrep-rule-creator(semgrep 规则创建者)

semgrep-rule-creator 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

semgrep-rule-creator 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 42,785。

总安装 1,042周安装 43GitHub Stars 25下载 341核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:semgrep-rule-creator(semgrep 规则创建者)
来源仓库:https://github.com/oimiragieo/agent-studio
仓库路径:skills/semgrep-rule-creator
安装命令:
npx skills add https://github.com/oimiragieo/agent-studio --skill semgrep-rule-creator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/oimiragieo/agent-studio --skill semgrep-rule-creator

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

semgrep-rule-creator 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。适用于静态代码分析规则创建与安全漏洞检测场景。通过 npx skills add 命令从 GitHub 仓库安装并使用。

安装前需确认权限范围、维护状态及是否触发文件操作。建议结合原始 README 核验具体用法和功能边界。

来源仓库内路径:skills/semgrep-rule-creator

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/oimiragieo/agent-studio --skill semgrep-rule-c…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

semgrep-rule-creator 怎么安装?

在终端执行 npx skills add https://github.com/oimiragieo/agent-studio --skill semgrep-rule-creator。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

semgrep-rule-creator 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

semgrep-rule-creator 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

semgrep-rule-creator 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

semgrep-rule-creator 用的人多吗?

公开数据是累计安装 1,042 次,近一周安装 43 次,下载 341 次,GitHub 25 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

semgrep-rule-creator 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
semgrep-rule-creator

semgrep 规则创建者 · 本页

1,04225接触敏感数据未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Semgrep Rule Creator

Security Notice

AUTHORIZED USE ONLY: These skills are for DEFENSIVE security analysis and authorized research:

  • Custom security rule development for owned codebases
  • Coding standard enforcement via automated checks
  • CI/CD security gate rule authoring
  • Vulnerability pattern codification for prevention
  • Educational purposes in controlled environments

NEVER use for:

  • Creating rules to bypass security controls
  • Scanning systems without authorization
  • Any illegal activities

Step 1: Define the Detection Goal

Before writing a rule, clearly define:

  1. What to detect: The vulnerable or undesired code pattern
  2. Why it matters: The security impact or quality concern
  3. What languages: Which programming languages to target
  4. True positive example: Code that SHOULD match
  5. True negative example: Code that should NOT match (safe alternative)
  6. False positive risks: What similar-looking code is actually safe

Detection Goal Template

## Rule: [rule-id]

- **Detect**: [description of what to find]
- **Why**: [security impact / quality concern]
- **Languages**: [javascript, typescript, python, etc.]
- **CWE**: [CWE-XXX]
- **OWASP**: [A0X category]
- **True Positive**: [code example that should match]
- **True Negative**: [safe code that should NOT match]

Step 2: Write the Semgrep Rule

Basic Rule Structure

rules:
  - id: rule-id-here
    message: >
      Clear description of what was found and why it matters.
      Include remediation guidance in the message.
    severity: ERROR # ERROR, WARNING, INFO
    languages: [javascript, typescript]
    metadata:
      cwe:
        - CWE-089
      owasp:
        - A03:2021
      confidence: HIGH # HIGH, MEDIUM, LOW
      impact: HIGH # HIGH, MEDIUM, LOW
      category: security
      subcategory:
        - vuln
      technology:
        - express
        - node.js
      references:
        - https://owasp.org/Top10/A03_2021-Injection/
      source-rule-url: https://semgrep.dev/r/rule-id
    # Pattern goes here (see below)

Pattern Types

Simple Pattern Match
pattern: |
  eval($X)
Pattern with Alternatives (OR)
pattern-either:
  - pattern: eval($X)
  - pattern: new Function($X)
  - pattern: setTimeout($X, ...)
  - pattern: setInterval($X, ...)
Pattern with Exclusions (AND NOT)
patterns:
  - pattern: $DB.query($QUERY)
  - pattern-not: $DB.query($QUERY, $PARAMS)
  - pattern-not: $DB.query($QUERY, [...])
Pattern Inside Context
patterns:
  - pattern: $RES.send($DATA)
  - pattern-inside: |
      app.$METHOD($PATH, function($REQ, $RES) {
        ...
      })
  - pattern-not-inside: |
      app.$METHOD($PATH, authenticate, function($REQ, $RES) {
        ...
      })
Metavariable Constraints
patterns:
  - pattern: crypto.createHash($ALGO)
  - metavariable-regex:
      metavariable: $ALGO
      regex: (md5|sha1|MD5|SHA1)
  - focus-metavariable: $ALGO
patterns:
  - pattern: setTimeout($FUNC, $TIME)
  - metavariable-comparison:
      metavariable: $TIME
      comparison: $TIME > 60000

Taint Mode Rules (Advanced)

For tracking data flow from sources to sinks:

mode: taint
pattern-sources:
  - patterns:
      - pattern: $REQ.query.$PARAM
  - patterns:
      - pattern: $REQ.body.$PARAM
  - patterns:
      - pattern: $REQ.params.$PARAM
pattern-sinks:
  - patterns:
      - pattern: $DB.query($SINK, ...)
      - focus-metavariable: $SINK
pattern-sanitizers:
  - patterns:
      - pattern: escape($X)
  - patterns:
      - pattern: sanitize($X)
  - patterns:
      - pattern: $DB.query($QUERY, [...])

Step 3: Common Rule Templates

SQL Injection Detection

rules:
  - id: sql-injection-string-concat
    message: >
      Possible SQL injection via string concatenation. User input appears
      to be concatenated into a SQL query string. Use parameterized
      queries instead.
    severity: ERROR
    languages: [javascript, typescript]
    metadata:
      cwe: [CWE-089]
      owasp: [A03:2021]
      confidence: HIGH
      impact: HIGH
      category: security
    patterns:
      - pattern-either:
          - pattern: $DB.query("..." + $VAR + "...")
          - pattern: $DB.query(`...${$VAR}...`)
      - pattern-not: $DB.query("..." + $VAR + "...", [...])
    fix: |
      $DB.query("... $1 ...", [$VAR])

XSS Detection

rules:
  - id: xss-innerhtml-assignment
    message: >
      Direct assignment to innerHTML with potentially untrusted data.
      Use textContent for text or a sanitization library for HTML.
    severity: ERROR
    languages: [javascript, typescript]
    metadata:
      cwe: [CWE-079]
      owasp: [A03:2021]
      confidence: MEDIUM
      impact: HIGH
      category: security
    pattern-either:
      - pattern: $EL.innerHTML = $DATA
      - pattern: document.getElementById($ID).innerHTML = $DATA

Hardcoded Secrets

rules:
  - id: hardcoded-api-key
    message: >
      Hardcoded API key detected. Store secrets in environment
      variables or a secrets manager.
    severity: ERROR
    languages: [javascript, typescript, python]
    metadata:
      cwe: [CWE-798]
      owasp: [A02:2021]
      confidence: MEDIUM
      impact: HIGH
      category: security
    pattern-either:
      - pattern: |
          $KEY = "AKIA..."
      - pattern: |
          $KEY = "sk-..."
      - pattern: |
          $KEY = "ghp_..."
    pattern-regex: (AKIA[0-9A-Z]{16}|sk-[a-zA-Z0-9]{48}|ghp_[a-zA-Z0-9]{36})

Missing Authentication

rules:
  - id: express-route-missing-auth
    message: >
      Express route handler without authentication middleware.
      Add authentication middleware before the handler.
    severity: WARNING
    languages: [javascript, typescript]
    metadata:
      cwe: [CWE-306]
      owasp: [A07:2021]
      confidence: MEDIUM
      impact: HIGH
      category: security
    patterns:
      - pattern-either:
          - pattern: app.post($PATH, function($REQ, $RES) { ... })
          - pattern: app.put($PATH, function($REQ, $RES) { ... })
          - pattern: app.delete($PATH, function($REQ, $RES) { ... })
          - pattern: router.post($PATH, function($REQ, $RES) { ... })
          - pattern: router.put($PATH, function($REQ, $RES) { ... })
          - pattern: router.delete($PATH, function($REQ, $RES) { ... })
      - pattern-not-inside: |
          app.$METHOD($PATH, $AUTH, function($REQ, $RES) { ... })
      - pattern-not-inside: |
          router.$METHOD($PATH, $AUTH, function($REQ, $RES) { ... })

Insecure Randomness

rules:
  - id: insecure-random-for-security
    message: >
      Math.random() is not cryptographically secure. Use
      crypto.getRandomValues() or crypto.randomBytes() for
      security-sensitive random values.
    severity: WARNING
    languages: [javascript, typescript]
    metadata:
      cwe: [CWE-330]
      confidence: MEDIUM
      impact: MEDIUM
      category: security
    patterns:
      - pattern: Math.random()
      - pattern-inside: |
          function $FUNC(...) {
            ...
          }
      - metavariable-regex:
          metavariable: $FUNC
          regex: (generateToken|createSecret|randomPassword|generateKey|createSession|generateId|createNonce)

Step 4: Write Rule Tests

Test File Format

Create a test file alongside the rule:

// ruleid: sql-injection-string-concat
db.query('SELECT * FROM users WHERE id = ' + userId);

// ruleid: sql-injection-string-concat
db.query(`SELECT * FROM users WHERE id = ${userId}`);

// ok: sql-injection-string-concat
db.query('SELECT * FROM users WHERE id = $1', [userId]);

// ok: sql-injection-string-concat
db.query('SELECT * FROM users WHERE id = ?', [userId]);

Running Tests

# Test a single rule
semgrep --test --config=rules/sql-injection.yml tests/

# Test all rules
semgrep --test --config=rules/ tests/

# Validate rule syntax
semgrep --validate --config=rules/

Step 5: Rule Optimization

Performance Best Practices

  1. Be specific with patterns: Avoid overly broad matches like $X($Y)
  2. Use pattern-inside to scope: Narrow the search context
  3. Use language-specific syntax: Leverage language features
  4. Avoid deep ellipsis nesting: ......... is slow
  5. Use focus-metavariable: Narrow the reported location
  6. Test with large codebases: Verify performance at scale

Reducing False Positives

  1. Add pattern-not for safe patterns: Exclude known-safe alternatives
  2. Use metavariable-regex: Constrain metavariable values
  3. Use pattern-not-inside: Exclude safe contexts
  4. Set appropriate confidence: Be honest about detection certainty
  5. Add technology metadata: Help users filter relevant rules
  6. Provide fix suggestions: When possible, include fix: field

Rule Validation Checklist

  • Rule has unique, descriptive ID
  • Message explains the issue AND remediation
  • Severity matches actual risk
  • Metadata includes CWE, OWASP, confidence, impact
  • At least 2 true positive test cases
  • At least 2 true negative test cases
  • Rule validated with semgrep --validate
  • Rule tested with semgrep --test
  • Performance acceptable on large codebase
  • Fix suggestion provided (if applicable)

Semgrep Pattern Syntax Reference

SyntaxMeaningExample
$XSingle metavariableeval($X)
$...XMultiple metavariable argsfunc($...ARGS)
...Ellipsis (any statements)if (...) {...}
<... $X...>Deep expression match<... eval($X)...>
pattern-eitherOR operatorMatch any of N patterns
pattern-notNOT operatorExclude specific patterns
pattern-insideContext requirementMust be inside this pattern
pattern-not-insideContext exclusionMust NOT be inside this
metavariable-regexRegex constraintConstrain $X to match regex
metavariable-comparisonNumeric constraint$X > 100
focus-metavariableNarrow match locationReport only $X location

Related Skills

Agent Integration

  • security-architect (primary): Custom rule development for security audits
  • code-reviewer (primary): Automated code review rule authoring
  • penetration-tester (secondary): Vulnerability detection rule creation
  • qa (secondary): Quality enforcement rule authoring

Iron Laws

  1. NEVER publish a rule without at least 2 true positive and 2 true negative test cases
  2. ALWAYS validate rule syntax with semgrep --validate before committing
  3. NEVER set confidence to HIGH without testing the rule against a real codebase
  4. ALWAYS include WHAT was found, WHY it matters, and HOW to fix it in every rule message
  5. NEVER use pattern-regex as the primary matcher — use structural patterns and constrain with metavariable-regex

Anti-Patterns

Anti-PatternWhy It FailsCorrect Approach
Publishing untested rulesFalse positives erode developer trust and rules get ignoredWrite test cases with // ruleid: and // ok: annotations and run semgrep --test
Setting HIGH confidence without validationOverconfident rules mislead reviewers into trusting bad signalCalibrate confidence based on measured false positive rate on real codebases
Vague rule messagesDevelopers cannot remediate without specific guidanceInclude WHAT was found, WHY it matters, and HOW to fix it in every message
Overly broad patterns with no exclusionsHigh false positive rate causes rule fatigueAdd pattern-not clauses for all known-safe alternatives
Using pattern-regex as primary matcherRegex is slower and less precise than structural pattern matchingUse structural patterns as primary; constrain with metavariable-regex only

Memory Protocol (MANDATORY)

Before starting: Read .claude/context/memory/learnings.md

After completing:

  • New pattern -> .claude/context/memory/learnings.md
  • Issue found -> .claude/context/memory/issues.md
  • Decision made -> .claude/context/memory/decisions.md
ASSUME INTERRUPTION: If it's not in memory, it didn't happen.

Cross-Reference: Creator Ecosystem

This skill is part of the Creator Ecosystem. When research uncovers gaps, trigger the appropriate companion creator:

Gap DiscoveredRequired ArtifactCreator to InvokeWhen
Domain knowledge needs a reusable skillskillSkill({skill: 'skill-creator'})Gap is a full skill domain
Existing skill has incomplete coverageskill updateSkill({skill: 'skill-updater'})Close skill exists but incomplete
Capability needs a dedicated agentagentSkill({skill: 'agent-creator'})Agent to own the capability
Existing agent needs capability updateagent updateSkill({skill: 'agent-updater'})Close agent exists but incomplete
Domain needs code/project scaffoldingtemplateSkill({skill: 'template-creator'})Reusable code patterns needed
Behavior needs pre/post execution guardshookSkill({skill: 'hook-creator'})Enforcement behavior required
Process needs multi-phase orchestrationworkflowSkill({skill: 'workflow-creator'})Multi-step coordination needed
Artifact needs structured I/O validationschemaSkill({skill: 'schema-creator'})JSON schema for artifact I/O
User interaction needs a slash commandcommandSkill({skill: 'command-creator'})User-facing shortcut needed
Repeated logic needs a reusable CLI tooltoolSkill({skill: 'tool-creator'})CLI utility needed
Narrow/single-artifact capability onlyinlineDocument within this artifact onlyToo specific to generalize

Ecosystem Alignment Contract (MANDATORY)

This creator skill is part of a coordinated creator ecosystem. Any artifact created here must align with and validate against related creators:

  • agent-creator for ownership and execution paths
  • skill-creator for capability packaging and assignment
  • tool-creator for executable automation surfaces
  • hook-creator for enforcement and guardrails
  • rule-creator and semgrep-rule-creator for policy and static checks
  • template-creator for standardized scaffolds
  • workflow-creator for orchestration and phase gating
  • command-creator for user/operator command UX

Cross-Creator Handshake (Required)

Before completion, verify all relevant handshakes:

  1. Artifact route exists in .claude/CLAUDE.md and related routing docs.
  2. Discovery/registry entries are updated (catalog/index/registry as applicable).
  3. Companion artifacts are created or explicitly waived with reason.
  4. validate-integration.cjs passes for the created artifact.
  5. Skill index is regenerated when skill metadata changes.

Research Gate (Exa + arXiv — BOTH MANDATORY)

For new patterns, templates, or workflows, research is mandatory:

  1. Use Exa for implementation and ecosystem patterns:

- mcp__Exa__web_search_exa({query: '<topic> 2025 best practices'}) - mcp__Exa__get_code_context_exa({query: '<topic> implementation examples'})

  1. Search arXiv for academic research (mandatory for AI/ML, agents, evaluation, orchestration, memory/RAG, security):

- Via Exa: mcp__Exa__web_search_exa({query: 'site:arxiv.org <topic> 2024 2025'}) - Direct API: WebFetch({url: 'https://arxiv.org/search/?query=<topic>&searchtype=all&start=0'})

  1. Record decisions, constraints, and non-goals in artifact references/docs.
  2. Keep updates minimal and avoid overengineering.

arXiv is mandatory (not fallback) when topic involves: AI agents, LLM evaluation, orchestration, memory/RAG, security, static analysis, or any emerging methodology.

Regression-Safe Delivery

  • Follow strict RED -> GREEN -> REFACTOR for behavior changes.
  • Run targeted tests for changed modules.
  • Run lint/format on changed files.
  • Keep commits scoped by concern (logic/docs/generated artifacts).

平台分布

Codex

35.33%
按下载量换算120

Claude

31.13%
按下载量换算106

Cursor

17.21%
按下载量换算59

Gemini CLI

9.46%
按下载量换算32

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills