Maestro fork

From catlog22/maestro-flow · View interactive version

Maestro fork is an AI agent skill from the GitHub repository catlog22/maestro-flow. Create or sync session worktree for parallel dev

How to use this skill

Skill file

<required_reading>

@~/.maestro/workflows/run-mode.md

@~/.maestro/workflows/codex-run-mode.md

</required_reading>

<purpose>

Create or sync a session-level git worktree for parallel development.

Supports --sync mode to pull latest main changes into an active worktree.

</purpose>

<deferred_reading>

</deferred_reading>

<context>

$ARGUMENTS -- session ID (or slug) and optional flags.

Terminology: this command uses 'session' throughout. The underlying workflow file (fork.md) may use 'milestone' as a legacy alias for 'session'. Treat them as equivalent: --session maps to workflow's -m, state.json.sessions[] maps to state.json.milestones[].

--base <ref>: git ref (branch, tag, or commit hash) to fork from. Default: HEAD.

Modes (Fork / Sync), flags (--session, --base, --sync), session 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.

Gates (MANDATORY, BLOCKING)

Fork mode:

GATE 1: Validation → Worktree Creation

GATE 2: Worktree Creation → Artifact Copy

GATE 3: Artifact Copy → Completion

Sync mode:

GATE: Sync → Completion

</execution>

<completion>

Next-step routing

| Condition | Suggestion |

|-----------|-----------|

| Fork complete | cd {wt.path}, then route step analyze through /maestro-next or the canonical receipt-chained session open -> session chain insert --command analyze --arg "<goal>" -> run next flow |

| Fork + automated | maestro delegate "run full lifecycle for session" --cd {wt.path} --mode write |

| Sync complete | Resume work in worktree |

| Sync conflicts found | Resolve manually, then retry |

</completion>

<error_codes>

| Code | Severity | Condition | Recovery |

|------|----------|-----------|----------|

| E001 | error | Project not initialized | Run maestro-init first |

| E002 | error | No roadmap found | Route step roadmap through /maestro-next or the canonical receipt-chained self-start flow |

| E003 | error | Running inside a worktree | Run from main worktree |

| E004 | error | No session ID provided | Provide --session <session_id> |

| E005 | error | No sessions defined in state.json | Route step roadmap through /maestro-next or the canonical receipt-chained self-start flow |

| E006 | error | Session not found in state.json.sessions[] | Check available sessions |

| E007 | error | No active worktree for session (--sync) | Check worktrees.json |

| E008 | error | Session already has active worktree | Merge or cleanup first |

</error_codes>

<success_criteria>

Fork mode:

Sync mode:

</success_criteria>

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.