Set up worktree for branch: $1
Steps:
1. Create worktree: git worktree add worktrees/$1 -b $1
2. Navigate: cd worktrees/$1
3. Sync dependencies: uv sync
4. Start server: uv run uvicorn app.main:app --host 0.0.0.0 --port 8124 &
5. Wait 3 seconds: sleep 3
6. Test health: curl -f http://localhost:8124/health
7. Kill server (find PID and kill it)
Report:
- Worktree path
- Branch name
- Health check result (PASS/FAIL)
- Any errors encountered
Spawn Agent 2 using Task tool (simultaneously with Agent 1)
Prompt for Agent 2:
Set up worktree for branch: $2
Steps:
1. Create worktree: git worktree add worktrees/$2 -b $2
2. Navigate: cd worktrees/$2
3. Sync dependencies: uv sync
4. Start server: uv run uvicorn app.main:app --host 0.0.0.0 --port 8125 &
(Note: Use port 8125 to avoid conflict with Agent 1)
5. Wait 3 seconds: sleep 3
6. Test health: curl -f http://localhost:8125/health
7. Kill server (find PID and kill it)
Report:
- Worktree path
- Branch name
- Health check result (PASS/FAIL)
- Any errors encountered
Wait for both agents to complete
Combine and report results from both agents
Report
Single Worktree Output:
✓ Worktree initialized
Path: worktrees/feature-search
Branch: feature/search
✓ Dependencies synced (uv sync)
✓ Health check passed (http://localhost:8124/health)
✓ Server stopped
Ready for development!
Parallel Worktrees Output:
✓ 2 worktrees initialized in parallel
Agent 1 (feature/search):
Path: worktrees/feature-search
Branch: feature/search
✓ Dependencies synced
✓ Health check passed (port 8124)
✓ Server stopped
Agent 2 (feature/export):
Path: worktrees/feature-export
Branch: feature/export
✓ Dependencies synced
✓ Health check passed (port 8125)
✓ Server stopped
Both worktrees ready for parallel development!
Notes
Exact ports and the server entry point may differ per project — check pyproject.toml and the
project README for project-specific values.
1---2name: new-worktrees3description: New Worktree4---56# New Worktree78Quick worktree setup with health check verification. Supports parallel creation with 2 agents.910## Parameters1112- Branch 1: $1 (e.g., "feature/search")13- Branch 2 (optional): $2 (e.g., "feature/export")1415## Logic1617**If only $1 provided:**1819- Create single worktree sequentially2021**If both $1 and $2 provided:**2223- Spawn 2 agents in parallel using Task tool24- Each agent sets up their own worktree independently25- Combine results from both agents26- Ensure you start the server on a different port to avoid conflicts: worktree 1 dedicated port 8124, worktree 2 dedicated port 81252728## Steps2930### Single Worktree (when only $1 provided)31321. **Create worktree**3334 ```bash35 git worktree add worktrees/$1 -b $136 ```37382. **Navigate to worktree**3940 ```bash41 cd worktrees/$142 ```43443. **Sync dependencies**4546 ```bash47 uv sync48 ```49504. **Start server in background**5152 ```bash53 uv run uvicorn app.main:app --host 0.0.0.0 --port 8124 &54 SERVER_PID=$!55 ```56575. **Wait for server to be ready**5859 ```bash60 sleep 361 ```62636. **Test health endpoint — make sure you use the correct port**6465 ```bash66 curl -f http://localhost:8124/health || echo "Health check failed"67 ```68697. **Kill server**7071 ```bash72 kill $SERVER_PID73 ```74758. **Report ready**7677### Parallel Worktrees (when both $1 and $2 provided)78791. **Spawn Agent 1 using Task tool**8081 Prompt for Agent 1:8283 ```84 Set up worktree for branch: $18586 Steps:87 1. Create worktree: git worktree add worktrees/$1 -b $188 2. Navigate: cd worktrees/$189 3. Sync dependencies: uv sync90 4. Start server: uv run uvicorn app.main:app --host 0.0.0.0 --port 8124 &91 5. Wait 3 seconds: sleep 392 6. Test health: curl -f http://localhost:8124/health93 7. Kill server (find PID and kill it)9495 Report:96 - Worktree path97 - Branch name98 - Health check result (PASS/FAIL)99 - Any errors encountered100 ```1011022. **Spawn Agent 2 using Task tool (simultaneously with Agent 1)**103104 Prompt for Agent 2:105106 ```107 Set up worktree for branch: $2108109 Steps:110 1. Create worktree: git worktree add worktrees/$2 -b $2111 2. Navigate: cd worktrees/$2112 3. Sync dependencies: uv sync113 4. Start server: uv run uvicorn app.main:app --host 0.0.0.0 --port 8125 &114 (Note: Use port 8125 to avoid conflict with Agent 1)115 5. Wait 3 seconds: sleep 3116 6. Test health: curl -f http://localhost:8125/health117 7. Kill server (find PID and kill it)118119 Report:120 - Worktree path121 - Branch name122 - Health check result (PASS/FAIL)123 - Any errors encountered124 ```1251263. **Wait for both agents to complete**1271284. **Combine and report results from both agents**129130## Report131132### Single Worktree Output:133134```135✓ Worktree initialized136 Path: worktrees/feature-search137 Branch: feature/search138139✓ Dependencies synced (uv sync)140✓ Health check passed (http://localhost:8124/health)141✓ Server stopped142143Ready for development!144```145146### Parallel Worktrees Output:147148```149✓ 2 worktrees initialized in parallel150151Agent 1 (feature/search):152 Path: worktrees/feature-search153 Branch: feature/search154 ✓ Dependencies synced155 ✓ Health check passed (port 8124)156 ✓ Server stopped157158Agent 2 (feature/export):159 Path: worktrees/feature-export160 Branch: feature/export161 ✓ Dependencies synced162 ✓ Health check passed (port 8125)163 ✓ Server stopped164165Both worktrees ready for parallel development!166```167168## Notes169170- Exact ports and the server entry point may differ per project — check `pyproject.toml` and the171 project README for project-specific values.
Run npx skillmds@latest add coleam00/new-worktrees in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
New Worktree It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
coleam00 (@coleam00) published this skill. Their other Agent Skills are listed on their SkillMD profile.