Skip to content

fix(plugins): hooks.json must be {"hooks": {}}; add validator + CI guard#231

Open
RJK134 wants to merge 1 commit into
anthropics:mainfrom
RJK134:fix/hooks-json-schema-and-ci-guard
Open

fix(plugins): hooks.json must be {"hooks": {}}; add validator + CI guard#231
RJK134 wants to merge 1 commit into
anthropics:mainfrom
RJK134:fix/hooks-json-schema-and-ci-guard

Conversation

@RJK134
Copy link
Copy Markdown

@RJK134 RJK134 commented May 18, 2026

Summary

  • Fixes hooks.json in 4 vertical plugins (private-equity, financial-analysis, equity-research, wealth-management) — was [], now {"hooks": {}}. Investment-banking already had the correct shape and is used as the reference.
  • Adds a hooks.json schema check to scripts/check.py so any future regression fails fast with a clear message: hooks.json: <path>: must be {"hooks": {...}}, got <type>.
  • Adds a new .github/workflows/check.yml job that runs python3 scripts/check.py on every pull_request and push to main, gating this class of bug at PR time.

Why this PR

The Claude Code plugin loader rejects an empty-array hooks.json with:

expected: "record", path: ["hooks"], received: undefined

This has produced a long stream of duplicate community PRs (#226, #225, #224, #221, #216, #206, #203, #200, #193, #192, #167, #163, #162, #146, #141, and others — ~27 in total). Each fixes the same 4 files. This PR consolidates the fix and prevents the bug class from recurring by adding both a validator and a CI guard, so the duplicate-PR queue can be closed in one go.

The version-bump pre-commit hook (from #208) ran automatically and patch-bumped the 4 affected plugin versions from 0.1.0 → 0.1.1.

Test plan

  • python3 scripts/check.py exits 0 on the fixed tree (OK — 85 file(s) checked, 0 issues.).
  • Manually re-corrupted one hooks.json back to []; check.py exited 1 with hooks.json: plugins/vertical-plugins/private-equity/hooks/hooks.json: must be {"hooks": {...}}, got list. Restored, re-ran, clean.
  • On merge: confirm the new check workflow runs green on main.
  • On merge: bulk-close the ~27 duplicate community PRs above with a comment pointing at the merge commit.

🤖 Generated with Claude Code

The 4 vertical plugins (private-equity, financial-analysis, equity-research,
wealth-management) had `hooks.json` written as `[]`, which the Claude Code
plugin loader rejects with `expected: "record", path: ["hooks"], received:
undefined`. Investment-banking already had the correct `{"hooks": {}}` shape.

This corrects the 4 files, adds a hooks.json schema check to `scripts/check.py`
(fails CI on any future regression of this shape), and wires `check.py` into a
new `check` GitHub Actions workflow that runs on every PR + push to main.

Supersedes the duplicate community PRs that have been queuing on this issue
(anthropics#226, anthropics#225, anthropics#224, anthropics#221, anthropics#216, anthropics#206, anthropics#203, anthropics#200, anthropics#193, anthropics#192, anthropics#167, anthropics#163,
anthropics#162, anthropics#146, anthropics#141, and others).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown
Author

@RJK134 RJK134 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed

@RJK134 RJK134 marked this pull request as draft May 18, 2026 18:25
Copy link
Copy Markdown
Author

@RJK134 RJK134 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rviewe

@RJK134 RJK134 marked this pull request as ready for review May 18, 2026 18:26
@RJK134 RJK134 closed this May 19, 2026
@RJK134 RJK134 deleted the fix/hooks-json-schema-and-ci-guard branch May 19, 2026 08:49
@RJK134 RJK134 restored the fix/hooks-json-schema-and-ci-guard branch May 19, 2026 20:18
@RJK134 RJK134 reopened this May 19, 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.

1 participant