Fix hooks/hooks.json schema in 4 plugins (record vs array)#226
Closed
morganmaiani-bit wants to merge 1 commit into
Closed
Fix hooks/hooks.json schema in 4 plugins (record vs array)#226morganmaiani-bit wants to merge 1 commit into
morganmaiani-bit wants to merge 1 commit into
Conversation
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.
4 tasks
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 |
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.
Summary
Four of the five plugins in this repo ship
hooks/hooks.jsonas[](a JSON array). The Claude Code plugin loader requires{"hooks": {...}}and rejects the load via/doctorwithexpected: "record", path: ["hooks"], received: undefined. The fifth plugin,investment-banking, already ships the correct shape — this PR brings the others into line.equity-research[]{"hooks": {}}financial-analysis[]{"hooks": {}}wealth-management[]{"hooks": {}}private-equity[]{"hooks": {}}investment-banking{"hooks": {}}None of the five
plugin.jsonmanifests 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.jsonalready passes the loader, so its content ({"hooks": {}}) is the safest target. An alternative would be to delete thehooks/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
directorysource in Claude Code./doctor. Observe:After this PR,
/doctorreports no errors for these plugins.Test plan
/doctorpasses forequity-research,financial-analysis,wealth-management,private-equityafter mergeinvestment-banking(file unchanged)plugin.json)