Skill Index

maestro-flow/

maestro-fork

community[command]

Create or sync milestone worktree for parallel dev

$/plugin install maestro-flow

details

<purpose> Create a git worktree for an entire milestone, enabling inter-milestone parallel development. The worktree scope is milestone-level — all scratch artifacts for that milestone are owned by the worktree.

Since .workflow/ is gitignored, this command explicitly copies project context and existing milestone scratch artifacts into the worktree. Per-phase parallelism within a milestone is NOT supported.

Also supports --sync mode to pull latest main branch changes and shared artifacts into an active worktree (prevents source and artifact drift for long-lived worktrees).

Produces .workflow/worktrees.json registry in the main worktree and .workflow/worktree-scope.json marker in the worktree, and writes a scoped state.json inside the worktree containing only the forked milestone's artifacts. </purpose>

<required_reading> @~/.maestro/workflows/fork.md </required_reading>

<deferred_reading>

<context> $ARGUMENTS -- milestone number and optional flags.

Modes (Fork / Sync), flags (-m, --base, --sync), milestone resolution, worktree layout, and artifact scoping are defined in workflow fork.md. </context>

<execution> Follow '~/.maestro/workflows/fork.md' completely.

Fork and sync algorithm steps are defined in workflow fork.md.

Next-step routing on completion:

Fork mode:

  • Enter worktree → cd {wt.path} && /maestro-analyze
  • Automated → maestro delegate "run full lifecycle for milestone" --cd {wt.path} --mode write
  • Status → Skill({ skill: "manage-status" })

Sync mode:

  • Sync complete → resume work in worktree
  • Conflicts found → resolve manually, then retry </execution>

<error_codes>

CodeSeverityConditionRecovery
E001errorProject not initializedRun maestro-init first
E002errorNo roadmap foundRun maestro-roadmap first
E003errorRunning inside a worktreeRun from main worktree
E004errorNo milestone number providedProvide -m <N>
E005errorNo milestones defined in state.jsonRun maestro-roadmap first
E006errorMilestone number out of rangeCheck available milestones
E007errorNo active worktree for milestone (--sync)Check worktrees.json
E008errorMilestone already has active worktreeMerge or cleanup first
</error_codes>

<success_criteria> Fork mode:

  • Milestone resolved from state.json.milestones[]
  • Git worktree created with branch (milestone/{slug})
  • Shared .workflow/ files copied (project.md, roadmap.md, config.json, specs/)
  • Milestone scratch artifacts copied (filtered from artifact registry)
  • worktree-scope.json written with milestone scope
  • Scoped state.json written (only this milestone's artifacts)
  • worktrees.json registry updated in main worktree
  • Milestone marked as "forked" in main state.json.milestones[]
  • Summary displayed with next-step commands

Sync mode:

  • Git merge main into worktree branch
  • Shared artifacts re-copied (project.md, roadmap.md, config.json, specs/)
  • Conflicts reported if any </success_criteria>

technical

github
catlog22/maestro-flow
stars
340
license
unspecified
contributors
1
last commit
2026-05-25T02:58:12Z
file
.claude/commands/maestro-fork.md

related