Repository navigation
Make the BB guide plugin forkable - #4193
Merged
Merged
Conversation
SawyerHood
force-pushed
the
bb/forkable-12-bb-guide
branch
2 times, most recently
from
September 23, 2026 17:53
249ab89 to
834a925
Compare
SawyerHood
force-pushed
the
bb/forkable-12-bb-guide
branch
from
September 23, 2026 20:40
834a925 to
8d3d6db
Compare
SawyerHood
marked this pull request as ready for review
September 23, 2026 21:07
bb-guide rendered its introduction with renderTemplate from @bb/templates, a workspace package a copy cannot install. No other code rendered that template, standardAgentAppendInstructions. The text now lives in the plugin as introduction.ts, and packages/templates drops the template file and its test. The test moves into the plugin and checks the text the plugin contributes. The template body was already trimmed and had no Handlebars expressions, so the text agents receive is byte-identical. The built server.js shrinks from 316 KB to 3 KB, since it no longer bundles Handlebars and every bb template. Its vitest config imported the repository's vitest.shared.ts and now uses defineConfig directly. The fork installs without npm's peer resolution, so the plugin declares better-sqlite3, cron-parser, and hono, which createFakePluginHost loads. It gets a lint script so the forkable import rule runs on it, and its turbo test task depends on the SDK build. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
SawyerHood
force-pushed
the
bb/forkable-12-bb-guide
branch
from
September 23, 2026 22:10
8d3d6db to
2023ebb
Compare
SawyerHood
added a commit
that referenced
this pull request
Sep 23, 2026
## Human comments ## What was wrong Twelfth PR in the forkable built-ins stack; it builds on #4193. `plugins/plugin-api-docs`, the Plugin Guide, was a small shell around `@bb/plugin-api-map`, a workspace package whose only consumer was this plugin. Through the map, the plugin also depended on `@bb/shared-ui/icon`, `@bb/shared-ui/switch`, and `@bb/text-utils`. The map imported 31 other plugins' `package.json` files by relative path, and some of its tests read app source. ## What changed - **The map moves into the plugin:** its source, tests, and surface-entry scaffold live under `src/`, `test/`, and `scripts/`, and `@bb/plugin-api-map` is gone. - Icons, the switch, and `cn` come through the registry aliases. - `escapeHtmlText` is copied in. - **First-party table:** the 31 manifest imports become `src/first-party-plugins.json`, a table of id, name, and icon. The Guide still uses it for "Used by" links and fallback icons. `app.js` shrinks by 33 KB because it no longer inlines every first-party `package.json`. - **Checks that read files outside the plugin stay in the repository:** - The anatomy-manifest source anchors are checked by `apps/app`'s `docs-anatomy-manifest` test, which now reads the manifest from the plugin. - The ThreadDetailView tab-order source check moves into that same test. - A new `@bb/scripts` test checks each first-party table row against the plugin's manifest. - **References:** `AGENTS.md`, the `plugin-guide-maintenance` skill, the verify-bb recipes, and `turbo.json` point at the new paths. ## How you verified - **Render comparison:** before and after produced 532 map-level entries (14.9 MB) and 66 page-level entries, all identical. They cover SSR and jsdom renders of every slide and card on desktop and mobile, the nav panel at four sub-paths, the clipboard payload, and every server mention resolution. - **Turbo:** `pnpm exec turbo run typecheck test lint --filter=bb-plugin-plugin-api-docs`, with every moved file's test count unchanged; `@bb/scripts` (a mutated table row fails the new test); `@bb/app` typecheck and tests. - **Fork check:** `pnpm check:plugin-forks plugins/plugin-api-docs` passes in a copy. - **Bundle:** `app.css` gains 8 unused scoped rules from class names that appear only in test assertions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) > AGENT GENERATED
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.
Human comments
What was wrong
Eleventh PR in the forkable built-ins stack; it builds on #4192. bb-guide renders the standard introduction bb gives agents with
renderTemplatefrom@bb/templates, a workspace package a copy can't install. No other code renders that template (standardAgentAppendInstructions). The plugin also usedvitest.shared.tsand didn't declare the SDK harness's peers.What changed
introduction.ts.packages/templatesdrops the template file and its test, and the test moves into the plugin, where it checks the text the plugin contributes.server.jsshrinks from 316 KB to 3 KB, since it no longer bundles Handlebars and every bb template.defineConfig, declared peers, a lint script, and a turbo test entry.How you verified
server.jsfrom before and after with a fakebbproduced the same instructions,configure()result, and settings for introduction on and off (same sha256).pnpm exec turbo run typecheck test lint --filter=bb-plugin-bb-guide --filter=@bb/templates, and typecheck of@bb/app,@bb/server,@bb/sdk,@bb/cli, and@bb/integration-tests.@bb/clitests (includingbb-cli-skill-coverage) and the integration smokelifecycle.test.ts, which loads the built-in bb-guide and checks the instructions.pnpm check:plugin-forks plugins/bb-guidepasses in a copy.🤖 Generated with Claude Code