Token导航 LogoToken导航TokenDH.com
运维和基础设施需要联网github未标认证来源可访问clear审计提醒

worktree工作树

Agent Skill

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

总安装

1,388

周安装

59

GitHub Stars

7,117

下载量

486
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/civitai/civitai --skill worktree

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,辅助项目状态整理。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中需要围绕代码变更进行梳理的场景。
  • 可结合来源仓库和原始 README 进一步核验具体功能和操作流程。
  • 安装前建议确认权限范围和维护状态,避免触发意外的网络或文件操作。
  • worktree 属于运维和基础设施类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Worktree Setup Skill

Creates git worktrees with all necessary setup for running the dev server. Handles the tedious setup steps so you can start working immediately.

Quick Start

# Create a worktree for a new branch
node .claude/skills/worktree/cli.mjs create feature/my-feature

# Create a worktree for an existing branch
node .claude/skills/worktree/cli.mjs create existing-branch

# List all worktrees
node .claude/skills/worktree/cli.mjs list

# Remove a worktree
node .claude/skills/worktree/cli.mjs remove feature/my-feature

What It Does

When you create a worktree, the skill:

  1. Creates the git worktree at ../model-share-<branch-name> (slashes in branch names are replaced with dashes)
  2. Initializes git submodules (git submodule update --init --recursive) - required for event-engine-common
  3. Copies .env from the main worktree to the new worktree
  4. Runs pnpm install to set up dependencies (leverages pnpm's content-addressable store for fast installs)

CLI Commands

CommandDescription
create <branch>Create a new worktree for the specified branch
listList all worktrees
remove <branch>Remove a worktree (deletes directory and prunes git worktree)

Examples

# Create worktree for a new feature
node .claude/skills/worktree/cli.mjs create feature/user-auth
# Creates: ../model-share-feature-user-auth

# Create worktree for a bugfix
node .claude/skills/worktree/cli.mjs create fix/login-issue
# Creates: ../model-share-fix-login-issue

# Remove when done
node .claude/skills/worktree/cli.mjs remove fix/login-issue

Merging a Worktree to Main

When the user asks to "merge the worktree" or "merge to main", follow this workflow:

  1. Commit changes in the worktree: cd /path/to/worktree git add <files> git commit -m "feat/fix: description"
  2. Update and merge to main: cd /path/to/main-worktree git fetch origin && git checkout main && git pull origin main git merge <branch-name> --no-edit git push origin main
  3. Clean up the worktree and branch: # Remove the worktree directory (use --force if needed) rm -rf /path/to/worktree # Delete the local branch git branch -d <branch-name> # Optionally delete remote branch git push origin --delete <branch-name>

Example

# 1. Commit in worktree
cd ../model-share-fix-my-bug
git add src/file.ts
git commit -m "fix: resolve the bug"

# 2. Merge to main
cd ../model-share
git fetch origin && git checkout main && git pull origin main
git merge fix/my-bug --no-edit
git push origin main

# 3. Clean up
rm -rf ../model-share-fix-my-bug
git branch -d fix/my-bug

Notes

  • Branch names with slashes are converted to dashes in the directory name
  • The .env file is copied (not symlinked) so you can customize environment per worktree if needed
  • Uses pnpm's content-addressable store, so subsequent worktree installs are fast
  • After creation, use /dev-server skill to start the dev server in the new worktree

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.99%
按下载量换算141

Gemini CLI

24.08%
按下载量换算117

windsurf

17.81%
按下载量换算87

trae

14.61%
按下载量换算71

OpenCode

7.35%
按下载量换算36

Codex

3.86%
按下载量换算19

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills