/verify-worktree

Merge staging into the worktree branch, resolve conflicts, and verify tests pass

03 Review Input: run from inside a worktree Output: branch up-to-date with staging, all tests passing
Step
Human
Claude Code Agent
External Systems
Check
Validates environment: not on staging, no uncommitted changes
Records branch name and working directory. Stops if on staging or dirty.
git status, git branch --show-current
Branch and status checked
Git
Merge
Fetches latest remote state and merges staging
git fetch origin && git merge staging
Merge attempted
Git
If conflicts: reads conflicted sections, resolves straightforward ones
Explains each resolution. Stages resolved files.
If logical conflicts: chooses which resolution to prefer
When both sides changed the same function differently
Conditional Gate
Test
Runs build and full test suite
Detects language/build system. Uses CLAUDE.md validation commands if specified. Stops if build or tests fail.
go build ./... && go test ./... -v (or language equivalent)
Test results
Git
Report
Reports: merge result, test results, verdict
"Branch verified and ready for /cleanup-worktree" or "Issues found"
Human
Agent
External
Decision gate