Skip to content

Concurrency

Flow-Next supports parallel work because task state is repo-local and tasks declare dependencies.

  • Different specs on different branches
  • Independent tasks from the same spec
  • Worktrees for isolation
  • Soft claims to avoid duplicate work

/flow-next:work dispatches worker subagents with fresh context per task. Each worker re-anchors against the spec, task, and git state before editing.

If two tasks touch the same high-churn module, prefer serial execution or split the module boundary first.

Solo concurrency is mostly about not losing context:

Terminal window
/flow-next:work fn-1
/flow-next:impl-review fn-1
/flow-next:work fn-2

Keep one spec in active implementation unless the second spec is truly isolated. If you switch, re-anchor before editing: read the spec, ready tasks, branch diff, and current review receipts.

Teams can run multiple workers when the graph supports it:

flowchart LR
  Spec["Reviewed spec"] --> API["Worker 1: API"]
  Spec --> UI["Worker 2: UI"]
  Spec --> Docs["Worker 3: docs"]
  API --> Review["Impl review"]
  UI --> Review
  Docs --> Review

The tech lead should decide boundaries before launching parallel work. Product should not need to coordinate merge conflicts; product should review whether the implemented behavior matches the spec.

Use a worktree per independent task cluster when multiple agents need to edit simultaneously:

WorktreeScope
fn-12-apiServer contract, tests
fn-12-uiClient integration using agreed contract
fn-12-docsDocs and examples

Merge back through the same spec branch and run /flow-next:spec-completion-review after integration. The completion review is where cross-task drift is caught.

  • Two workers repeatedly touch the same files.
  • Review findings mention conflicting assumptions.
  • A task needs a product answer that is not in the spec.
  • Tests only pass in one worktree.
  • The PR body cannot explain acceptance coverage cleanly.

When these show up, serialize the risky part and improve the spec before restarting.