From workflow-skills
Use when starting 2+ independent features simultaneously, running multiple Claude Code sessions in parallel, or dispatching subagents to separate worktrees for concurrent development
npx claudepluginhub arosenkranz/claude-code-config --plugin workflow-skillsThis skill uses the workspace's default tool permissions.
One branch. One worktree. One agent. This is the core constraint that makes parallel development work without file conflicts, port collisions, or context pollution between features.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Designs, implements, and audits WCAG 2.2 AA accessible UIs for Web (ARIA/HTML5), iOS (SwiftUI traits), and Android (Compose semantics). Audits code for compliance gaps.
One branch. One worktree. One agent. This is the core constraint that makes parallel development work without file conflicts, port collisions, or context pollution between features.
Core principle: Spin up isolated workspaces first, coordinate after.
Before creating anything, define what you're parallelizing:
| Feature | Branch | Worktree Path | Mode | Port |
|---|---|---|---|---|
myapp-auth | feature/auth | .worktrees/auth | multi-window | 3001 |
myapp-payments | feature/payments | .worktrees/payments | multi-window | 3002 |
Naming convention: {project}-{feature-slug} — e.g., myapp-auth, api-rate-limiting
digraph mode_decision {
"Features independent?" [shape=diamond];
"Need full Claude context per feature?" [shape=diamond];
"Short-lived tasks (<30 min)?" [shape=diamond];
"Use multi-window" [shape=box];
"Use subagent mode" [shape=box];
"Reconsider parallelization" [shape=box];
"Features independent?" -> "Need full Claude context per feature?" [label="yes"];
"Features independent?" -> "Reconsider parallelization" [label="no"];
"Need full Claude context per feature?" -> "Use multi-window" [label="yes"];
"Need full Claude context per feature?" -> "Short-lived tasks (<30 min)?" [label="no"];
"Short-lived tasks (<30 min)?" -> "Use subagent mode" [label="yes"];
"Short-lived tasks (<30 min)?" -> "Use multi-window" [label="no"];
}
| Multi-Window | Subagent Mode | |
|---|---|---|
| Isolation | Full — separate Claude processes | Shared parent context |
| Best for | Long-running features, deep context | Parallel tasks, batch work |
| Setup | cd <path> && claude per window | Task tool dispatch |
| Max concurrent | 4-5 (coordination cost rises beyond) | Bounded by Task concurrency |
REQUIRED SUB-SKILL: Use superpowers:using-git-worktrees for each feature. That skill handles: directory selection, .gitignore verification, dependency setup, and baseline test verification.
Multi-window mode — after each worktree is created, open a new terminal per feature:
cd .worktrees/auth && claude
cd .worktrees/payments && claude
Subagent mode — dispatch via Task tool:
Task("Implement auth feature in worktree at .worktrees/auth on branch feature/auth.
Goal: [specific acceptance criteria]
Constraints: Do not modify files outside src/auth/
Return: Summary of changes and test results")
Port offset rule: Stagger dev servers to avoid conflicts:
Run this to see worktree status at a glance:
git worktree list
Conflict risk check — detect if two worktrees touched the same file:
# Compare changes in two worktrees against main
git -C .worktrees/auth diff main --name-only > /tmp/auth-files.txt
git -C .worktrees/payments diff main --name-only > /tmp/payments-files.txt
comm -12 <(sort /tmp/auth-files.txt) <(sort /tmp/payments-files.txt)
Sync cadence: At the start of each session, pull main into each active worktree:
git -C .worktrees/auth pull origin main
Worktrees that drift >1 week from main accumulate merge conflicts exponentially. Sync daily on active work.
REQUIRED SUB-SKILL: Use superpowers:finishing-a-development-branch per feature when ready.
Merge order matters when multiple features finish close together:
After each feature is merged/discarded:
# ALWAYS use this — never rm -rf a worktree directory
git worktree remove .worktrees/auth
# After all removals, prune stale metadata
git worktree prune
Safety check before removing:
git -C .worktrees/auth status # Must show clean working tree
git -C .worktrees/auth log origin/main..HEAD # Must show no unpushed commits
Manual
rm -rfon a worktree corrupts git's internal metadata.git worktree removeupdates.git/worktrees/correctly.
| Phase | Command |
|---|---|
| List worktrees | git worktree list |
| Add worktree | git worktree add .worktrees/auth -b feature/auth |
| Sync with main | git -C .worktrees/auth pull origin main |
| Conflict check | comm -12 <(sort auth-files.txt) <(sort payments-files.txt) |
| Safe remove | git worktree remove .worktrees/auth |
| Prune metadata | git worktree prune |
| Mistake | Fix |
|---|---|
| Same port for all dev servers | Offset: 3001, 3002, 3003 |
| Checking out same branch in two worktrees | Each worktree requires a unique branch |
rm -rf on worktree directory | Always use git worktree remove |
| Letting worktrees drift weeks from main | Pull main at session start |
| Merging without conflict check | Run file overlap check before second merge |
| >5 concurrent worktrees | Coordination cost exceeds parallelization benefit |
Delegates to:
superpowers:using-git-worktrees — Phase 2: single worktree creation with safety checkssuperpowers:finishing-a-development-branch — Phase 4: merge/PR/cleanup per featuresuperpowers:dispatching-parallel-agents — Subagent dispatch pattern for Phase 2Called by:
superpowers:brainstorming — when approved design splits into parallel implementation trackssuperpowers:dispatching-parallel-agents — when tasks require filesystem isolation