feat: add worktree isolation to /implement, /validate, and /release#566
Open
frosty-geek wants to merge 2 commits into
Open
feat: add worktree isolation to /implement, /validate, and /release#566frosty-geek wants to merge 2 commits into
frosty-geek wants to merge 2 commits into
Conversation
/implement now creates a dedicated git worktree at .claude/worktrees/<epic-slug> before dispatching the taskplanner. This keeps the main repo clean and enables parallel feature implementation across multiple sessions. /validate now enters the matching worktree before running tests, so it validates the feature branch code even when invoked from a fresh session at the repo root. The worktree persists until /release completes the squash-merge.
Without this, /release invoked from a fresh session at the repo root
runs Phase 1 and Phase 3 Step 1 (retro context walker) from the main
repo, not the worktree. The retro is dispatched as a general-purpose
subagent that inherits the parent's cwd; with no Phase 0 entry, it
reads main's .beastmode/artifacts/* and writes to main's
.beastmode/context/* — the worktree's edits never make it through the
squash-merge.
Mirrors the Phase 0 "Enter Worktree" step that /validate already has,
with the same BLOCKED guard if no worktree exists.
Also moves the TRANSITION BOUNDARY callout from above Step 2 to above
Step 3. Step 2 ("Commit to Feature Branch") still operates from the
worktree — the actual transition to the main repo happens in Step 3
("Squash Merge to Main") via explicit cd.
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
/implementnow creates a dedicated git worktree at.claude/worktrees/<epic-slug>before dispatching the taskplanner, enabling parallel feature implementation/validatenow enters the matching worktree before running tests, so it validates the correct code even when invoked from a fresh session/releasenow enters the matching worktree before generating release notes and dispatching the retro context walker, so the retro reads/writes the feature branch's state and its edits land in the squash-mergeTRANSITION BOUNDARYcallout in/releasePhase 3 from above Step 2 to above Step 3 — Step 2 (Commit to Feature Branch) still runs in the worktree; the actual transition to the main repo is at Step 3 (Squash Merge to Main)Closes #564
Changes
plugin/skills/implement/SKILL.mdplugin/skills/validate/SKILL.mdgit worktree list, enters matching worktree, or blocks if none existsplugin/skills/release/SKILL.md/validate's pattern/releaseinvoked from a fresh session at the repo root runs Phase 1 and Phase 3 Step 1 (retro context walker) from the main repo, not the worktree. The retro is dispatched as ageneral-purposesubagent that inherits the parent's cwd; with no Phase 0 entry, it readsmain's.beastmode/artifacts/*and writes tomain's.beastmode/context/*— the worktree's edits never make it through the squash-mergeTRANSITION BOUNDARYcallout from above Phase 3 Step 2 to above Step 3 (Step 2 is the feature-branch checkpoint commit, which still runs in the worktree; only Step 3+ navigates to the main repo via explicitcd)Context
Without these changes, running
/implementon two features simultaneously corrupts the working tree, running/validatein a new session testsmaininstead of the feature branch, and the/releaseretro context walker silently writes to whichever directory the session happens to be in (oftenmain, where the edits get clobbered by the subsequent squash-merge from the worktree). All three were discovered while running parallel beastmode sessions on a real project.Test plan
/implementon a feature — verify worktree is created at.claude/worktrees/<epic-slug>/implementon a second feature in parallel — verify each gets its own worktree/validatein a fresh session — verify it finds and enters the worktree/validatewith no worktree — verify it blocks with a clear message/releasein a fresh session — verify it enters the worktree before the retro fires/releasewith no worktree — verify it blocks with a clear message.beastmode/context/*.md) are present onmain