Install any skill in seconds. Free to start, no credit card required.
Get Started Free →To author, register, and test Rosetta hooks, add a SemanticKind, or debug a hook that won't fire.
.claude/skills/griddynamics-coding-agents-hooks-authoring/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -8% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 9% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 0% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 4% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 56% | 0% |
<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 distributed to all 5 IDEs (claude, codex, copilot, cursor, windsurf). 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:24 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 all 5 IDEs.
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 5 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:98 gates on toolKinds before calling 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 every plugin's hooks.json. The canonical source is plugins/core-claude/hooks/hooks.json.tmpl (and equivalent templates in other plugins). Direct edits to generated hooks.json files are overwritten on the next npx rosettify-plugins run.
Paths by plugin:
plugins/core-claude/hooks/hooks.json.tmpl → hooks.jsonplugins/core-copilot/hooks/hooks.json.tmpl → hooks/hooks.jsonplugins/core-cursor/.cursor/hooks/hooks.json.tmpl → hooks.jsonplugins/core-codex/.codex/hooks/hooks.json.tmpl → hooks.jsonplugins/core-windsurf/ — bundles are distributed but hooks.json registration is not covered by the regression test (hooks-registered.test.ts); register manually if needed.PreToolUse is absent on Copilot ('copilot': null in ide-registry.ts). If a hook uses a platform-exclusive event, add its name to CLAUDE_CODE_ONLY_HOOKS Set in src/hooks/tests/regression/hooks-registered.test.ts. Before adding a second scoped hook, refactor the Set to Map<string, Set<IdeName>>.
Co-locate tests in src/hooks/tests/<hook-name>.test.ts. The regression test (src/hooks/tests/regression/hooks-registered.test.ts) automatically discovers all .ts entries at src/hooks/src/hooks/ top level and asserts each is referenced in every plugin's hooks.json. A new hook without registration immediately fails the regression guard.
After any source change under src/hooks/src/ or instructions/r{2,3}/core/:
bashvenv/bin/python scripts/pre_commit.py
This builds CJS bundles, runs full test suite, and runs npx rosettify-plugins to sync instructions/r{2,3}/core/ → all plugin directories.
isLibraryModule workaround. Fix: move to subdirectory.buildDenyMessage echoes evidence to transcript by default. Pass redact=true for DANGEROUS_CONTENT matches (AWS keys, PEM certs, SQL with row data).[rf]{2,} false positives — matches rm -rr and rm -ff. Require both flags with lookaheads: /\brm\s+-(?=[a-zA-Z]*[rR])(?=[a-zA-Z]*[fF])[a-zA-Z]+\b/.$-anchor vs trailing slash — path patterns like /\.kube\/config$ fail when tested against filePath with trailing slash. Always test against normalizedPath = filePath.replace(/\/+$/, '').lookupToolKind and def.on.toolKinds is inert.src/hooks/scripts/build-bundles.mjs
src/hooks/src/runtime/ide-registry.ts
src/hooks/src/runtime/ide-rows/claude-code.ts
src/hooks/src/runtime/run-hook.ts:98
plugins/core-claude/hooks/hooks.json.tmpl
src/hooks/tests/regression/hooks-registered.test.ts</hooks_authoring>
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 23,530 | 11,764 | -50% | 1 | 1 | 0% | 4,039 | 3,706 | -8% | 0 | 0 | — |
case-02 | fail→pass | 15,037 | 7,038 | -53% | 1 | 1 | 0% | 2,515 | 2,733 | +9% | 0 | 0 | — |
case-03 | fail→pass | 16,737 | 6,920 | -59% | 1 | 1 | 0% | 2,765 | 2,770 | +0% | 0 | 0 | — |
case-04 | fail→fail | 9,244 | 5,096 | -45% | 1 | 1 | 0% | 1,478 | 2,403 | +63% | 0 | 0 | — |
case-05 | fail→pass | 11,706 | 3,235 | -72% | 1 | 1 | 0% | 1,870 | 1,939 | +4% | 0 | 0 | — |
case-06 | fail→pass | 12,373 | 10,025 | -19% | 1 | 1 | 0% | 2,038 | 3,189 | +56% | 0 | 0 | — |
case-07 | fail→pass | 12,979 | 3,518 | -73% | 1 | 1 | 0% | 2,120 | 1,976 | -7% | 0 | 0 | — |
case-08 | fail→pass | 10,705 | 2,389 | -78% | 1 | 1 | 0% | 1,805 | 1,808 | +0% | 0 | 0 | — |
case-09 | fail→pass | 10,101 | 3,218 | -68% | 1 | 1 | 0% | 1,480 | 1,930 | +30% | 0 | 0 | — |
case-10 | fail→pass | 11,502 | 4,418 | -62% | 1 | 1 | 0% | 1,721 | 2,203 | +28% | 0 | 0 | — |
case-11 | fail→pass | 10,148 | 2,593 | -74% | 1 | 1 | 0% | 1,549 | 1,766 | +14% | 0 | 0 | — |
case-12 | pass→pass | 12,180 | 1,527 | -87% | 1 | 1 | 0% | 1,742 | 1,623 | -7% | 0 | 0 | — |
case-13 | fail→pass | 10,698 | 2,569 | -76% | 1 | 1 | 0% | 1,742 | 1,752 | +1% | 0 | 0 | — |
case-14 | fail→pass | 12,477 | 3,176 | -75% | 1 | 1 | 0% | 2,106 | 1,928 | -8% | 0 | 0 | — |
case-15 | fail→pass | 16,441 | 7,885 | -52% | 1 | 1 | 0% | 2,638 | 2,861 | +8% | 0 | 0 | — |
case-16 | fail→pass | 15,155 | 1,531 | -90% | 1 | 1 | 0% | 2,482 | 1,686 | -32% | 0 | 0 | — |
case-17 | fail→pass | 11,310 | 1,898 | -83% | 1 | 1 | 0% | 1,784 | 1,676 | -6% | 0 | 0 | — |
case-18 | fail→pass | 7,734 | 1,782 | -77% | 1 | 1 | 0% | 1,156 | 1,708 | +48% | 0 | 0 | — |
case-19 | fail→pass | 11,414 | 1,612 | -86% | 1 | 1 | 0% | 1,804 | 1,685 | -7% | 0 | 0 | — |
case-20 | fail→pass | 22,191 | 3,077 | -86% | 1 | 1 | 0% | 3,885 | 1,967 | -49% | 0 | 0 | — |
case-21 | pass→pass | 8,268 | 4,100 | -50% | 1 | 1 | 0% | 1,420 | 2,086 | +47% | 0 | 0 | — |
case-22 | pass→pass | 15,329 | 10,130 | -34% | 1 | 1 | 0% | 2,766 | 3,379 | +22% | 0 | 0 | — |
case-23 | pass→pass | 12,018 | 13,212 | +10% | 1 | 1 | 0% | 2,350 | 3,905 | +66% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +78 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.