enforcement

Block invalid actions via PreToolUse, PermissionRequest, and SubagentStop hooks.

9|Updated Dec 13, 2025
One-click install
npx skills add https://github.com/ingpoc/SKILLS --skill enforcement
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: enforcement
Source: https://github.com/ingpoc/SKILLS/tree/main/enforcement
Command: npx skills add https://github.com/ingpoc/SKILLS --skill enforcement

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Enforcement mechanisms that block invalid actions, enforce safe state transitions, and provide verifiable quality gates during development of Claude Code skills.

Core Features & Use Cases

  • PreToolUse, PermissionRequest, and SubagentStop hooks to block unsafe edits and enforce checks.
  • Deterministic blocking patterns (exit code 2, JSON denial, updatedInput modification) with reference templates.
  • Integrated with MCP sandboxing and handoff workflows to maintain security and reliability.

Quick Start

Wire enforcement hooks (PreToolUse/PermissionRequest/SubagentStop) to block invalid actions and enforce quality gates, then implement blocking logic using the provided hook templates.

Frequently Asked Questions about enforcement

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I block invalid actions and enforce state transitions in Claude Code?▼

Blocking invalid actions in Claude Code is done by wiring enforcement hooks into PreToolUse, PermissionRequest, and SubagentStop events. This intercepts unsafe edits and enforces deterministic quality gates during skill development.

What are the available blocking modalities for Claude Code hooks?▼

Claude Code hooks support three blocking modalities: exit code 2 for hard denial, JSON denial for explicit rejection, and updatedInput modification to safely alter requests. These patterns provide deterministic governance for safe interactions.

When do I need PreToolUse hooks for quality gates?▼

You need PreToolUse hooks for quality gates when preventing unsafe edits before execution. They act as deterministic safety nets to verify state transitions and block invalid actions proactively during skill development.

Can I use enforcement hooks with MCP sandboxing workflows?▼

Yes, enforcement hooks integrate directly with MCP sandboxing and handoff workflows to maintain security and reliability. They enforce safe state transitions and provide verifiable quality gates during Claude Code skill interactions.

What is the best way to implement deterministic blocking logic for SubagentStop events?▼

The best way to implement deterministic blocking for SubagentStop events is using provided reference hook templates that apply exit code 2 or JSON denial. This ensures verifiable quality gates and prevents invalid state transitions when subagents finish.