Skip to main content
skill CX Codex

llm-gate — Claude Code skill: what it does, how to install

llm-gate configures prompt and agent hooks in Claude Code to validate commit messages, stop dangerous terminal commands, and catch secret leaks before execution.

MIT ★ 2,966 updated 2026-09-29

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add rohitg00/pro-workflow
/plugin install pro-workflow@pro-workflow
Open on GitHub

What llm-gate does

This skill guides the setup of type: "prompt" and type: "agent" hooks inside Claude Code. These hooks intercept actions during events like PreToolUse. They inject command arguments into a small model such as Haiku, expecting a JSON reply with an ok status. If the check fails, Claude Code blocks the tool execution immediately.

The provided patterns cover conventional commit enforcement, guardrails against rm -rf on critical directories, and secret scanning on write operations. More complex audits, such as scanning staged diffs before git push, run under agent hooks with a 60-second timeout.

Keep hook prompts under 100 words to maintain evaluation speed and consistent JSON output.

What it helps with

  • validate commit messages against conventional commit standards
  • block destructive bash commands on core directories
  • stop file writes containing unencrypted API keys and tokens
  • inspect staged code for vulnerabilities prior to git push

Example prompts for the agent

  • Set up a prompt hook to enforce conventional commits with Haiku
  • Create a PreToolUse hook preventing destructive rm commands
  • Configure an agent hook to audit security before git push

How to install llm-gate

1Plugin marketplace

/plugin marketplace add rohitg00/pro-workflow
/plugin install pro-workflow@pro-workflow

This installs the whole pro-workflow plugin with all its skills

2Skills CLI (Vercel)

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

3Manually: put the files in place

~/.claude/skills/llm-gate/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/llm-gate/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about llm-gate

How to install llm-gate in Claude Code?

Run /plugin marketplace add rohitg00/pro-workflow first, then run /plugin install pro-workflow@pro-workflow.

What does llm-gate do?

It provides patterns for prompt-based guardrails in hooks.json to verify tool calls using small LLMs before execution.

Which model should prompt hooks use?

Haiku is recommended for fast checks under 15 seconds, while Sonnet fits heavier agent reviews with timeouts up to 60 seconds.

Source text

SKILL.md · MIT
---
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:

```json
{
  "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
```json
{
  "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
```json
{
  "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
```json
{
  "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):

```json
{
  "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

© Rohit Ghumare · MIT · rohitg00/pro-workflow

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set83

The whole set →
handoff Generates a structured handoff document for passing work to another Claude session or your future self. Records status, decisions, learnings, and a resume point. CX Codex +1 ★ 2,966repo stars replay replay finds relevant past learnings and mistakes in a local SQLite database before starting a task. Surfaces project context to reduce repeated edits. CX Codex +1 ★ 2,966repo stars insights The insights skill turns project memory and session history into analytics on corrections, saved learnings, and coding activity. Ask for a report to spot recurring patterns. CX Codex +1 ★ 2,966repo stars domain-modeling domain-modeling builds the project's shared vocabulary and context boundaries before code gets written, so the agent stops paraphrasing domain terms. Leaves a CONTEXT.md glossary behind. CX Codex +1 ★ 2,966repo stars cost-tracker The cost-tracker skill helps you review Claude Code session costs, set budget checkpoints, and spot expensive work patterns. Use it when planning work across sessions. CX Codex +1 ★ 2,966repo stars reviewer reviewer — a subagent that reviews code line by line, reading actual files and citing every finding with exact quotes. Use before committing, during PR review, or after major changes. CX Codex ★ 2,966repo stars skill-conventions skill-conventions defines standards for workflow skills: separates human invocation from auto-triggers, governs state writes, and keeps the skill router in sync. CX Codex +1 ★ 2,966repo stars plan-interrogate The plan-interrogate skill probes a plan before implementation by mapping its decisions and asking about them one at a time. Use it to clarify unresolved design choices. CX Codex +1 ★ 2,966repo stars

Project sponsors

Companies that keep this analytics open