bd help --doc mol.
Manage molecules - work templates for agent workflows.
Protos are template epics with the “template” label. They define a DAG of work
that can be spawned to create real issues (molecules).
The molecule metaphor:
- A proto is an uninstantiated template (reusable work pattern)
- Spawning creates a molecule (real issues) from the proto
- Variables ({{key}}) are substituted during spawning
- Bonding combines protos or molecules into compounds
- Distilling extracts a proto from an ad-hoc epic
bd mol bond
Bond two protos or molecules to create a compound. The bond command is polymorphic - it handles different operand types: formula + formula → cook both, compound proto formula + proto → cook formula, compound proto formula + mol → cook formula, spawn and attach proto + proto → compound proto (reusable template) proto + mol → spawn proto, attach to molecule mol + proto → spawn proto, attach to molecule mol + mol → join into compound molecule Formula names (e.g., mol-polecat-arm) are cooked inline as ephemeral protos. This avoids needing pre-cooked proto beads in the database. Bond types: sequential (default) - B runs after A completes parallel - B runs alongside A conditional - B runs only if A fails Phase control: By default, spawned protos follow the target’s phase:- Attaching to mol (Ephemeral=false) → spawns as persistent (Ephemeral=false)
- Attaching to ephemeral issue (Ephemeral=true) → spawns as ephemeral (Ephemeral=true)
Creates: bd-patrol.arm-ace (and children like bd-patrol.arm-ace.capture)
Use cases:- Found important bug during patrol? Use —pour to persist it
- Need ephemeral diagnostic on persistent feature? Use —ephemeral
- Spawning per-worker arms on a patrol? Use —ref for readable IDs
bd mol burn
Burn a molecule, deleting it without creating a digest. Unlike squash (which creates a permanent digest before deletion), burn completely removes the molecule with no trace. Use this for:- Abandoned patrol cycles
- Crashed or failed workflows
- Test/debug molecules you don’t want to preserve
- Wisp (ephemeral): Direct delete
- Mol (persistent): Cascade delete (syncs to remotes)
bd mol current
Show where you are in a molecule workflow. If molecule-id is given, show status for that molecule. If not given, infer from in_progress issues assigned to current agent. The output shows all steps with status indicators: [done] - Step is complete (closed) [current] - Step is in_progress (you are here) [ready] - Step is ready to start (unblocked) [blocked] - Step is blocked by dependencies [pending] - Step is waiting For large molecules (>100 steps), a summary is shown instead. Use —limit or —range to view specific steps: bd mol current <id> —limit 50 # Show first 50 steps bd mol current <id> —range 100-150 # Show steps 100-150bd mol distill
Distill a molecule by extracting a reusable formula from an existing epic. This is the reverse of pour: instead of formula → molecule, it’s molecule → formula. The distill command:- Loads the existing epic and all its children
- Converts the structure to a .formula.json file
- Replaces concrete values with {{variable}} placeholders (via —var flags)
- Team develops good workflow organically, wants to reuse it
- Capture tribal knowledge as executable templates
- Create starting point for similar future work
- <resolved-beads-dir>/formulas/ (project-level, default)
- <checkout-root>/.beads/formulas/ (repo-local formulas)
- ~/.beads/formulas/ (user-level, if project not writable)
bd mol last-activity
Show the most recent activity timestamp for a molecule. Returns the timestamp of the most recent change to any step in the molecule, making it easy to detect stale or stuck molecules. Activity sources: step_closed - A step was closed step_updated - A step was updated (claimed, edited, etc.) molecule_updated - The molecule root itself was updated Examples: bd mol last-activity hq-wisp-0laki bd mol last-activity hq-wisp-0laki —jsonbd mol pour
Pour a proto into a persistent mol - like pouring molten metal into a mold. This is the chemistry-inspired command for creating PERSISTENT work from templates. The resulting mol is stored as persistent beads in the issue database and syncs like any other bead (bd dolt push / pull). Phase transition: Proto (solid) -> pour -> Mol (liquid) WHEN TO USE POUR vs WISP: pour (liquid): Persistent work that needs audit trail- Feature implementations spanning multiple sessions
- Work you may need to reference later
- Anything worth preserving in git history
- Release workflows (one-time execution)
- Operational loops and recurring cycles
- Health checks and diagnostics
- Any operational workflow without audit value
bd mol progress
Show efficient progress summary for a molecule. This command uses indexed queries to count progress without loading all steps, making it suitable for very large molecules (millions of steps). If no molecule-id is given, shows progress for any molecule you’re working on. Output includes:- Progress: completed / total (percentage)
- Current step: the in-progress step (if any)
- Rate: steps/hour based on closure times
- ETA: estimated time to completion
bd mol ready
Find molecules where a gate has closed and the workflow is ready to resume. This command discovers molecules waiting at a gate step where:- The molecule has a gate bead that blocks a step
- The gate bead is now closed (condition satisfied)
- The blocked step is now ready to proceed
- No agent currently has this molecule hooked
bd mol seed
Verify that a formula is accessible and can be cooked. The seed command checks formula search paths to ensure a formula exists and can be loaded. This is useful for verifying system health before attempting to spawn work from a formula. Formula search paths (checked in order):- <resolved-beads-dir>/formulas/ (active project)
- <checkout-root>/.beads/formulas/ (repo-local formulas)
- ~/.beads/formulas/ (user level)
- $GT_ROOT/.beads/formulas/ (shared workspace root, if GT_ROOT set)
bd mol show
Show molecule structure and details. The —parallel flag highlights parallelizable steps:- Steps with no blocking dependencies can run in parallel
- Shows which steps are ready to start now
- Identifies parallel groups (steps that can run concurrently)
bd mol squash
Squash a molecule’s ephemeral children into a single digest issue. This command collects all ephemeral child issues of a molecule (Ephemeral=true), generates a summary digest, and promotes the wisps to persistent by clearing their Wisp flag (or optionally deletes them). The squash operation:- Loads the molecule and all its children
- Filters to only wisps (ephemeral issues with Ephemeral=true)
- Generates a digest (summary of work done)
- Creates a permanent digest issue (Ephemeral=false)
- Clears Wisp flag on children (promotes to persistent) OR keeps them with —keep-children (default: delete)
bd mol stale
Detect molecules (epics with children) that are complete but still open. A molecule is considered stale if:- All children are closed (Completed == Total)
- Root issue is still open
- Not assigned to anyone (optional, use —unassigned)
- Is blocking other work (optional, use —blocking)
bd mol wisp
Create or manage wisps - EPHEMERAL molecules for operational workflows. When called with a proto-id argument, creates a wisp from that proto. When called with a subcommand (list, gc), manages existing wisps. Wisps are issues with Ephemeral=true in the main database. They’re stored locally but NOT synced via git. WHEN TO USE WISP vs POUR: wisp (vapor): Ephemeral work that auto-cleans up- Release workflows (one-time execution)
- Operational loops and recurring cycles
- Health checks and diagnostics
- Any operational workflow without audit value
- Feature implementations spanning multiple sessions
- Work you may need to reference later
- Anything worth preserving in git history
- Create: bd mol wisp <proto> or bd create —ephemeral
- Execute: Normal bd operations work on wisp issues
- Squash: bd mol squash <id> (clears Ephemeral flag, promotes to persistent)
- Or burn: bd mol burn <id> (deletes without creating digest)
bd mol wisp create
Create a wisp from a proto - sublimation from solid to vapor. This is the chemistry-inspired command for creating ephemeral work from templates. The resulting wisp is stored in the main database with Ephemeral=true and NOT synced via git. Phase transition: Proto (solid) -> Wisp (vapor) Use wisp for:- Operational loops and recurring cycles
- Health checks and monitoring
- One-shot orchestration runs
- Routine operations with no audit value
- Be stored in main database with Ephemeral=true flag
- NOT be synced via git
- Either evaporate (burn) or condense to digest (squash)
bd mol wisp gc
Garbage collect old or abandoned wisps from the database. A wisp is considered abandoned if:- It hasn’t been updated in —age duration and is not closed
bd mol wisp list
List all wisps (ephemeral molecules) in the current context. Wisps are issues with Ephemeral=true in the main database. They are stored locally but not synced via git. The list shows:- ID: Issue ID of the wisp
- Title: Wisp title
- Status: Current status (open, in_progress, closed)
- Started: When the wisp was created
- Updated: Last modification time
- Old wisps haven’t been updated in 24+ hours
- Use ‘bd mol wisp gc’ to clean up old/abandoned wisps