# Spin Worktree

> Create an isolated Git worktree for issue, pull-request, branch, or parallel agent work without editing the control checkout. Use when starting task work from fresh remote state, avoiding a dirty or shared checkout, or preparing a dedicated worktree for another agent.

- **Type:** Skill
- **Install:** `agentstack add skill-connorgriffin-skills-spin-worktree`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ConnorGriffin](https://agentstack.voostack.com/s/connorgriffin)
- **Installs:** 0
- **Category:** [Web & Browser](https://agentstack.voostack.com/c/web-and-browser)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [ConnorGriffin](https://github.com/ConnorGriffin)
- **Source:** https://github.com/ConnorGriffin/skills/tree/main/skills/spin-worktree

## Install

```sh
agentstack add skill-connorgriffin-skills-spin-worktree
```

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

## About

# Spin an isolated worktree

Keep the ordinary checkout as the control checkout and create one worktree per
task. The bundled helper refuses to update a dirty control checkout.

By default worktrees live under `${AGENT_WORKTREE_ROOT:-~/worktrees}`:

```text
~/worktrees//
```

## Workflow

1. Resolve the control repository and pass it explicitly with `--repo`.
2. Resolve this installed skill's directory.
3. Run one of the commands below.
4. Report the exact path and use it as the working directory.
5. Do not remove the worktree automatically. Cleanup belongs to task closeout
   after merge.

New issue branch:

```sh
python3 /scripts/spin-worktree.py \
  --repo /path/to/repository \
  --issue 317 \
  --slug rescue-context
```

Existing pull-request branch, discovered with GitHub CLI:

```sh
python3 /scripts/spin-worktree.py \
  --repo /path/to/repository \
  --pr 321
```

Existing branch:

```sh
python3 /scripts/spin-worktree.py \
  --repo /path/to/repository \
  --branch codex/issue-316 \
  --name pr321
```

Use `--dry-run` to inspect commands. Override defaults with
`--worktree-root`, `--remote`, `--base`, or `--branch-prefix`.

## Guardrails

- Use one worktree path and branch per task.
- Never switch branches in another agent's active worktree.
- Do not reuse an existing target path unless inspection proves it belongs to
  the same task.
- New issue work updates the remote and starts from its current default branch
  unless `--base` is supplied.
- Existing local branches do not require a remote.
- Pull-request discovery requires authenticated `gh`. A same-repository head
  is fetched when needed. A fork head fails with the exact fork and branch to
  configure, rather than pretending it exists under `origin`.
- `--name` accepts one relative directory leaf, never a path.

## Source & license

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

- **Author:** [ConnorGriffin](https://github.com/ConnorGriffin)
- **Source:** [ConnorGriffin/skills](https://github.com/ConnorGriffin/skills)
- **License:** Apache-2.0

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-connorgriffin-skills-spin-worktree
- Seller: https://agentstack.voostack.com/s/connorgriffin
- 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%.
