Summary
Users currently create beads exclusively by talking to the mayor, who calls gt_sling or gt_sling_batch on their behalf. There is no direct UI surface for a user to create a bead themselves — and the old "Sling Work" button (which opened a simple title/body dialog) is likely broken or vestigial at this point.
This feature gives users a first-class UI surface for creating beads directly, while keeping the mayor in the loop to help plan and enrich the work.
Proposed Experience
- "New Bead" button/drawer — a clean right-side panel with a full MDXEditor markdown editor, replacing or supplementing the old Sling Work button
- Workers AI enrichment — as the user types, a debounced call to a Workers AI endpoint auto-suggests a title and labels based on the content. Suggestions appear as ghost text / clickable chips; the user can accept, modify, or ignore them
- "Start immediately" checkbox (default: unchecked) — when unchecked, the bead is created as
open without dispatching a polecat. When checked, the bead is dispatched immediately
- Mayor notification — when a bead is created without "start immediately", the mayor is automatically notified: "I notice you just created a new bead titled 'X'. Would you like me to explore the codebase and flesh out a plan, or decompose it into a convoy?"
- Mayor response in bead drawer — the mayor's reply surfaces as a conversation thread inside the bead detail drawer (via a
message bead with parent_bead_id)
Implementation Plan
Bead 1 — Backend: createBead tRPC + Workers AI enrichment endpoint
- New
createBead tRPC procedure that creates an open bead without dispatching
- New
enrichBead tRPC procedure backed by Workers AI (AI binding already configured) — accepts markdown body, returns suggested { title, labels }
notifyMayorOfNewBead(beadId, rigId, title, body) on the Town DO — calls sendMayorMessage() with bead context
Bead 2 — UI: CreateBeadDrawer with MDXEditor
- New
CreateBeadDrawer.tsx — right-side panel (620px, matches existing drawer pattern)
MarkdownEditor.tsx — thin MDXEditor wrapper (https://mdxeditor.dev/editor/docs/getting-started), dynamically imported for SSR
- AI enrichment: debounced 1.5s, updates title/labels fields as ghost suggestions
- "Start immediately" checkbox with hint text when unchecked
- Replaces (or fixes) the existing Sling Work entrypoint on the rig detail page
Bead 3 — UI: Held bead treatment + mayor response surface
- Visual distinction for open/unassigned user-created beads ("Waiting" state)
- "Start now" quick action in bead detail drawer
- Mayor response rendered as conversation thread in bead drawer (child
message beads with parent_bead_id)
Bead 4 — Mayor system prompt update
- Handle new bead notification gracefully: acknowledge, offer planning options (flesh out body, create staged convoy, start immediately)
- Mayor replies via
message bead with parent_bead_id so it surfaces in the drawer
- Keep responses concise (3-5 sentences)
Design Decisions
- Workers AI model:
@cf/meta/llama-3.1-8b-instruct (fast, cheap, good enough for title/label suggestions)
- AI enrichment is purely suggestive — never auto-applies without user interaction
- No new bead status needed — held beads are just
open with no assignee
- Mayor response surface: message bead with
parent_bead_id rendered in the bead drawer
Summary
Users currently create beads exclusively by talking to the mayor, who calls
gt_slingorgt_sling_batchon their behalf. There is no direct UI surface for a user to create a bead themselves — and the old "Sling Work" button (which opened a simple title/body dialog) is likely broken or vestigial at this point.This feature gives users a first-class UI surface for creating beads directly, while keeping the mayor in the loop to help plan and enrich the work.
Proposed Experience
openwithout dispatching a polecat. When checked, the bead is dispatched immediatelymessagebead withparent_bead_id)Implementation Plan
Bead 1 — Backend:
createBeadtRPC + Workers AI enrichment endpointcreateBeadtRPC procedure that creates anopenbead without dispatchingenrichBeadtRPC procedure backed by Workers AI (AIbinding already configured) — accepts markdown body, returns suggested{ title, labels }notifyMayorOfNewBead(beadId, rigId, title, body)on the Town DO — callssendMayorMessage()with bead contextBead 2 — UI:
CreateBeadDrawerwith MDXEditorCreateBeadDrawer.tsx— right-side panel (620px, matches existing drawer pattern)MarkdownEditor.tsx— thin MDXEditor wrapper (https://mdxeditor.dev/editor/docs/getting-started), dynamically imported for SSRBead 3 — UI: Held bead treatment + mayor response surface
messagebeads withparent_bead_id)Bead 4 — Mayor system prompt update
messagebead withparent_bead_idso it surfaces in the drawerDesign Decisions
@cf/meta/llama-3.1-8b-instruct(fast, cheap, good enough for title/label suggestions)openwith no assigneeparent_bead_idrendered in the bead drawer