@cloudkinetix/bmad-enhanced
Version:
Cloud-Kinetix enhanced fork of BMAD-METHOD - Breakthrough Method of Agile AI-driven Development with robust versioning and unified validation.
125 lines (90 loc) ⢠2.71 kB
Markdown
# Task: Setup Worktrees
> ā
**Works with any IDE** - This task provides git worktree setup instructions
## Description
Creates git worktrees for each story in the parallel development plan, ensuring clean branch setup and proper tracking.
## Prerequisites
- Clean git status (no uncommitted changes)
- Parallel plan created
- Git 2.7+ installed
## Steps
1. **Verify Git Status**
```bash
# Ensure clean working directory
git status
# Stash any changes if needed
git stash push -m "Before parallel development setup"
```
2. **Create Phase 1 Worktrees**
```bash
# For each story in Phase 1
git worktree add ../ck-website-services feature/services-content
git worktree add ../ck-website-jobs feature/job-filtering
```
3. **Create Subsequent Phase Worktrees**
```bash
# Phase 2
git worktree add ../ck-website-cases feature/case-studies
# Phase 3
git worktree add ../ck-website-analytics feature/analytics-tracking
```
4. **Verify Worktree Creation**
```bash
# List all worktrees
git worktree list
# Should show:
# /path/to/ck-website [main]
# /path/to/ck-website-services [feature/services-content]
# /path/to/ck-website-jobs [feature/job-filtering]
# etc.
```
5. **Initialize Each Worktree**
For each worktree:
```bash
cd ../ck-website-services
# Ensure dependencies are installed
npm install
# Create initial commit
git commit --allow-empty -m "chore: initialize feature/services-content branch"
# Push branch to remote
git push -u origin feature/services-content
```
6. **Create Worktree Status Script**
```bash
cat > "$COORD_DIR/check-worktrees.sh" << 'EOF'
#!/bin/bash
echo "=== Worktree Status ==="
for wt in $(git worktree list --porcelain | grep "worktree" | cut -d' ' -f2); do
echo -e "\nš $(basename $wt):"
cd "$wt" 2>/dev/null && git status -sb
done
EOF
chmod +x "$COORD_DIR/check-worktrees.sh"
```
## Error Handling
### Worktree Already Exists
```bash
# Remove existing worktree
git worktree remove ../ck-website-services
# Or force remove
git worktree remove --force ../ck-website-services
```
### Branch Already Exists
```bash
# Delete local branch
git branch -d feature/services-content
# Or force delete
git branch -D feature/services-content
```
### Directory Already Exists
```bash
# Remove directory (ensure it's not important!)
rm -rf ../ck-website-services
```
## Output
- Created worktrees for all stories
- Feature branches created and tracked
- Status checking script available
## Next Steps
- Launch dev agents in each worktree
- Begin parallel development
- Monitor progress