Author BB plugins
A BB plugin is a TypeScript package that can add server behavior, agent
capabilities, host-rendered UI, or a frontend bundle.
Use the current SDK types and repository source as the contract. This skill
routes to detailed references, but the installed BB version decides the exact
API.
Implement and verify
Inspect the affected package and current SDK declarations to select backend,
frontend, or both. Build the plugin and verify the affected contracts and user
workflow. Install or reload when a live check is needed for the requested work.
Use bb plugin new for a new plugin. The scaffold includes frontend files.
Remove bb.app and those files when the plugin is headless.
Every new public Plugin SDK surface starts with an experimental_ prefix and an
entry in docs/api_to_audit.md. Add its Plugin Guide card and API inventory in
the same change.
Read only the relevant reference
Start, package, and release
- Read references/quickstart.md for package structure, manifest fields,
scaffold output, build, install, and the first plugin.
- Read references/distribution.md for exact API lookup, Git or npm release,
multi-plugin repositories, and custom marketplaces.
Backend
- Read references/backend-foundation.md for the factory, logging, settings,
storage, server information, and host access.
- Read references/backend-sdk.md for projects, environments, threads,
interactions, provider models, browser sessions, and event history.
- Read references/backend-api-index.md to check every public backend, host,
AI-service, and test export.
- Read references/backend-events.md for lifecycle events, environment providers,
HTTP, RPC, realtime, background services, and schedules.
- Read references/backend-machines.md for machine providers, core project source
setup, enrollment/bootstrap helpers, and server access.
- Read references/backend-cli-agents.md for CLI commands, input forms, agent
tools, agent configuration, and helper AI services.
- Read references/providers.md only when the plugin registers an agent provider.
- Read references/provider-bridge-api-index.md to check every public provider
bridge, bridge-test, and ACP export.
- Read references/backend-ui-lifecycle.md for host-rendered UI, status, cleanup,
and reload behavior.
Frontend
- Read references/frontend-registration.md for definePluginApp, thread header,
sidebar replacement, providers, and top-level registration.
- Read references/frontend-api-index.md to check every public frontend
runtime value and type export.
- Read references/frontend-core-slots.md for trusted content scripts, homepage,
settings, navigation, thread panels, interactions, sidebar actions, and file
openers.
- Read references/frontend-renderer-slots.md for source, diff, message,
timeline, palette, and provider-icon renderers or actions.
- Read references/frontend-components.md for ThreadChat, provider controls,
source and diff viewers, links, panels, and the new-thread composer.
- Read references/frontend-hooks-and-ui.md for hooks, composer customization,
vendored components, runtime shims, styling, and crash isolation.
Testing
- Read references/frontend-testing-api-index.md to check every frontend test
runtime value and type export.
- Read references/testing.md before you add tests or run a live plugin loop.
Contract rules
- Parse freeform input at the boundary and pass typed values internally.
- Declare only manifest fields and settings that the plugin implements.
- Keep secret settings on the server.
- Treat frontend parameters and persisted values as untrusted input.
- Return bounded CLI and agent-tool output.
- Document plugin commands, settings, and operating constraints in the plugin's
own
skills/ directory. The core CLI skill owns generic plugin management,
not individual plugin behavior.
- Dispose every service, schedule, listener, content script, and resource.
- Use SDK host components and navigation for host-owned behavior.
- Use vendored UI source for plugin-owned controls.
- Keep experimental names until the public API audit stabilizes them.
- Use current names. Compatibility aliases can warn and can expire after one
release. Removed APIs can throw.
- Run bb plugin types when SDK declaration versions can drift.
- Run bb plugin build before install, release, or marketplace submission.
Verification
Confirm the backend contract, frontend contract, manifest, generated bundle,
and live behavior that the change affects. Use focused tests for failure-prone
policy and lifecycle behavior.
1---2name: bb-plugin-authoring3description: Create or change BB plugins and Plugin SDK extensions, including CLI commands, agent tools, providers, and UI surfaces.4---56# Author BB plugins78A BB plugin is a TypeScript package that can add server behavior, agent9capabilities, host-rendered UI, or a frontend bundle.1011Use the current SDK types and repository source as the contract. This skill12routes to detailed references, but the installed BB version decides the exact13API.1415## Implement and verify1617Inspect the affected package and current SDK declarations to select backend,18frontend, or both. Build the plugin and verify the affected contracts and user19workflow. Install or reload when a live check is needed for the requested work.2021Use bb plugin new <name> for a new plugin. The scaffold includes frontend files.22Remove `bb.app` and those files when the plugin is headless.2324Every new public Plugin SDK surface starts with an experimental\_ prefix and an25entry in docs/api_to_audit.md. Add its Plugin Guide card and API inventory in26the same change.2728## Read only the relevant reference2930### Start, package, and release3132- Read references/quickstart.md for package structure, manifest fields,33 scaffold output, build, install, and the first plugin.34- Read references/distribution.md for exact API lookup, Git or npm release,35 multi-plugin repositories, and custom marketplaces.3637### Backend3839- Read references/backend-foundation.md for the factory, logging, settings,40 storage, server information, and host access.41- Read references/backend-sdk.md for projects, environments, threads,42 interactions, provider models, browser sessions, and event history.43- Read references/backend-api-index.md to check every public backend, host,44 AI-service, and test export.45- Read references/backend-events.md for lifecycle events, environment providers,46 HTTP, RPC, realtime, background services, and schedules.47- Read references/backend-machines.md for machine providers, core project source48 setup, enrollment/bootstrap helpers, and server access.49- Read references/backend-cli-agents.md for CLI commands, input forms, agent50 tools, agent configuration, and helper AI services.51- Read references/providers.md only when the plugin registers an agent provider.52- Read references/provider-bridge-api-index.md to check every public provider53 bridge, bridge-test, and ACP export.54- Read references/backend-ui-lifecycle.md for host-rendered UI, status, cleanup,55 and reload behavior.5657### Frontend5859- Read references/frontend-registration.md for definePluginApp, thread header,60 sidebar replacement, providers, and top-level registration.61- Read references/frontend-api-index.md to check every public frontend62 runtime value and type export.63- Read references/frontend-core-slots.md for trusted content scripts, homepage,64 settings, navigation, thread panels, interactions, sidebar actions, and file65 openers.66- Read references/frontend-renderer-slots.md for source, diff, message,67 timeline, palette, and provider-icon renderers or actions.68- Read references/frontend-components.md for ThreadChat, provider controls,69 source and diff viewers, links, panels, and the new-thread composer.70- Read references/frontend-hooks-and-ui.md for hooks, composer customization,71 vendored components, runtime shims, styling, and crash isolation.7273### Testing7475- Read references/frontend-testing-api-index.md to check every frontend test76 runtime value and type export.77- Read references/testing.md before you add tests or run a live plugin loop.7879## Contract rules8081- Parse freeform input at the boundary and pass typed values internally.82- Declare only manifest fields and settings that the plugin implements.83- Keep secret settings on the server.84- Treat frontend parameters and persisted values as untrusted input.85- Return bounded CLI and agent-tool output.86- Document plugin commands, settings, and operating constraints in the plugin's87 own `skills/` directory. The core CLI skill owns generic plugin management,88 not individual plugin behavior.89- Dispose every service, schedule, listener, content script, and resource.90- Use SDK host components and navigation for host-owned behavior.91- Use vendored UI source for plugin-owned controls.92- Keep experimental names until the public API audit stabilizes them.93- Use current names. Compatibility aliases can warn and can expire after one94 release. Removed APIs can throw.95- Run bb plugin types when SDK declaration versions can drift.96- Run bb plugin build before install, release, or marketplace submission.9798## Verification99100Confirm the backend contract, frontend contract, manifest, generated bundle,101and live behavior that the change affects. Use focused tests for failure-prone102policy and lifecycle behavior.