fix(protect-mcp): use current hook schema (hooks array) #503
Merged
wshobson merged 1 commit intowshobson:mainfrom Apr 26, 2026
Merged
fix(protect-mcp): use current hook schema (hooks array) #503wshobson merged 1 commit intowshobson:mainfrom
wshobson merged 1 commit intowshobson:mainfrom
Conversation
Owner
|
Verified against the current hooks schema in the official docs — the array form is correct, and this fixes a real load failure. Merging. Thanks! |
5 tasks
tomjwxf
added a commit
to tomjwxf/wshobson-agents
that referenced
this pull request
Apr 26, 2026
Migrates plugins/review-agent-governance/hooks/hooks.json from the
deprecated singular "hook": {...} shape to the current
"hooks": [{...}] array shape, matching the schema fix that landed
in wshobson#503 for plugins/protect-mcp/hooks/hooks.json.
Same conversion applied to both PreToolUse and PostToolUse blocks:
Before: { "matcher": ".*", "hook": {"type": "command", ...} }
After: { "matcher": ".*", "hooks": [{"type": "command", ...}] }
Verified the resulting structure matches the post-wshobson#503 shape used by
plugins/protect-mcp/hooks/hooks.json byte-for-byte at the schema level.
Without this fix, current Claude Code reports
"path: hooks.PreToolUse.0.hooks - expected array, received undefined"
on plugin load.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The protect-mcp hooks.json uses an outdated schema with
"hook": {...}(singular object). Current Claude Code expects"hooks": [...](array of hook objects) inside each matcher.On load, Claude Code reports:
protect-mcp@claude-code-workflows [protect-mcp]: Hook load failed:
path: hooks.PreToolUse.0.hooks — expected array, received undefined
path: hooks.PostToolUse.0.hooks — expected array, received undefined
This PR renames
hook→hooksand wraps each command object in an array,matching the schema used by other plugins in this marketplace (e.g. block-no-verify).