Skip to content

Add hook matcher support to techpack schema#315

Merged
bguidolim merged 1 commit intomainfrom
bruno/hook-matcher-support
Apr 1, 2026
Merged

Add hook matcher support to techpack schema#315
bguidolim merged 1 commit intomainfrom
bruno/hook-matcher-support

Conversation

@bguidolim
Copy link
Copy Markdown
Collaborator

Summary

Add hookMatcher support to the techpack YAML schema, allowing pack authors to specify a regex matcher that filters when a hook fires. This maps directly to Claude Code's matcher field on HookGroup, which was already round-tripped in settings JSON but never populated from the pack pipeline.

Changes

  • Add matcher: String? to HookRegistration struct and thread through Settings.addHookEntry(), YAML manifest decode/encode, sync composition (ConfiguratorSupport), export discovery (ConfigurationDiscovery), and YAML emission (ManifestBuilder)
  • Add hookMatcher CodingKey with orphaned-metadata rejection (requires hookEvent, same as hookTimeout/hookAsync/hookStatusMessage)
  • Add drift detection for matcher changes in addHookEntry() (compares groups[index].matcher on the HookGroup level)
  • Update documentation in docs/techpack-schema.md, skills/techpack-creator/references/techpack-schema.md, and skills/techpack-creator/SKILL.md

Test plan

  • swift test passes locally (963 tests, 7 new)
  • swiftformat --lint . and swiftlint pass without violations
Checklist for engine changes
  • Integration tests updated for new features (LifecycleIntegrationTests)
  • Docs updated if behavior changed (docs/techpack-schema.md, skill references)

@bguidolim bguidolim merged commit 3d463dd into main Apr 1, 2026
4 checks passed
@bguidolim bguidolim deleted the bruno/hook-matcher-support branch April 1, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant