# Worktree Manager

> Git Worktree 隔離管理，建立獨立開發環境避免影響主分支。當提到 worktree、分支隔離、隔離開發環境時自動啟用。

- **Type:** Skill
- **Install:** `agentstack add skill-kopp0510-claude-dd-worktree-manager`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [kopp0510](https://agentstack.voostack.com/s/kopp0510)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [kopp0510](https://github.com/kopp0510)
- **Source:** https://github.com/kopp0510/claude-dd/tree/main/skills/worktree-manager

## Install

```sh
agentstack add skill-kopp0510-claude-dd-worktree-manager
```

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

## About

# Worktree Manager

> **原生優先（Claude Code ≥ 2.1.198）**：原生 `EnterWorktree` 工具、CLI `--worktree` 與
> subagent `isolation: worktree` 已涵蓋建立、會話遷移與自動清理 — **先用原生**。
> 本 skill 只處理原生不覆蓋的場景：自訂位置慣例、依賴安裝與基線測試、舊版 Claude Code。

## 建立流程

1. **前置檢查**：確認在 git repo 內、`git status --porcelain` 乾淨（有未提交變更先提示處理）、
   `git worktree list` 無同名衝突
2. **確認設定**（AskUserQuestion 一次問完）：分支名（建議 `feature/` 前綴）、
   位置（慣例：主 repo 平行目錄 `../-worktree-`）、是否裝依賴
3. **建立**：`git worktree add -b   `
4. **環境設定**：裝依賴（npm/pip 等，依專案）、複製 `.env.example` → `.env`（如存在）
5. **基線測試**：跑既有測試記錄基線 — 失敗時警告但不阻止建立（帶著已知紅燈開發，
   之後才分得清是誰弄壞的）
6. **記錄**：在 worktree 根寫 `WORKTREE_INFO.md`（分支、base、路徑、基線結果）

## 收尾

開發完成後：確認 worktree 內變更已全部 commit → 回主 repo `git worktree remove ` →
`git worktree prune`。merge 與分支刪除由使用者決定，本 skill 不代決。

## 限制備忘

- 一個分支只能有一個 worktree；已被 worktree 佔用的分支不能再 checkout
- 子模組專案需特殊處理，先確認再建
- worktree 共用主 repo 的 `.gitignore`；額外忽略規則用 `.git/info/exclude`

## Source & license

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

- **Author:** [kopp0510](https://github.com/kopp0510)
- **Source:** [kopp0510/claude-dd](https://github.com/kopp0510/claude-dd)
- **License:** MIT

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:** yes
- **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-kopp0510-claude-dd-worktree-manager
- Seller: https://agentstack.voostack.com/s/kopp0510
- 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%.
