Repository navigation
Feat/hook dispatcher default disabled - #93
Conversation
Most hooks were 6-13 line files that only picked a few fields off the input and called runHook. Replace them with a single generic entrypoint (scripts/hook.js <EventName>) plus a field-mapper table (lib/hook-registry.js); hooks.json routes observation-only events through it. Hooks that need runHook options or custom logic keep dedicated entrypoints (session_start, session_end, stop, on_signin_result, user_prompt_expansion_signin). - 20 thin hook files removed; adding an observation-only hook is now a one-line registry entry + a hooks.json line - registry mappers keep the (input, ctx) buildData contract, so ctx-using hooks (e.g. SubagentStop's getTranscriptId) port unchanged - hook.js exits non-zero on an unknown event name - test/lib.test.js locks the registry <-> hooks.json contract (no missing/orphan mappers, event name == argv) - README script tree updated Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KoEUHYQTz1Tx61FcteE979
Version bump for the data-driven hook dispatcher refactor. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KoEUHYQTz1Tx61FcteE979
brandLine now renders "SkillMeter v<version> · skillbench" (from PLUGIN_VERSION) across the sign-in-required, telemetry-active, and welcome boxes. This surfaces the version the current session's hooks actually loaded — a stale session (older cached version than the installed one, which only updates on restart) is now visible at a glance. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KoEUHYQTz1Tx61FcteE979
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (27)
Disabled knowledge base sources:
WalkthroughThis PR replaces individual per-hook Node.js CLI scripts with a centralized ChangesHook Dispatch Centralization
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant hooksJson as hooks.json
participant hookJs as hook.js
participant registry as hook-registry.js
participant runHook as runHook
hooksJson->>hookJs: invoke with event name
hookJs->>registry: lookup mapper for event
registry-->>hookJs: mapper function
hookJs->>runHook: runHook(event, buildData)
runHook-->>hookJs: resolve or reject
Possibly related PRs
Suggested reviewers: Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests