Overview
Thebd mol bond command is a polymorphic operation that combines formulas, protos (template issues), or molecules (instantiated workflows) into compound structures. Bonding supports sequential, parallel, and conditional execution patterns.
Usage
Arguments
<A>- First operand (formula name or issue ID)<B>- Second operand (formula name or issue ID)
Options
--type <type>- Bond type:sequential(default),parallel, orconditional--as <title>- Custom title for compound proto (proto+proto only)--var key=value- Variable substitution when spawning protos (can be specified multiple times)--ephemeral- Force spawn as vapor (ephemeral, excluded from Dolt sync)--pour- Force spawn as liquid (persistent, synced via Dolt)--ref <pattern>- Custom child reference with{{var}}substitution for dynamic IDs--dry-run- Preview what would be created without making changes--json- Output results in JSON format
Bond Types
Sequential (Default)
Second operand runs after first completes (any outcome):Parallel
Both operands run concurrently:Conditional
Second operand runs only if first fails:Operand Type Combinations
The bond command is polymorphic and handles different operand types:| A Type | B Type | Result |
|---|---|---|
| formula | formula | Cook both, create compound proto |
| formula | proto | Cook formula, create compound proto |
| formula | mol | Cook formula, spawn and attach to molecule |
| proto | proto | Create compound proto (reusable template) |
| proto | mol | Spawn proto, attach to molecule |
| mol | proto | Spawn proto, attach to molecule |
| mol | mol | Join into compound molecule |
Phase Control
By default, spawned protos inherit the target’s phase:- Attaching to persistent molecule → spawns as persistent
- Attaching to ephemeral wisp → spawns as ephemeral
Override Phase
Dynamic Bonding (Christmas Ornament Pattern)
Use--ref for predictable child IDs instead of random hashes:
- Readable IDs for debugging
- Per-worker work tracking
- Easy reference to specific spawned instances
Examples
Create Reusable Compound Proto
Bond two protos for reuse across projects:Add Steps to Running Molecule
Attach additional work to an in-progress molecule:Parallel Test Execution
Run multiple test suites concurrently:Conditional Rollback
Add automatic rollback on deployment failure:Dynamic Per-Worker Arms
Spawn custom work per agent with readable IDs:Persist Important Findings
Convert ephemeral discovery to persistent issue:Dry Run
Preview bonding without making changes:JSON Output
Use Cases
Progressive Enhancement
Start with minimal molecule, add capabilities as needed:Pipeline Composition
Build complex pipelines from simple formulas:Patrol Workflows
Dynamically attach findings to patrol runs:Error Handling
Common errors and solutions:Related Commands
- bd mol show - Display molecule structure
- bd mol current - Show progress in molecule workflow
- bd mol pour - Instantiate formula as persistent molecule
- bd mol wisp - Instantiate formula as ephemeral wisp