Skip to content

feat: ship bstack as a Claude Code plugin — installer-immune hooks (BRO-1926)#94

Merged
broomva merged 2 commits into
mainfrom
feature/bro-1926-bstack-plugin-manifest
Jul 16, 2026
Merged

feat: ship bstack as a Claude Code plugin — installer-immune hooks (BRO-1926)#94
broomva merged 2 commits into
mainfrom
feature/bro-1926-bstack-plugin-manifest

Conversation

@broomva

@broomva broomva commented Jul 16, 2026

Copy link
Copy Markdown
Owner

What

Adds a Claude Code plugin manifest to bstack so its six governance hooks travel as one versioned unit instead of hand-wired absolute paths in every consuming workspace's settings.json.

  • .claude-plugin/plugin.json — plugin manifest (v0.35.0)
  • .claude-plugin/marketplace.json — single-plugin marketplace (source: ".") → claude plugin marketplace add broomva/bstack
  • hooks/hooks.json — the 6 hooks, commands self-locating via ${CLAUDE_PLUGIN_ROOT}
  • VERSION 0.34.1 → 0.35.0 · CHANGELOG.md prepended

Why

The six hooks pointed at ~/.claude/skills/bstack/scripts/*.sh, under the skills-CLI-managed dir. A npx skills update -g that re-pulls the monorepo's primer-only bstack skill (skills/governance/bstack/, intentionally SKILL.md-only) strips scripts//bin/ and breaks all six hooks with No such file or directory — the incident on 2026-07-15. As a plugin: hook paths self-locate via ${CLAUDE_PLUGIN_ROOT}, the checkout is structurally invisible to the vercel-labs skills CLI, and the unit is versioned + marketplace-installable.

(Distinct from vercel-labs/skills#1523, the repo-root sibling-drop bug fixed in skills@1.5.18 — bstack's clobber came from the primer-only monorepo source, not #1523. RELEASE.md already documents why bstack is clone-installed; this reinforces it.)

Hooks provided (event → script)

Event Script primitive
SessionStart knowledge-wakeup-hook.sh P6
SessionStart bstack-autoupdate-hook.sh P7
Stop arc-continuation-hook.sh P19 (ordering-sensitive)
Stop leverage-sensor.py --throttle 21600 loop-sensor
UserPromptSubmit autonomous-posture-hook.sh P19
PreToolUse [Edit|Write|MultiEdit] l3-stability-pretool-hook.sh L3-G0

Safety / scope

  • Additive, non-breaking. The existing assets/templates/settings.json.snippet wiring stays. No install changes behavior until a workspace opts in.
  • Double-fire coupling (CHANGELOG § Migration): a workspace adopting the plugin must remove the six settings.json hook entries in the same change, or every hook fires twice. Vendored installs (rm -rf .git) do not auto-pull, so merging this does not auto-apply the manifest anywhere.
  • Stop ordering caveat: arc-continuation-hook.sh expects to run after a workspace's capture hooks — cross-source ordering validated on first session at adoption time (workspace-side, BRO-1926 Phase 2).

Validation

  • jq -e . on all three new JSON files: pass
  • claude plugin validate .claude-plugin/marketplace.json --strict: pass
  • claude plugin validate .claude-plugin/plugin.json: pass (1 benign warning — CLAUDE.md-at-root not loaded as plugin context; bstack's CLAUDE.md is a governance doc, intentionally kept)
  • VERSION ↔ CHANGELOG aligned (validate-release.yml)

Ticket: BRO-1926 (Phase 1 of 3). Phase 2 = workspace adoption; Phase 3 = bstack bootstrap prefers the plugin.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added Claude Code plugin support for bstack governance automation.
    • Added marketplace metadata for streamlined plugin discovery and installation.
    • Added automatic hook configuration for session, prompt, tool-use, and stop events.
  • Documentation

    • Documented plugin installation, migration steps, hook behavior, and backward compatibility.
  • Chores

    • Updated the release version to 0.35.0.

…RO-1926)

Add .claude-plugin/plugin.json + .claude-plugin/marketplace.json + hooks/hooks.json
so the six governance hooks load as a Claude Code plugin (bstack@skills-dir when
vendored under ~/.claude/skills/, or marketplace-installable) with
${CLAUDE_PLUGIN_ROOT}-relative paths, instead of hand-wired absolute paths in each
consuming workspace's settings.json that a `npx skills update` re-pull of the
primer-only monorepo skill can strip (the incident that broke all six hooks
2026-07-15; distinct from the now-fixed vercel-labs/skills#1523).

Additive/non-breaking: the settings.json.snippet wiring stays for backward-compat.
Adoption is opt-in (enable plugin + remove the six settings.json entries in the same
change to avoid double-fire). Bump 0.34.1 -> 0.35.0 (minor: new hooks-as-plugin).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@broomva, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9c5d6391-f557-4d72-9470-4c00a4253a71

📥 Commits

Reviewing files that changed from the base of the PR and between 50d8cec and 69a19b1.

📒 Files selected for processing (3)
  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • CHANGELOG.md
📝 Walkthrough

Walkthrough

Bstack is packaged as a Claude Code plugin at version 0.35.0, with marketplace metadata and ${CLAUDE_PLUGIN_ROOT}-relative governance hook commands. The changelog documents plugin adoption, legacy compatibility, and migration requirements.

Changes

Claude plugin packaging

Layer / File(s) Summary
Plugin manifests and governance hook wiring
.claude-plugin/plugin.json, .claude-plugin/marketplace.json, hooks/hooks.json
Adds plugin and marketplace metadata, then maps Claude Code lifecycle and tool events to six governance commands using ${CLAUDE_PLUGIN_ROOT} paths and configured timeouts.
Release version and migration documentation
VERSION, CHANGELOG.md
Bumps the version to 0.35.0 and documents plugin installation, legacy settings.json compatibility, duplicate-hook avoidance, and migration steps.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ClaudeCode
  participant HooksConfig as hooks/hooks.json
  participant GovernanceScripts as Governance scripts
  ClaudeCode->>HooksConfig: Load plugin hook mappings
  HooksConfig->>GovernanceScripts: Invoke ${CLAUDE_PLUGIN_ROOT}-relative commands
  GovernanceScripts-->>ClaudeCode: Complete hook execution
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: packaging bstack as a Claude Code plugin with installer-immune hooks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/bro-1926-bstack-plugin-manifest

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…uto-load double-fire (P20)

Skills-dir plugins auto-load AND auto-enable on presence (no install step, per
plugins-reference), so once this manifest reaches a vendored ~/.claude/skills/bstack
it would fire all six hooks alongside the still-present settings.json snippet =
silent double-fire (two leverage-sensor.py writers race on .control/leverage-state.json;
l3-stability-pretool double-counts the L3 rate budget). Set defaultEnabled:false in
plugin.json + the marketplace entry so the plugin loads DISABLED until an explicit
`claude plugin enable bstack@skills-dir`. Rewrite CHANGELOG to state the auto-load
trigger honestly, the <2.1.154 client residual (field ignored → enables on presence),
the source:"." ≥2.1.196 floor, and the 3-step adoption (enable + delete the six
snippet hooks in one change).

Caught by P20 Strata-B adversarial review (score 6/10, this was the lone MAJOR).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@broomva
broomva merged commit e2232fc into main Jul 16, 2026
6 checks passed
@broomva
broomva deleted the feature/bro-1926-bstack-plugin-manifest branch July 16, 2026 17:07
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