Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Documents how to author, register, and test Rosetta hooks, add SemanticKinds, and debug hooks that will not fire.
27% 95%+68 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 6 of 22 without it.
This test ran on v5. v8 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
<hooks_authoring>
Only files that export defineHook(…) AND call runAsCli(hook, module) belong directly in src/hooks/src/hooks/.
Every .ts at the top level of that directory becomes a standalone CJS bundle for each IDE in the build-bundles.mjs PLUGINS array (claude, codex, copilot, cursor, antigravity). Windsurf has an adapter but no bundle.
Helper/data files without runAsCli belong in a named subdirectory: src/hooks/src/hooks/<feature>/.
src/hooks/src/hooks/<feature>/ (e.g. src/hooks/src/hooks/dangerous-actions/patterns.ts).src/hooks/src/runtime/.src/hooks/scripts/build-bundles.mjs:29 uses readdirSync(hooksDir).filter(f => f.endsWith('.ts')).
There is no { recursive: true }. Subdirectories are invisible to the bundler.
Adding a top-level .ts without runAsCli produces a dead bundle for every plugin.
A plugin may opt a hook OUT via excludeHooks in the PLUGINS array (build-bundles.mjs) — e.g. the antigravity entry excludes the advise-only hooks, which have no delivery channel there.
When a hook needs a new tool category (e.g. mcp-call):
src/hooks/src/runtime/ide-registry.ts — add a row to TOOL_KINDS with all 6 IDE columns (null where the event doesn't exist). SemanticKind = keyof typeof TOOL_KINDS so TypeScript enforces coverage.src/hooks/src/runtime/ide-rows/<ide>.ts — if the kind requires special logic (e.g. prefix-match for mcp__.*), add a conditional branch at the top of lookupToolKind in the IDE-row file before the table loop. Table-driven lookup alone cannot handle open-ended tool name patterns.def.on.toolKinds.hooks.json.tmpl — widen to include new tool names/patterns.Order matters: run-hook.ts:316 gates on toolKinds before calling def.run(ctx). Matcher passes the event in; toolKinds must include the mapped kind or the call is dropped silently.
Every new hook must appear in each registering plugin's hooks.json. The canonical sources are the hooks.json.tmpl templates; direct edits to generated hooks.json files are overwritten on the next npx rosettify-plugins run.
Template paths by plugin, all under src/rosettify-plugins/plugins/ (templates are generator input only — .tmpl files are not emitted into the generated plugins/ tree):
template-claude/hooks/hooks.json.tmpltemplate-codex/.codex-plugin/hooks.json.tmpltemplate-copilot/hooks/hooks.json.tmpl (+ template-copilot/.github/plugin/hooks.json.tmpl)template-cursor/hooks.json.tmpl (+ template-cursor/hooks/hooks.json.tmpl)Next to this one in the catalogue, plus more from the same author.