# Git Worktree Manager

> >

- **Type:** Skill
- **Install:** `agentstack add skill-droodotfoo-agent-skills-git-worktree-manager`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [DROOdotFOO](https://agentstack.voostack.com/s/droodotfoo)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [DROOdotFOO](https://github.com/DROOdotFOO)
- **Source:** https://github.com/DROOdotFOO/agent-skills/tree/main/skills/git-worktree-manager
- **Website:** https://droo.foo/

## Install

```sh
agentstack add skill-droodotfoo-agent-skills-git-worktree-manager
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# git-worktree-manager

Parallel development using git worktrees with deterministic port allocation.
Designed for multi-agent workflows where multiple branches run services
concurrently without port collisions.

## What You Get

- Worktree lifecycle management (create, list, cleanup)
- Deterministic port allocation with collision detection
- Docker Compose patterns for per-worktree services
- Decision matrix for when worktrees add value

## Workflow

1. **Decide** -- Check the decision matrix below. Worktrees add overhead;
   use them only when parallelism is required.
2. **Create** -- `git worktree add ../project-feature feature-branch`
3. **Allocate ports** -- Use deterministic formula from port-allocation.md
4. **Run sessions** -- Each worktree gets isolated services on unique ports
5. **Cleanup** -- `git worktree remove ../project-feature` and release ports

## Decision matrix

| Situation                                  | Use worktree? | Why                                      |
| ------------------------------------------ | ------------- | ---------------------------------------- |
| Quick fix while feature branch is running  | Yes           | Keep feature services up, fix on main    |
| Multiple agents working different features | Yes           | Each agent gets isolated environment     |
| Long-running test suite on one branch      | Yes           | Continue development without waiting     |
| Simple feature branch, no running services | No            | git checkout is simpler                  |
| Reviewing a PR locally                     | Maybe         | Only if your current branch has state    |
| Shared database migrations in flight       | No            | Worktrees share .git; migrations collide |

## Rules

1. Never create worktrees inside the main working tree
2. Use sibling directories: `../project-feature`, not `./worktrees/feature`
3. Always allocate ports before starting services
4. Clean up worktrees when the branch is merged
5. Commit or stash before removing a worktree

## Reading guide

| Working on                                       | Read                                              |
| ------------------------------------------------ | ------------------------------------------------- |
| Port formula, collision checks, Docker Compose   | [port-allocation](port-allocation.md)             |

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [DROOdotFOO](https://github.com/DROOdotFOO)
- **Source:** [DROOdotFOO/agent-skills](https://github.com/DROOdotFOO/agent-skills)
- **License:** MIT
- **Homepage:** https://droo.foo/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-droodotfoo-agent-skills-git-worktree-manager
- Seller: https://agentstack.voostack.com/s/droodotfoo
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
