feat: add worktree creation/lifecycle to coordinator spawn flow#526
Merged
bradygaster merged 1 commit intobradygaster:devfrom Mar 23, 2026
Merged
Conversation
…ygaster#525) Add createWorktree and removeWorktree commands to RalphCommands interface and all 3 platform adapters (GitHub, ADO, Planner). Update coordinator spawn template in squad.agent.md to pass WORKTREE_PATH for parallel issue work. Create the missing issue-lifecycle.md template with worktree-aware issue-to-branch-to-PR-to-merge lifecycle. Update git-workflow skill to make worktrees the default for parallel work. Closes bradygaster#525 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
chrislomonico
pushed a commit
to clomonico/squad
that referenced
this pull request
Mar 26, 2026
bradygaster#545) Adds opt-in OTel shell metrics (SQUAD_TELEMETRY=1): session_count, session_duration_ms, agent_response_latency_ms, error_count. Zero overhead when off. Closes bradygaster#508, Closes bradygaster#520, Closes bradygaster#526, Closes bradygaster#530, Closes bradygaster#531 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #525. Adds worktree creation and lifecycle management to the coordinator spawn flow. Previously, Squad could detect and read worktrees but never created them — all branch-creation paths hardcoded
git checkout -b, breaking parallel multi-agent execution.Changes
1.
ralph-commands.ts— New worktree commandsAdded
createWorktreeandremoveWorktreeto theRalphCommandsinterface and all 3 platform adapters (GitHub, ADO, Planner):createWorktree:git fetch origin {baseBranch} && git worktree add {worktreePath} -b {branchName} origin/{baseBranch}removeWorktree:git worktree remove {worktreePath} && git worktree prune2.
squad.agent.md— Worktree-aware spawn flowWORKTREE_PATHblock — tells agents they're in a dedicated worktree and must not rungit checkoutissue-lifecycle.md3.
issue-lifecycle.md— New template (was missing)Created the template that was referenced twice in
squad.agent.mdbut never existed. Contains:checkout -b)4.
git-workflow SKILL.md— Worktrees as default for parallel work./worktrees/squad-{issue-number}(was../{repo-name}-{issue-number})WORKTREE_PATHand no-checkout rule5. Tests
ralph-commands.test.ts: AddedcreateWorktreeandremoveWorktreetoCOMMAND_KEYS, plus 2 new cross-platform tests verifying all platforms support worktree commands with correct placeholdersplatform-adapter.test.ts: Added placeholder token assertions forcreateWorktreeandremoveWorktreeTest Results
All 134 tests passing (
ralph-commands.test.ts+platform-adapter.test.ts).