Git worktree setup and management for parallel agent development. Use when working in isolated git worktrees to avoid merge conflicts between Developer and Tech Artist agents.
"Parallel development without conflicts โ each agent works in their own worktree."
Before starting work:
git worktree list shows your worktree)pwd shows ../{agent}-worktree)git branch shows {agent}-worktree)git merge origin/main completed)git status is clean)git log shows recent main commits)| Action | Command |
|---|---|
| List worktrees | git worktree list |
| Create worktree | git worktree add ../{agent}-worktree -b {agent}-worktree |
| Remove worktree | git worktree remove ../{agent}-worktree |
| Navigate to worktree | cd ../{agent}-worktree |
| Merge main | git fetch origin main && git merge origin/main |
| Push worktree | git push origin {agent}-worktree |
| Check current branch | git branch --show-current |
MUST follow this pattern: {agent}-worktree
| Agent | Worktree Name | Worktree Path | Branch Name |
|---|---|---|---|
| Developer | developer-worktree |
../developer-worktree |
developer-worktree |
| Tech Artist | techartist-worktree |
../techartist-worktree |
techartist-worktree |
# Check if worktree already exists
git worktree list
# If NOT in list, create worktree with dedicated branch
git worktree add ../{agent}-worktree -b {agent}-worktree
# Verify creation
git worktree list
โ ๏ธ CRITICAL: You MUST navigate to your worktree BEFORE doing any development work!
Why navigate to worktree first?
Why merge main first?
Remember to always run the tests in the target worktree branches for validation
Developer in worktree: โโโ Reads PRD from master (Get-MasterPrdPath) โโโ Reads messages from CLI --message argument โโโ Updates PRD status in master (atomic write) โโโ Writes response file for next agent โโโ Writes code in worktree โโโ Commits code to worktree branch โโโ Sends validation_request via response file
PM in master: โโโ Reads PRD (sees worker status updates) โโโ Reads messages (sees worker messages) โโโ Coordinates everything
QA in master: โโโ Navigates to worktree for testing โโโ If validation passes: merges to master โโโ If validation fails: sends bug_report via master queue