Skip to content

Sync

/flow-next:sync is the manual escape hatch for plan-sync.

When planSync.enabled is true, /flow-next:work runs plan-sync automatically on multi-task specs as tasks complete. It is off by default. 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.

  • 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:work ran with plan-sync disabled and you want to catch up.
  • You want to preview drift before acting on it.
Terminal window
/flow-next:sync <id> [--dry-run]

<id> accepts either id scheme (see Spec & task ids):

  • A spec ID (fn-1-add-oauth, legacy fn-1, or a tracker key like wor-17). Syncs all tasks under the spec.
  • A task ID (fn-1-add-oauth.2, legacy fn-1.2, or wor-17.2). Syncs that task and its downstream peers.

--dry-run shows what would change without writing.

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 records the reason and updates the downstream task spec.

Run with --dry-run to preview: the plan-sync agent reports the drift and changes nothing. Without it, the agent updates the downstream task specs and sync reports what changed.

  • Not a code change. Sync edits task specs, not implementation files.
  • Not a replacement for /flow-next:plan when the spec is fundamentally out of date. If most tasks need regeneration, restart planning.
/flow-next:sync fn-14-rate-limits --dry-run
Comparing downstream task specs against current code...
.2 OK
.3 DRIFT: references src/export/serializer.ts - renamed to src/export/json.ts in task .1
Dry 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.

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.
Terminal window
/flow-next:work <next-ready-task>

Or, if drift surfaced design-level issues, revisit the spec:

Terminal window
/flow-next:plan-review <spec-id>