← ClaudeAtlas

rc-hookifylisted

Authors a new RC Claude Code hook from a plain-language description — emits a fail-open shell script in the house style under hooks/scripts/, wires it into hooks/hooks.json, documents it, and verifies it. Use when the user wants a deterministic guardrail, formatter, observer, or session warm-start turned into a hook. Do not use for application code, one-off shell scripts that aren't hooks, or editing existing guard logic unrelated to hooks.
rodolfochicone/rc-project · ★ 19 · AI & Automation · score 79
Install: claude install-skill rodolfochicone/rc-project
# Hookify Turn "I want the agent to always/never do X" into a RC hook. A rule that must hold *every time* belongs in a hook, not in prose (CLAUDE.md). This skill writes one in the repo's house style — never blocks the session on its own errors, guards by pattern, and is registered + documented. It writes only under `hooks/`; it never touches application source. Read `hooks/scripts/_lib.sh` and one existing hook (`hooks/scripts/observe.sh` for an observer, `hooks/scripts/git-guard.sh` for a blocker) before writing — mirror them exactly. ## Step 1 — pick the event First confirm the rule truly must hold *every time* — if it's advisory (nice-to-have, not every-time), it belongs in `CLAUDE.md` or a skill, not a hook; say so instead of writing one. Match the intent to an event; the full I/O contract is in `references/hook-events.md` (read it — stdout reaches the model only on some events, and only `PreToolUse` can block). | Intent | Event | Matcher | |---|---|---| | Block/warn before a tool runs | `PreToolUse` | tool name (`Bash`, `Edit\|Write\|MultiEdit`, `Task`) | | Format/observe/nudge after a tool ran | `PostToolUse` | tool name | | Warm-start context / surface state at session start | `SessionStart` | omit (all sources) | | Persist state before compaction / at end | `PreCompact` / `SessionEnd` | omit — side-effect only, model never sees stdout | | Notify on stop / permission prompt | `Stop` / `Notification` | omit | ## Step 2 — write the script (house style) `hooks/scr