帮助你使用 Git worktree 创建相互隔离的并行工作区。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "using-git-worktrees" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/FluidFramework/main/.agency/plugins/nori/skills/using-git-worktrees/SKILL.md 2. 保存为 ~/.claude/skills/using-git-worktrees/SKILL.md 3. 装好后重载技能,告诉我可以用了
我需要在不影响当前分支工作的情况下开发一个新功能,请指导我使用 git worktree 创建独立工作区,并给出完整命令。
提供创建新 worktree、切换分支和开始开发的步骤与命令。
当前我在做大改动,但现在要紧急修复线上 Bug。请用 git worktree 方案帮我快速开一个独立目录处理 hotfix,并说明完成后如何清理。
给出 hotfix worktree 的创建、提交、合并及移除目录的操作说明。
我想同时打开主分支和一个评审分支进行对比,请说明如何用 git worktree 管理两个独立工作目录,并避免分支冲突。
说明如何为多个分支建立独立目录,并提供安全使用建议。
ls -d .worktrees 2>/dev/null.worktrees.# Check if directory pattern in .gitignore
grep -q "^\.worktrees/$" .gitignore || grep -q "^worktrees/$" .gitignore
cd $path# Node.js
if [ -f package.json ]; then npm install; fi
# Rust
if [ -f Cargo.toml ]; then cargo build; fi
# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi
# Go
if [ -f go.mod ]; then go mod download; fi
# Examples - use project-appropriate command
npm test
cargo test
pytest
go test ./...
If tests fail: Report failures, ask whether to proceed or investigate.
If tests pass: Report ready.
New working directory: <full-path>
Tests passing (<N> tests, 0 failures)
All commands and tools will now refer to: <full-path>
CRITICAL: Once you create and enter a worktree, you must stay within it for the entire session.
Rules:
pwd # Should show .worktrees/branch-name in path
git branch # Should show * on your feature branch, not main
Red Flags:
| Situation | Action |
|---|---|
.worktrees/ exists | Use it (verify .gitignore) |
| `.worktree/s does not exist | Check CLAUDE.md → Ask user |
| Directory not in .gitignore | Add it immediately |
| Tests fail during baseline | Report failures + ask |
| No package.json/Cargo.toml | Skip dependency install |
Skipping .gitignore verification
Assuming directory location
Missing project installation
…
在代码改动完成后,快速整理并更新对应技术文档与说明内容。
为 Copilot 创建的 PR 自动触发 ADO CI 流水线运行与验证。
帮助你严谨评估代码评审意见,澄清疑点后再决定是否采纳与实现
通过先写失败测试再实现代码,帮助稳定完成功能开发与缺陷修复。
在编写或修改测试时识别反模式,避免错误 mock 与污染生产代码。
用四阶段系统化排查框架定位缺陷根因,再制定可靠修复方案。
帮助开发者安全创建独立的 Git worktree 并智能选择目录
为新功能开发创建隔离工作区,避免影响当前代码并便于并行实现。
自动创建和管理 Git worktree,并协助装依赖与发起 PR。
帮助开发者并行管理 Git 工作树,同时处理多个分支而无需频繁切换或暂存改动。
帮助你创建、切换并检查代码分支,确保实现前遵循正确分支策略。
帮助你通过 tmux 控制需实时交互的命令行会话,安全运行编辑器、REPL 和交互式 Git 操作。