agent-hook-guard
Agent hook guard
A rule in AGENTS.md works only when the model remembers it. A hook runs every time. This skill adds one hook for one problem.
An agent hook runs inside the agent tool, for example a Claude Code hook in its settings file, or an OpenCode plugin that listens to tool events. A git hook is not an agent hook. Use a git hook or CI only when the user asks for one. If the project's agent has no hooks, say so and propose a test or a command instead (session-retrospective-rules).
1. Choose one problem
Read the findings: .scratchpad/<slug>/redteam-report.md, verification-report.md, browser-test-report.md, or the moments of a retrospective. Choose the one problem that a hook would have stopped and that is easiest to explain. A good candidate:
- A program can check it, without judgment: a file in the wrong folder, a commit with failing tests, an edit to a generated file, a forbidden command.
- Happened, or can happen again, in this project.
- Has a check that runs in a few seconds.
If the first candidate needs a long explanation, pick a simpler one. The user must understand the hook from one sentence.
2. Show it before you write it
In the chat, give: