Token导航 LogoToken导航

Agent Skill · 开发

git:create-worktree(git 创建工作树)

git:create-worktree 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

git:create-worktree 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,暂无第三方扫描结果,按安装量在开发类的 21,746 个 Skill 里排第 3,660。

总安装 10,605周安装 429GitHub Stars 891下载 3,329核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:git:create-worktree(git 创建工作树)
来源仓库:https://github.com/neolabhq/context-engineering-kit
仓库路径:skills/git:create-worktree
安装命令:
npx skills add https://github.com/neolabhq/context-engineering-kit --skill git:create-worktree
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/neolabhq/context-engineering-kit --skill git:create-worktree

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

git:create-worktree 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。通过 npx skills add 命令从指定 GitHub 仓库安装使用。

安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/git:create-worktree

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/neolabhq/context-engineering-kit --skill git:c…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

git:create-worktree 怎么安装?

在终端执行 npx skills add https://github.com/neolabhq/context-engineering-kit --skill git:create-work…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

git:create-worktree 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

git:create-worktree 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

git:create-worktree 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

git:create-worktree 用的人多吗?

公开数据是累计安装 10,605 次,近一周安装 429 次,下载 3,329 次,GitHub 891 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

git:create-worktree 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
git:create-worktree

git 创建工作树 · 本页

10,605891需要联网未明确未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Claude Command: Create Worktree

Your job is to create and setup git worktrees for parallel development, with automatic detection and installation of project dependencies.

Instructions

CRITICAL: Perform the following steps exactly as described:

  1. Current state check: Run git worktree list to show existing worktrees and git status to verify the repository state is clean (no uncommitted changes that might cause issues)
  2. Fetch latest remote branches: Run git fetch --all to ensure local has knowledge of all remote branches
  3. Parse user input: Determine what the user wants to create:

- <name>: Create worktree with auto-detected type prefix - --list: Just show existing worktrees and exit - No input: Ask user interactively for the name

  1. Auto-detect branch type from name: Check if the first word is a known branch type. If yes, use it as the prefix and the rest as the name. If no, default to feature/. Known types: feature, feat, fix, bug, bugfix, hotfix, release, docs, test, refactor, chore, spike, experiment, review Examples: Name normalization: Convert spaces to dashes, lowercase, remove special characters except dashes/underscores

- refactor auth system → refactor/auth-system - fix login bug → fix/login-bug - auth system → feature/auth-system (default) - hotfix critical error → hotfix/critical-error

  1. For each worktree to create: a. Branch name construction: Build full branch name from detected type and normalized name: b. Branch resolution: Determine if the branch exists locally, remotely, or needs to be created: c. Path convention: Use sibling directory with pattern ../<project-name>-<name> d. Create the worktree: Execute the appropriate git worktree add command e. Dependency detection: Check the new worktree for dependency files and determine if setup is needed: f. Package manager detection (for Node.js projects): g. Automatic setup: Automatically run dependency installation:

- <prefix>/<normalized-name> (e.g., feature/auth-system) - If branch exists locally: git worktree add../<project>-<name> <branch> - If branch exists remotely (origin/): git worktree add --track -b <branch>../<project>-<name> origin/<branch> - If branch doesn't exist: Ask user for base branch (default: current branch or main/master), then git worktree add -b <branch>../<project>-<name> <base> - Extract project name from current directory - Use the normalized name (NOT the full branch with prefix) - Example: feature/auth-system → ../myproject-auth-system - package.json -> Node.js project (npm/yarn/pnpm/bun) - requirements.txt or pyproject.toml or setup.py -> Python project - Cargo.toml -> Rust project - go.mod -> Go project - Gemfile -> Ruby project - composer.json -> PHP project - bun.lockb -> Use bun install - pnpm-lock.yaml -> Use pnpm install - yarn.lock -> Use yarn install - package-lock.json or default -> Use npm install - cd to worktree and run the detected install command - Report progress: "Installing dependencies with [package manager]..." - If installation fails, report the error but continue with worktree creation summary

  1. Summary: Display summary of created worktrees:

- Worktree path - Branch name (full name with prefix) - Setup status (dependencies installed or failed) - Quick navigation command: cd <worktree-path>

Worktree Path Convention

