# Manage Git Worktrees Safely

Parallel development can create branch, port, and cleanup confusion. This skill guides Git worktree creation, listing, removal, and troubleshooting with isolated local settings.

## Install

```bash
npx skillstore add egadams/worktree-manager-skill
```

## Metadata

- Status: approved
- Slug: egadams-worktree-manager-skill
- Skillstore revision: r1
- Version status: missing
- Tree hash: a0eae6b2e17961587035629e457d5b2fc03e6917ca2d9eba492bd215f2c6f518
- Author: EGAdams
- GitHub username: EGAdams
- License: MIT
- Repository: https://github.com/EGAdams/planner/tree/main/.claude/skills/worktree-manager-skill
- Ref: 30c73eac2afe762f6aa9c4553158769369d47351
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: network, external\_commands
- Quality score: 69
- Public page: https://skillstore.pages.dev/skills/egadams-worktree-manager-skill
- Manifest: https://skillstore.pages.dev/api/skills/egadams-worktree-manager-skill/manifest

## Capabilities

- Selects create, list, or remove workflows from user intent.
- Documents slash command syntax for worktree creation, listing, and removal.
- Explains port offset allocation for server and client services.
- Summarizes worktree status, service state, PIDs, and local access URLs.
- Provides troubleshooting steps for port conflicts, orphaned worktrees, dependencies, and database configuration.

## Use Cases

- Create Parallel Feature Environments: Set up a separate worktree with unique ports for a feature branch.
- Review Active Worktrees: List worktrees, service status, ports, and access URLs before changing local environments.
- Clean Up Completed Branch Worktrees: Remove old worktrees and stop their related services after work is merged.

## Prompt Templates

### List Current Worktrees

```
Show my current worktrees, their service status, ports, and local access URLs.
```

### Create Feature Worktree

```
Create a worktree for the feature-auth branch and tell me the dashboard and server URLs.
```

### Resolve Port Conflict

```
My worktree has a port conflict. Check existing worktrees and suggest the safest next action.
```

### Plan Multiple Environments

```
Create a plan for three branch worktrees with unique port offsets and cleanup steps after review.
```

## Limitations

- Relies on existing slash commands and does not implement them inside this skill.
- Requires a repository that supports the expected worktree commands.
- Removal workflows can affect local files and running processes.
- Environment file values still require careful secret handling.

## Best Practices

- Confirm the target branch before creating or removing a worktree.
- Use the list workflow before cleanup so ports, paths, and service state are visible.
- Keep environment files local and avoid sharing secret values in responses.

## Anti Patterns

- Do not run manual delete commands before validating the worktree path.
- Do not reuse port offsets when another worktree is active.
- Do not expose .env values when summarizing configuration.

## Security Audit

- Audited at: 2026-07-05T15:12:29.224\+00:00
- Summary: The static findings are mostly false positives from documentation examples, localhost URLs, slash command names, and .env references. I found no prompt injection attempt or evidence of credential exfiltration. One medium semantic risk remains because troubleshooting guidance includes manual force-kill and directory removal steps.

## Stats

- Views: 288
- Downloads: 10
- Favorites: 0
- Popularity score: 0
