Flow Sync
Sync Beads task state to on-disk spec.md for a flow.
Phase 1: Resolve Flow
- If arguments provided, use as
flow_id. - Otherwise, read
.agent/flows.mdfor the active flow. - If no active flows, report "No active flows to sync."
Phase 2: Load Metadata
- Read
.agent/specs/{flow_id}/metadata.json - Extract
beads_epic_id - If missing, error: "Flow has no linked Beads epic."
Phase 3: Fetch Beads State
br show {beads_epic_id} --format json
Map Beads status to markdown markers:
| Beads Status | Marker |
|----------------|--------|
| open | [ ] |
| in_progress | [~] |
| closed | [x] |
| blocked | [!] |
| deferred | [-] |
Phase 4: Update spec.md
- Read
.agent/specs/{flow_id}/spec.md - Find the Implementation Plan / task list section
- Replace task status markers with current Beads status
- Append commit SHAs from Beads close reasons where available
- Write updated spec.md
Only update task markers. Do NOT modify requirements sections.
Phase 5: Update Metadata
Set "synced_at" and "updated_at" in metadata.json.
Final Output
Flow Sync Complete: {flow_id}
Synced from Beads epic: {beads_epic_id}
Pending: {n} In Progress: {n} Completed: {n} Blocked: {n}
Updated: .agent/specs/{flow_id}/spec.md
微信扫一扫