From flow
Exports Beads backend state to markdown spec files, reconciling the source of truth with disk. Accepts an optional flow_id argument.
How this command is triggered — by the user, by Claude, or both
Slash command
/flow:flow-sync flow_idThis command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# Flow Sync > Lifecycle skill: use `flow-sync-status` through the `flow` router. Syncing active backend state to disk for flow: **$ARGUMENTS** ## The Bridge Mandate **CRITICAL:** `/flow:sync` is the primary bridge between the **Beads Source of Truth** and the **Markdown View**. Default setup runs it after task completion, note addition, or status changes when `syncPolicy.flowSyncAfterMutation` is enabled. **What sync means here (and what it does NOT):** - `/flow:sync` **ALWAYS writes the reconciled markdown to disk** — updating **every markdown file in `.agents/specs/<flow_id>/`** (`s...
Lifecycle skill: use
flow-sync-statusthrough theflowrouter.
Syncing active backend state to disk for flow: $ARGUMENTS
CRITICAL: /flow:sync is the primary bridge between the Beads Source of Truth and the Markdown View. Default setup runs it after task completion, note addition, or status changes when syncPolicy.flowSyncAfterMutation is enabled.
What sync means here (and what it does NOT):
/flow:sync ALWAYS writes the reconciled markdown to disk — updating every markdown file in .agents/specs/<flow_id>/ (spec.md, learnings.md, and any other tracked markdown in the flow folder), not just spec.md, so they all match Beads exactly. This write is mandatory; sync is never read-only/dry-run and must never finish without persisting the markdown.bd dolt commands (bd dolt push/pull/export) as part of sync, regardless of phrasing. Those are out of scope for /flow:sync and only run if the user explicitly and separately asks for Dolt operations.PROTOCOL: Check hook context for environment metadata.
<hook_context> for ## Flow Environment Context.
.agents/ as the default root.<root_directory>/beads.json if present.
syncPolicy.flowSyncAfterMutation when deciding whether a sync should run automatically.syncPolicy.autoExport and syncPolicy.autoGitAdd before running any Beads export or staging command.syncPolicy.allowDoltPush and dolt.push before any Dolt push operation.$ARGUMENTS is provided, use it as flow_id.<root_directory>/flows.md for active flows.<root_directory>/specs/{flow_id}/metadata.json.<root_directory>/workflow.md and <root_directory>/tech-stack.md.beads_epic_id.Resolve the active backend first (check hook context or beads.json):
bd: use the official Beads show/export command. CRITICAL: Pull all notes for the epic and its tasks.If syncPolicy.autoExport is false, do not run Beads export commands as a side effect of /flow:sync; read from the backend and update Flow markdown views only. Do not run bd dolt push unless the user explicitly requests it or .agents/beads.json sets syncPolicy.allowDoltPush to true.
Parse the backend output. Map statuses to markdown markers:
| Backend Status | Marker |
|---|---|
open / pending | [ ] |
in_progress | [~] |
closed / completed | [x] |
blocked | [!] |
skipped / deferred | [-] |
Update spec.md:
## Implementation Plan section.- [ ] ..., - [x] ..., etc.:
[abc1234].spec.md.Update learnings.md:
notes/comments from the backend for the current flow..agents/specs/{flow_id}/learnings.md in Ralph-style format.package.json, pyproject.toml, etc.) with .agents/tech-stack.md.Makefile, justfile, etc..agents/workflow.md.Update .agents/specs/{flow_id}/metadata.json:
"synced_at": "{ISO timestamp}""updated_at": "{ISO timestamp}"Flow Sync Complete: {flow_id}
Backend: {bd|none}
Tasks synced from backend record: {beads_epic_id|none}
Pending: {count}
In Progress: {count}
Completed: {count}
Blocked: {count}
Skipped: {count}
Notes synced: {count} new notes added to learnings.md
Updated: .agents/specs/{flow_id}/spec.md
bd and markdown-only mode gracefully.bd dolt push unless .agents/beads.json explicitly allows it or the user asks for it.npx claudepluginhub cofin/flow --plugin flow