scaffold-hooks
Installation
SKILL.md
scaffold-hooks
Generates thin per-harness adapters that translate each harness's hook protocol and call project behaviour that lives in repo-owned scripts (for example scripts/agent-stop-checks.sh <harness>). Policy never belongs in the adapters.
Emission rule: an event gets files and a harness config entry only when the plan gives it at least one scripts or commands entry (OpenCode: the same, per session.* or tool.execute.* event). Everything else is skipped, so a project never receives hooks that do nothing. A refresh removes the managed files and config entries of events that no longer qualify.
Choosing harnesses
- The user names harnesses: pass exactly those with
--harnesses claude,codex,copilot,devin,opencode(any subset). - No harness named and the repo already has a hook surface (managed manifests, legacy generated roots,
hooks/adapters, or harness config containing hooks): run without--harnesses. It refreshes only the detected set and never adds harnesses. - Nothing detected: ask which harnesses; the default for a new scaffold is all five.
- Real hook behaviour is usually just session-start context and a stop check, so plan those first and add an event only when a repo script exists for it.
Running it
scripts/scaffold_all_hooks.sh --project <dir> [--harnesses a,b] [--plan plan.json] [--mode additive|overhaul] [--dry-run]