Skip to content

docs(plugins): document the full bb.sdk area surface - #1200

Merged
SawyerHood merged 1 commit into
mainfrom
bb/check-issue-1191-status-thr_zq6eguc7tr
Aug 8, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
bb/check-issue-1191-status-thr_zq6eguc7tr

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Refs #1191.

Why

Issue #1191 asks for bb.sdk.threads.list() and bb.sdk.threads.update({ title }). Both shipped on 2026-06-04, two months before the issue. The problem is discoverability: the plugin-authoring skill documents threads.spawn, threads.send, and threads.get, but never list or update — and it leaves nine bb.sdk areas out entirely. A plugin author who reads the skill concludes the APIs do not exist.

What changed

SKILL.md — an SDK area map. The skill covered threads, projects, files, terminals, and subscribe. It never mentioned hosts, providers, skills, plugins, theme, status, system, threadSections, or guide. The new table lists all 14 areas, their 8 sub-areas, and every method name, with a pointer to types/bb-plugin-sdk.d.ts for exact signatures.

SKILL.md — thread read/edit and event timing. A worked example for threads.list / get / timeline / update, plus the third point the issue raised: thread.created fires on row creation, before the first user message lands, so a plugin should listen on thread.active and read messages with threads.timeline. Handlers dispatch fire-and-forget through setImmediate after the transition settles, so threads.update from a handler cannot delay or interrupt a turn.

api_to_audit.md — one missing entry. AGENTS.md requires every experimental_ member to have an audit entry. experimental_useSidebarThreadSplit had none. The new entry lists three things to audit before the prefix drops.

Verification

I swept four surfaces by script rather than by eye:

Surface Result
bb.sdk areas (15) 9 undocumented → now covered
Backend BbPluginApi members (17) and their methods already complete
Frontend slots (11) and hooks/components (17) already complete
experimental_ members vs api_to_audit.md 1 missing → added

The area map is checked against the 22 source interfaces: no invented method names, no missing ones. Documentation only — no code or wire changes.

🤖 Generated with Claude Code

The plugin-authoring skill documented threads.spawn, threads.send, and
threads.get, but never threads.list or threads.update, and it left nine
bb.sdk areas out entirely. Issue #1191 reports the resulting conclusion:
a plugin author read the skill and filed a request for thread list and
update APIs that have shipped since June.

Add an area map to the bb.sdk section covering all 14 areas, their
sub-areas, and every method name. Add a threads read/edit example, and
note that thread.created fires before the first message lands, so a
plugin should react on thread.active and read threads.timeline. Handlers
are fire-and-forget, so threads.update from one cannot delay a turn.

Also add the missing api_to_audit.md entry for
experimental_useSidebarThreadSplit, which AGENTS.md requires.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@SawyerHood SawyerHood left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🚨 SLOP COP 🚨 · review

I am SlopCop. I am reviewing this pull request for security, code quality, performance, architecture, duplication, and practical test coverage.

@SawyerHood
SawyerHood merged commit 010ef9c into main Aug 8, 2026
10 checks passed
@SawyerHood
SawyerHood deleted the bb/check-issue-1191-status-thr_zq6eguc7tr branch August 8, 2026 16:40
sidebar panel or a spawned thread to reach them:

