hooks

Solid

Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember, and avoiding hooks that make an agent unusable.

AI & Automation 23 stars 2 forks Updated today MIT

Install

View on GitHub

Quality Score: 84/100

Stars 20%
46
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Hooks ## Purpose Enforce a rule deterministically rather than asking the model to remember it. A hook runs every time, regardless of the model's attention, its context, or its mood — which is exactly what a rule requires. ## When to Use - A rule must hold every time: formatting, a forbidden command, a required check. - The agent keeps forgetting an instruction despite it being in the instructions. - Automating a step that should happen around every edit or command. - Blocking a dangerous action before it executes. ## Capabilities - Lifecycle events: before and after a tool call, on session start, on stop. - Deterministic enforcement: formatting, linting, blocking. - Injecting context at the right moment. - Notification and logging. ## Inputs - The rule and when it must apply. - The event that should trigger it. - What should happen when it fails: block, warn, or fix. ## Outputs - Hook configuration that runs reliably. - Rules enforced without depending on the model's memory. - A fast hook — one that does not make the agent unpleasant to use. ## Workflow 1. **Identify the rule that keeps being broken** — If an instruction is in the instruction file and is still violated, it is a hook, not an instruction. Instructions are guidance; hooks are enforcement. 2. **Choose the event** — Before a tool call to block or validate; after one to format or verify; on session start to inject context. 3. **Make it fast** — A hook runs on every matching event. Two seconds on every...

Details

Author
nimadorostkar
Repository
nimadorostkar/Claude-Skills-collection
Created
1 weeks ago
Last Updated
today
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category