Sync
/flow-next:sync is the manual escape hatch for plan-sync.
/flow-next:work runs plan-sync automatically after every task when planSync.enabled is true. Use this skill when code changed outside the work loop — manual edits, an external PR, a worker that completed but did not trigger sync — and downstream task specs need to be re-checked against reality.
When to use it
Section titled “When to use it”- A spec’s later tasks reference paths or APIs that earlier tasks have since renamed.
- A teammate pushed changes that affect a task you have not started yet.
/flow-next:workran with plan-sync disabled and you want to catch up.- You want to preview drift before acting on it.
Inputs
Section titled “Inputs”/flow-next:sync <id> [--dry-run]<id> accepts either id scheme (see Spec & task ids):
- A spec ID (
fn-1-add-oauth, legacyfn-1, or a tracker key likewor-17). Syncs all tasks under the spec. - A task ID (
fn-1-add-oauth.2, legacyfn-1.2, orwor-17.2). Syncs that task and its downstream peers.
--dry-run shows what would change without writing.
What it does
Section titled “What it does”For each downstream task, sync compares the task spec against the current state of the codebase and the committed work of upstream tasks. When it finds drift — stale paths, renamed exports, signatures that no longer match — it surfaces the reason and proposes an update.
Plan-sync never silently rewrites a spec. The user always sees the diff and approves it before any write.
Outcomes
Section titled “Outcomes”| Result | Meaning |
|---|---|
clean | No drift. Downstream tasks still match reality. |
drift | Proposed updates with reasons. User approves or rejects per file. |
regenerate | Spec is too far gone to patch cleanly; offer to regenerate the affected tasks. |
What this is not
Section titled “What this is not”- Not a code change. Sync edits task specs, not implementation files.
- Not a replacement for
/flow-next:planwhen the spec is fundamentally out of date. If most tasks need regeneration, restart planning.
Worked example
Section titled “Worked example”/flow-next:sync fn-14-rate-limits --dry-runComparing downstream task specs against current code... .2 OK .3 DRIFT: references src/export/serializer.ts - renamed to src/export/json.ts in task .1Dry run: 1 task would be updated. Re-run without --dry-run to apply.Plan-sync keeps later tasks honest about what earlier tasks actually did to the codebase.
Dynamic usage
Section titled “Dynamic usage”Recipes that compose with sync in the cookbook:
- Parallelize - after parallel workers land disjoint tasks, one sync pass re-grounds the remaining queue.
- Team patterns - run it after pulling a teammate’s changes that touch a spec you are mid-way through.
Next step
Section titled “Next step”/flow-next:work <next-ready-task>Or, if drift surfaced design-level issues, revisit the spec:
/flow-next:plan-review <spec-id>