llm-gate

GitHub

利用LLM钩子创建智能质量门禁,验证提交信息、代码规范及安全漏洞。支持Prompt和Agent两种模式,可拦截危险操作或敏感信息泄露,为特定操作设置AI驱动的防护栏。

skills/llm-gate/SKILL.md rohitg00/pro-workflow

触发场景

设置提交消息验证 执行破坏性命令如rm 写入可能包含密钥的文件 推送代码前的安全审查

安装

npx skills add rohitg00/pro-workflow --skill llm-gate -g -y
更多选项

不安装直接使用

npx skills use rohitg00/pro-workflow@llm-gate

指定 Agent (Claude Code)

npx skills add rohitg00/pro-workflow --skill llm-gate -a claude-code -g -y

安装 repo 全部 skill

npx skills add rohitg00/pro-workflow --all -g -y

预览 repo 内 skill

npx skills add rohitg00/pro-workflow --list

SKILL.md

Frontmatter
{
    "name": "llm-gate",
    "description": "LLM-powered quality verification using prompt hooks. Validates commit messages, code patterns, and conventions using AI before allowing operations. Use to set up intelligent guardrails."
}

LLM Gate

Use Claude Code's type: "prompt" hooks to create intelligent quality gates that use AI to verify operations.

Trigger

Use when:

  • Setting up commit message validation
  • Enforcing code conventions beyond what linters catch
  • Creating smart guardrails for specific operations

How Prompt Hooks Work

Claude Code supports hooks with type: "prompt" that run a small LLM (Haiku by default) to verify conditions:

{
  "PreToolUse": [{
    "matcher": "Bash",
    "hooks": [{
      "type": "prompt",
      "if": "Bash(git commit*)",
      "prompt": "Check if this git commit follows conventional commit format (<type>(<scope>): <summary>). The commit command is: $ARGUMENTS. Return {\"ok\": true} if valid, {\"ok\": false, \"reason\": \"...\"} if not.",
      "model": "haiku",
      "timeout": 15
    }]
  }]
}

The hook:

  1. Substitutes $ARGUMENTS with the JSON hook input
  2. Sends to Haiku (fast, cheap)
  3. Expects {"ok": true} or {"ok": false, "reason": "..."}
  4. If not ok → blocks the tool call with the reason

Example Gates

Conventional Commit Validator

{
  "type": "prompt",
  "if": "Bash(git commit*)",
  "prompt": "Verify this git commit follows conventional commits: type(scope): summary. Types: feat,fix,refactor,test,docs,chore,perf,ci. Summary under 72 chars. Input: $ARGUMENTS",
  "model": "haiku"
}

Destructive Command Guard

{
  "type": "prompt",
  "if": "Bash(rm *)",
  "prompt": "Check if this rm command is safe. Flag if it uses -rf on important directories (src/, node_modules/, .git/). Input: $ARGUMENTS",
  "model": "haiku"
}

API Key Leak Prevention

{
  "type": "prompt",
  "matcher": "Write",
  "prompt": "Check if this file write contains hardcoded API keys, secrets, passwords, or tokens. Input: $ARGUMENTS. Return ok:false if secrets found.",
  "model": "haiku"
}

Agent Hooks

For complex verification, use type: "agent" (runs a full agent):

{
  "type": "agent",
  "if": "Bash(git push*)",
  "prompt": "Review all staged changes for security issues before pushing. Check for: hardcoded secrets, SQL injection, XSS vulnerabilities, exposed internal URLs.",
  "model": "haiku",
  "timeout": 60
}

Setup Guide

  1. Choose which operations to gate
  2. Write the prompt (keep it focused, under 100 words)
  3. Pick the model (haiku for speed, sonnet for accuracy)
  4. Set timeout (15s for prompts, 60s for agents)
  5. Add to hooks.json under the appropriate event

Rules

  • Use Haiku for simple checks (fast, cheap)
  • Use Sonnet only for complex analysis
  • Keep prompts under 100 words for reliability
  • Always include if condition to avoid running on every tool call
  • Set reasonable timeouts (15s prompt, 60s agent)
  • Test hooks before deploying to avoid blocking workflows

版本历史

  • 7f7209d 当前 2026-07-24 11:40

同 Skill 集合

skills/agent-teams/SKILL.md
skills/auto-setup/SKILL.md
skills/batch-orchestration/SKILL.md
skills/bug-capture/SKILL.md
skills/compact-guard/SKILL.md
skills/context-engineering/SKILL.md
skills/context-optimizer/SKILL.md
skills/cost-tracker/SKILL.md
skills/design-engineering/SKILL.md
skills/deslop/SKILL.md
skills/domain-modeling/SKILL.md
skills/file-watcher/SKILL.md
skills/improve-architecture/SKILL.md
skills/insights/SKILL.md
skills/learn-rule/SKILL.md
skills/llm-council/SKILL.md
skills/mcp-audit/SKILL.md
skills/orchestrate/SKILL.md
skills/parallel-worktrees/SKILL.md
skills/permission-tuner/SKILL.md
skills/plan-interrogate/SKILL.md
skills/replay-learnings/SKILL.md
skills/safe-mode/SKILL.md
skills/session-handoff/SKILL.md
skills/skill-router/SKILL.md
skills/smart-commit/SKILL.md
skills/sprint-status/SKILL.md
skills/tdd/SKILL.md
skills/thoroughness-scoring/SKILL.md
skills/token-efficiency/SKILL.md
skills/wiki-builder/SKILL.md
skills/wiki-query/SKILL.md
skills/wiki-research-loop/SKILL.md
skills/wiki-viewer/SKILL.md
skills/wrap-up/SKILL.md
skills/writing-guidelines/SKILL.md
skills/pro-workflow/SKILL.md
skills/skill-optimizer/SKILL.md
skills/survey-generator/SKILL.md

元信息

文件数
0
版本
7f7209d
Hash
4b7da8e8
收录时间
2026-07-24 11:40

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-07 17:15
浙ICP备14020137号-1 $访客地图$