fix: correct hooks.json structure with nested matcher objects #346

Merged
lmiranda merged 1 commits from fix/hooks-json-structure into development 2026-01-31 21:14:45 +00:00
Owner

Summary

  • Fixed hooks.json structure in 8 plugins to match Claude Code's required format
  • The old format used flat arrays with "event" field - Claude Code ignores this
  • The correct format requires nested "hooks" object with matcher arrays

Plugins Fixed

  • clarity-assist
  • claude-config-maintainer
  • cmdb-assistant
  • contract-validator
  • data-platform
  • pr-review
  • projman
  • viz-platform

Correct Structure

{
  "hooks": {
    "EventName": [
      {
        "matcher": "pattern",
        "hooks": [
          { "type": "command", "command": "..." }
        ]
      }
    ]
  }
}

Test plan

  • Restart Claude Code session after merge
  • Verify hooks fire on SessionStart, PreToolUse, PostToolUse events
  • Run ./scripts/verify-hooks.sh passes

🤖 Generated with Claude Code

## Summary - Fixed hooks.json structure in 8 plugins to match Claude Code's required format - The old format used flat arrays with `"event"` field - Claude Code ignores this - The correct format requires nested `"hooks"` object with matcher arrays ## Plugins Fixed - clarity-assist - claude-config-maintainer - cmdb-assistant - contract-validator - data-platform - pr-review - projman - viz-platform ## Correct Structure ```json { "hooks": { "EventName": [ { "matcher": "pattern", "hooks": [ { "type": "command", "command": "..." } ] } ] } } ``` ## Test plan - [ ] Restart Claude Code session after merge - [ ] Verify hooks fire on SessionStart, PreToolUse, PostToolUse events - [ ] Run `./scripts/verify-hooks.sh` passes 🤖 Generated with [Claude Code](https://claude.ai/code)
lmiranda added 1 commit 2026-01-31 21:11:37 +00:00
The hooks.json files had incorrect structure. Claude Code requires:
- Top-level "hooks" object
- Event names as keys containing arrays
- Each array element must have "matcher" and nested "hooks" array

Fixed 8 plugins:
- clarity-assist
- claude-config-maintainer
- cmdb-assistant
- contract-validator
- data-platform
- pr-review
- projman
- viz-platform

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
lmiranda merged commit f0f4369eac into development 2026-01-31 21:14:45 +00:00
lmiranda deleted branch fix/hooks-json-structure 2026-01-31 21:14:45 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: personal-projects/leo-claude-mktplace#346