跳到正文
cccskills
免费在 GitHub 公开

llm-gate

Set up AI checks in Claude Code that review commit messages, coding conventions, destructive commands, and file writes before execution. Operations that fail the checks are blocked with an explanation.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

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.

实测评分 未实测

查看安装方法

适用场景

  • Validate commit message formats
  • Check conventions beyond automated code checks
  • Review commands that delete important directories
  • Check file writes for exposed secrets

包含的文件(1)

  • SKILL.md3.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Coordinate multiple Claude Code sessions on a shared codebase. Organize tasks, dependencies, teammate messages, and file ownership, with guidance on team size, plan approval, and choosing between teams, subagents, and worktrees.

中文简介正在准备中。当前显示英语简介。

  • Develop API, UI, and tests in parallel
  • Assign implementation and review to separate sessions
  • Organize file ownership and task dependencies
rohitg00/pro-workflow29292026年9月29日 更新

Set up project checks when starting work on an unfamiliar codebase. Detect the project type, verify available tools, and generate Claude Code settings for linting, type checks, tests, formatting checks, and hooks.

中文简介正在准备中。当前显示英语简介。

  • Set up checks for a new development project
  • Inspect tools in an unfamiliar codebase
  • Prepare quality checks for CI integration
rohitg00/pro-workflow29292026年9月29日 更新

Coordinate repetitive changes across many files by splitting them into independent tasks. Agents work in separate Git working directories, run relevant tests, and open pull requests, with a shared summary of successes and failures.

中文简介正在准备中。当前显示英语简介。

  • Migrate a library across many files
  • Convert class components to function components
  • Add tracing to API handlers
rohitg00/pro-workflow29292026年9月29日 更新

Turn conversational bug reports into GitHub issues with clear reproduction steps, expected behavior, and project terminology. The skill checks for duplicates and separates independent problems, keeping reports focused on behavior so they remain useful after code changes.

中文简介正在准备中。当前显示英语简介。

  • Record a bug described in conversation
  • File defects found during QA
  • Check for existing reports before filing
rohitg00/pro-workflow29292026年9月29日 更新

Prepare for conversation compaction, which shortens an agent's working context, by saving active files, progress, decisions, blockers, and next steps. Afterward, use those notes and priority files to recover the working state and resume the task.

中文简介正在准备中。当前显示英语简介。

  • Saving task state before running /compact
  • Preparing handoff notes when an auto-compact warning appears
  • Recovering active work after compaction
rohitg00/pro-workflow29292026年9月29日 更新

Manage the information an AI coding session carries by saving notes, selecting relevant material, summarizing results, and separating tasks. The skill guides context budgets and session handoffs so important decisions remain available during long projects.

中文简介正在准备中。当前显示英语简介。

  • Preserve task progress before summarizing a session
  • Narrow searches in large codebases
  • Organize lengthy logs and tool results
rohitg00/pro-workflow29292026年9月29日 更新

查看 rohitg00 的全部技能

报告此技能的问题