Skip to content

Fix hooks/hooks.json schema in 4 plugins (record vs array)#226

Closed
morganmaiani-bit wants to merge 1 commit into
anthropics:mainfrom
morganmaiani-bit:fix/hooks-json-schema
Closed

Fix hooks/hooks.json schema in 4 plugins (record vs array)#226
morganmaiani-bit wants to merge 1 commit into
anthropics:mainfrom
morganmaiani-bit:fix/hooks-json-schema

Conversation

@morganmaiani-bit

Copy link
Copy Markdown

Summary

Four of the five plugins in this repo ship hooks/hooks.json as [] (a JSON array). The Claude Code plugin loader requires {"hooks": {...}} and rejects the load via /doctor with expected: "record", path: ["hooks"], received: undefined. The fifth plugin, investment-banking, already ships the correct shape — this PR brings the others into line.

Plugin Before After
equity-research [] {"hooks": {}}
financial-analysis [] {"hooks": {}}
wealth-management [] {"hooks": {}}
private-equity [] {"hooks": {}}
investment-banking {"hooks": {}} unchanged

None of the five plugin.json manifests declare hooks, so this is a no-op functionally — it's purely a schema fix to silence the loader error.

Why this shape

investment-banking/hooks/hooks.json already passes the loader, so its content ({"hooks": {}}) is the safest target. An alternative would be to delete the hooks/ directory entirely on the four plugins, but that's a bigger diff and depends on loader behavior when the directory is absent. Minimum-diff wins here.

Reproduction

  1. Add this marketplace via directory source in Claude Code.
  2. Enable any of the four affected plugins.
  3. Run /doctor. Observe:
Plugin (equity-research @ equity-research@financial-services-plugins): Hook load failed: [
  {
    "expected": "record",
    "code": "invalid_type",
    "path": ["hooks"],
    "message": "Invalid input: expected record, received undefined"
  }
]

After this PR, /doctor reports no errors for these plugins.

Test plan

  • /doctor passes for equity-research, financial-analysis, wealth-management, private-equity after merge
  • No regression for investment-banking (file unchanged)
  • No regression in any plugin's actual command/skill/hook behavior (no hooks are declared in any plugin.json)

equity-research, financial-analysis, private-equity, and
wealth-management each shipped `hooks/hooks.json` as `[]`, a JSON
array. The Claude Code plugin loader treats the presence of
`hooks/hooks.json` as a hook declaration and validates the file
against a schema requiring `{"hooks": {...}}`. Because `[]` has no
`hooks` key, `/doctor` rejects the load with:

  expected: "record", code: "invalid_type",
  path: ["hooks"], message: "Invalid input: expected record,
  received undefined"

investment-banking already ships the correct shape `{"hooks": {}}`
and loads cleanly; this change brings the other four plugins into
line with that shape. None of the affected `plugin.json` manifests
declare hooks, so this is a no-op functionally — just a schema fix.
@mihilmy

mihilmy commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Thanks for catching this and taking the time to send a fix! 🙏 This was reported by many contributors — the underlying bug is now resolved in #232, which repairs all four broken hooks.json files ([]{"hooks": {}}) and adds a plugin-validate CI check (the official claude plugin validate) so a malformed manifest can't regress again. Closing as superseded by #232. Really appreciate the contribution.

@mihilmy mihilmy closed this May 18, 2026
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.

2 participants