Worktrees are created as sibling directories to maintain organization:

~/projects/
  myproject/                # Main worktree (current directory)
  myproject-add-auth/       # Feature branch worktree (feature/add-auth)
  myproject-critical-bug/   # Hotfix worktree (hotfix/critical-bug)
  myproject-pr-456/         # PR review worktree (review/pr-456)

Naming rules:

  • Pattern: <project-name>-<name> (uses the name part, NOT the full branch)
  • Branch name: <type-prefix>/<name> (e.g., feature/add-auth)
  • Directory name uses only the <name> portion for brevity

Examples

Feature worktree (default):

> /git:create-worktree auth system
# Branch: feature/auth-system
# Creates: ../myproject-auth-system

Fix worktree:

> /git:create-worktree fix login error
# Branch: fix/login-error
# Creates: ../myproject-login-error

Refactor worktree:

> /git:create-worktree refactor api layer
# Branch: refactor/api-layer
# Creates: ../myproject-api-layer

Hotfix worktree:

> /git:create-worktree hotfix critical bug
# Branch: hotfix/critical-bug
# Creates: ../myproject-critical-bug

List existing worktrees:

> /git:create-worktree --list
# Shows: git worktree list output

Setup Detection Examples

Node.js project with pnpm:

Detected Node.js project with pnpm-lock.yaml
Installing dependencies with pnpm...
✓ Dependencies installed successfully

Python project:

Detected Python project with requirements.txt
Installing dependencies with pip...
✓ Dependencies installed successfully

Rust project:

Detected Rust project with Cargo.toml
Building project with cargo...
✓ Project built successfully

Common Workflows

Quick Feature Branch

> /git:create-worktree new dashboard
# Branch: feature/new-dashboard
# Creates worktree, installs dependencies, ready to code

Hotfix While Feature In Progress

# In main worktree, working on feature
> /git:create-worktree hotfix critical bug
# Branch: hotfix/critical-bug
# Creates separate worktree from main/master
# Fix bug in hotfix worktree
# Return to feature work when done

PR Review Without Stashing

> /git:create-worktree review pr 123
# Branch: review/pr-123
# Creates worktree for reviewing PR
# Can run tests, inspect code
# Delete when review complete

Experiment or Spike

> /git:create-worktree spike new architecture
# Branch: spike/new-architecture
# Creates isolated worktree for experimentation
# Discard or merge based on results

Important Notes

  • Branch lock: Each branch can only be checked out in one worktree at a time. If a branch is already checked out, the command will inform you which worktree has it.
  • Shared.git: All worktrees share the same Git object database. Changes committed in any worktree are visible to all others.
  • Clean working directory: The command checks for uncommitted changes and warns if present, as creating worktrees is safest with a clean state.
  • Sibling directories: Worktrees are always created as sibling directories (using ../) to keep the workspace organized. Never create worktrees inside the main repository.
  • Automatic dependency installation: The command automatically detects the project type and package manager, then runs the appropriate install command without prompting.
  • Remote tracking: For remote branches, worktrees are created with proper tracking setup (--track flag) so pulls/pushes work correctly.

Cleanup

When done with a worktree, use the proper removal command:

git worktree remove ../myproject-add-auth

Or for a worktree with uncommitted changes:

git worktree remove --force ../myproject-add-auth

Never use rm -rf to delete worktrees - always use git worktree remove.

Troubleshooting

"Branch is already checked out"

  • Run git worktree list to see where the branch is checked out
  • Either work in that worktree or remove it first

"Cannot create worktree - path already exists"

  • The target directory already exists
  • Either remove it or choose a different worktree path

"Dependency installation failed"

  • Navigate to the worktree manually: cd../myproject-<name>
  • Run the install command directly to see full error output
  • Common causes: missing system dependencies, network issues, corrupted lockfile

"Wrong type detected"

  • The first word is used as the branch type if it's a known type
  • To force a specific type, start with: fix, hotfix, docs, test, refactor, chore, spike, review
  • Default type is feature/ when first word isn't a known type

平台分布

Codex

34.61%
按下载量换算1,152

Claude

31.34%
按下载量换算1,043

Cursor

18.23%
按下载量换算607

Gemini CLI

10.54%
按下载量换算351

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills