fix(plugins): drop redundant hooks key so the code-oz plugin loads#46
Conversation
Installing the code-oz plugin from the marketplace failed at load time: Hook load failed: Duplicate hooks file detected: ./hooks/hooks.json ... The standard hooks/hooks.json is loaded automatically, so manifest.hooks should only reference additional hook files. Claude Code auto-discovers hooks/hooks.json from the plugin root, so declaring it again in plugin.json's `hooks` key loads it twice and the whole plugin (commands included) fails to load. `claude plugin validate` and the offline suite passed because they asserted the broken value rather than load behavior; only a real `marketplace add` + `plugin install` surfaced it. Remove the `hooks` key from plugins/code-oz/.claude-plugin/plugin.json. The SessionStart router hook still loads via the conventional path (confirmed against the plugin reference docs). Flip the manifest test RED-first to assert the key is absent. Verified: real install of both plugins from a local marketplace now shows code-oz Status: enabled (was "failed to load"); code-oz-discipline unchanged. 3812 offline tests pass; typecheck clean; claude plugin validate passes.
|
Warning Review limit reached
More reviews will be available in 51 minutes and 4 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request removes the explicit declaration of the standard hooks file (./hooks/hooks.json) from the plugin.json manifest for the code-oz plugin, as standard hooks are auto-loaded and declaring them explicitly causes duplicate loading errors. The corresponding test in manifest-shape.test.ts has been updated to expect plugin.hooks to be undefined. I have no feedback to provide as there are no review comments.
Why
Discovered by a real post-merge dogfood of #45:
claude plugin marketplace add omerakben/code-oz+plugin install code-oz@code-oz-marketplaceinstalls the plugin, but it fails to load:Claude Code auto-discovers
hooks/hooks.jsonfrom the plugin root. Thecode-ozplugin also declared"hooks": "./hooks/hooks.json"inplugin.json, so it loaded twice and the whole plugin (commands + hook) failed to load.claude plugin validateand the offline suite passed because they asserted the broken value, not load behavior — only a real install surfaced it.What
hookskey fromplugins/code-oz/.claude-plugin/plugin.json. The SessionStart router still loads via the conventional path (confirmed against the plugin reference docs: hooks auto-load fromhooks/hooks.json; manifesthooksis for additional files only).Verification
marketplace add+plugin installof both plugins now showscode-ozStatus: enabled (was "failed to load");code-oz-disciplineunchanged.claude plugin validatepasses; 3812 offline tests pass; typecheck clean.