跳到主要内容
知仓学习社ZHICANG

worktree-isolation

Git worktree management for safe, isolated feature development. Creates, manages, and cleans up worktrees with branch naming and dependency setup.

执行命令严重 1 · 高危 0a5c-ai/babysitter

它会碰到什么

扫了多少2 个文本文件,3 KB
它会碰到什么执行命令
命中总数1 处
命中统计严重 1 · 高 0 · 中 0 · 低 0
逐条看命中(1 条严重或高危)
  • 严重 SKILL.md:3perm-wildcard
    allowed-tools: Bash(*) Read Write Edit Glob Grep

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

Create worktree with feature branch

git worktree add .claude/worktrees/<slug> -b feature/<slug>

cd .claude/worktrees/<slug>

npm install # or equivalent package manager


### 2. Worktree Detection
- Check if currently inside a worktree
- Identify the base branch
- Detect worktree state (clean, dirty, conflicts)

### 3. Worktree Sync
- Pull latest changes from base branch into worktree
- Rebase feature branch on updated base
- Resolve conflicts if needed

### 4. Worktree Diff
- Generate diff between worktree and base branch
- Summarize changes by file and type
- Calculate diff statistics

### 5. Worktree Cleanup
- Remove worktree after successful merge
- Delete feature branch
- Prune stale worktree references

### 6. Worktree Status
- List all active worktrees
- Show branch and status for each
- Identify orphaned worktrees

## Branch Naming Convention

| Mode | Pattern | Example |
|------|---------|---------|
| Feature | `feature/<slug>` | `feature/add-user-auth` |
| Bugfix | `bugfix/<slug>` | `bugfix/fix-payment-race` |
| Quick | `quick/<number>` | `quick/042` |

## Multiple Parallel Sessions

Worktrees enable multiple Pilot Shell sessions to work simultaneously without interference, as each operates in its own filesystem directory with its own branch.

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

同名技能的其他版本

有 2 个不同仓库或目录里都有叫 worktree-isolation 的技能。它们内容并不相同,别混用: