Skip to content

v1.2.0 — Dispatcher Pattern

Choose a tag to compare

@hwells4 hwells4 released this 28 Feb 05:49
· 5 commits to main since this release

What's New

The Dispatcher Pattern

When you have 3+ hooks on the same event, they all fire in parallel — each one parsing the same JSON, resolving the same file path, classifying the same file type. A dispatcher replaces them with one process that does the shared work once and routes to individual check scripts.

Before: 9 hooks = 9 processes, 9 JSON parses, 9 settings entries
After: 1 dispatcher = 1 process, 1 JSON parse, 1 settings entry

Adding a new check becomes: drop a .sh file in checks/, make it executable. No settings changes needed.

New Files

  • references/dispatcher-pattern.md — Full architecture guide with performance benchmarks, three dispatcher variants (shell plugin, Python function, Python plugin), and migration steps
  • templates/dispatcher.sh — Shell dispatcher template (recommended). Routes to scripts in a checks/ directory.
  • templates/dispatcher.py — Python dispatcher template. Handler functions in a single file for complex logic.
  • workflows/create-dispatcher.md — Step-by-step workflow for consolidating existing hooks into a dispatcher

Updated

  • SKILL.md — Dispatcher-first principle: the create-hook flow now auto-detects when a dispatcher should be used instead of a standalone hook
  • workflows/create-hook.md — Three-path routing: existing dispatcher → recommend dispatcher → standalone hook
  • references/sub-agents.md — Inventory agent now recommends dispatchers when 2+ hooks exist on the same event
  • README — Expanded with before/after diagrams, "add a check" walkthrough, and dispatcher decision table

Also in this release

  • Built-in hook debugging with telemetry (debug-wrap.sh + hook-log.py)
  • Hook validator with installation-level checking (validate-hook.py)

Full Changelog: v1.1.0...v1.2.0