```ts
const { threads } = await bb.sdk.threads.list({ projectId, limit: 50 });

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🚨 slopcop/review — This example uses the wrong response shape.

threads.list returns a ThreadListResponse, which is a plain array. This code sets threads to undefined. Use const threads = await bb.sdk.threads.list({ projectId, limit: 50 });.

Comment thread docs/api_to_audit.md
a sidebar of many distinct worktrees does not stampede the git host; and
returning `null` for "lookup failed" (rather than an error) is the right
failure for a row that should simply show nothing.
9. **`experimental_useSidebarThreadSplit`.** Gives a custom row the built-in

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🚨 slopcop/review — This audit entry duplicates an existing audit section.

docs/plugin-sidebar-thread-list.md already has the same hook and three matching audit points. It also has two extra points. Choose one source and link to it, or keep both lists complete and linked.

that need the singleton personal project use
`bb.sdk.projects.list({ includePersonal: true })`.

**Area map.** Every area below is reachable from `bb.sdk`. This lists the

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🚨 slopcop/review — The new SDK map has no drift check.

plugin-authoring-docs.test.ts checks top-level plugin API names, but it treats sdk as one opaque name. Add a generated map or a test for all SDK areas and methods. This prevents the same stale-document problem from returning.

@SawyerHood SawyerHood left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🚨 SLOP COP 🚨 · review

ELI5: This PR adds a map of tools for plugin authors. One example says a list comes inside a box. The API gives the list directly.

Findings

  1. High — incorrect example. threads.list returns an array. The new example destructures { threads }, so it gets undefined. Use const threads = await bb.sdk.threads.list({ projectId, limit: 50 });.
  2. Medium — duplicate audit text. docs/plugin-sidebar-thread-list.md already audits experimental_useSidebarThreadSplit. The two lists overlap and omit different points. Keep one source, or link and synchronize both sources.
  3. Medium — no drift guard. The SDK map copies about 200 method names from the type contract. The existing documentation test treats sdk as one name. Add a generated map or a test for all areas and methods.

Checks

  • The security review found no security or trust-boundary issue.
  • The performance review found no runtime or operational issue.
  • The area map matches all 14 areas, all 8 sub-areas, and all current methods.
  • The thread filters, update fields, event timing, and fire-and-forget claims match the source.
  • A browser test does not apply because both changed files are Markdown documentation.
  • All current GitHub checks pass.

Please fix the array example before merge. The two maintenance findings can prevent this documentation from becoming stale again.

amadad pushed a commit to amadad/bb that referenced this pull request Aug 14, 2026
Refs get-bb#1191.

## Why

Issue get-bb#1191 asks for `bb.sdk.threads.list()` and
`bb.sdk.threads.update({ title })`. Both shipped on 2026-06-04, two
months before the issue. The problem is discoverability: the
plugin-authoring skill documents `threads.spawn`, `threads.send`, and
`threads.get`, but never `list` or `update` — and it leaves nine
`bb.sdk` areas out entirely. A plugin author who reads the skill
concludes the APIs do not exist.

## What changed

**`SKILL.md` — an SDK area map.** The skill covered `threads`,
`projects`, `files`, `terminals`, and `subscribe`. It never mentioned
`hosts`, `providers`, `skills`, `plugins`, `theme`, `status`, `system`,
`threadSections`, or `guide`. The new table lists all 14 areas, their 8
sub-areas, and every method name, with a pointer to
`types/bb-plugin-sdk.d.ts` for exact signatures.

**`SKILL.md` — thread read/edit and event timing.** A worked example for
`threads.list` / `get` / `timeline` / `update`, plus the third point the
issue raised: `thread.created` fires on row creation, before the first
user message lands, so a plugin should listen on `thread.active` and
read messages with `threads.timeline`. Handlers dispatch fire-and-forget
through `setImmediate` after the transition settles, so `threads.update`
from a handler cannot delay or interrupt a turn.

**`api_to_audit.md` — one missing entry.** `AGENTS.md` requires every
`experimental_` member to have an audit entry.
`experimental_useSidebarThreadSplit` had none. The new entry lists three
things to audit before the prefix drops.

## Verification

I swept four surfaces by script rather than by eye:

| Surface | Result |
| --- | --- |
| `bb.sdk` areas (15) | 9 undocumented → now covered |
| Backend `BbPluginApi` members (17) and their methods | already
complete |
| Frontend slots (11) and hooks/components (17) | already complete |
| `experimental_` members vs `api_to_audit.md` | 1 missing → added |

The area map is checked against the 22 source interfaces: no invented
method names, no missing ones. Documentation only — no code or wire
changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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