worktree — community worktree, usopc-athlete-support-agent, community, ide skills, Claude Code, Cursor, Windsurf

v1.0.0

关于此技能

适用于需要高级工作树管理功能以实现高效仓库处理的基于 Git 的 AI 代理。 Smart worktree management — create, list, and clean up git worktrees with automatic gotcha handling (pnpm install, hook script copy, issue validation).

rosinbum rosinbum
[0]
[0]
更新于: 3/23/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 6/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution
Review Score
6/11
Quality Score
36
Canonical Locale
en
Detected Body Locale
en

适用于需要高级工作树管理功能以实现高效仓库处理的基于 Git 的 AI 代理。 Smart worktree management — create, list, and clean up git worktrees with automatic gotcha handling (pnpm install, hook script copy, issue validation).

核心价值

赋予代理管理 Git 工作树的能力,利用诸如 'create'、'list' 和 'cleanup' 的子命令来简化工作流,并利用 Git 协议实现无缝的仓库交互。

适用 Agent 类型

适用于需要高级工作树管理功能以实现高效仓库处理的基于 Git 的 AI 代理。

赋予的主要能力 · worktree

为特定问题创建新工作树以隔离开发
列出活动工作树及其状态以监控项目进度
清理已合并分支的工作树以维护仓库组织

! 使用限制与门槛

  • 需要 Git 工作树功能
  • 需要特定的参数解析用于子命令
  • 仅限于管理单个 monorepo 内的工作树

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.
  • - The underlying skill quality score is below the review floor.

Source Boundary

The section below is supporting source material from the upstream repository. Use the Killer-Skills review above as the primary decision layer.

实验室 Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

常见问题与安装步骤

以下问题与步骤与页面结构化数据保持一致,便于搜索引擎理解页面内容。

? FAQ

worktree 是什么?

适用于需要高级工作树管理功能以实现高效仓库处理的基于 Git 的 AI 代理。 Smart worktree management — create, list, and clean up git worktrees with automatic gotcha handling (pnpm install, hook script copy, issue validation).

如何安装 worktree?

运行命令:npx killer-skills add rosinbum/usopc-athlete-support-agent/worktree。支持 Cursor、Windsurf、VS Code、Claude Code 等 19+ IDE/Agent。

worktree 适用于哪些场景?

典型场景包括:为特定问题创建新工作树以隔离开发、列出活动工作树及其状态以监控项目进度、清理已合并分支的工作树以维护仓库组织。

worktree 支持哪些 IDE 或 Agent?

该技能兼容 Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer。可使用 Killer-Skills CLI 一条命令通用安装。

worktree 有哪些限制?

需要 Git 工作树功能;需要特定的参数解析用于子命令;仅限于管理单个 monorepo 内的工作树。

安装步骤

  1. 1. 打开终端

    在你的项目目录中打开终端或命令行。

  2. 2. 执行安装命令

    运行:npx killer-skills add rosinbum/usopc-athlete-support-agent/worktree。CLI 会自动识别 IDE 或 AI Agent 并完成配置。

  3. 3. 开始使用技能

    worktree 已启用,可立即在当前项目中调用。

! 参考页模式

此页面仍可作为安装与查阅参考,但 Killer-Skills 不再把它视为主要可索引落地页。请优先阅读上方评审结论,再决定是否继续查看上游仓库说明。

Imported Repository Instructions

The section below is supporting source material from the upstream repository. Use the Killer-Skills review above as the primary decision layer.

Supporting Evidence

worktree

安装 worktree,这是一款面向AI agent workflows and automation的 AI Agent Skill。支持 Claude Code、Cursor、Windsurf,一键安装。

SKILL.md
Readonly
Imported Repository Instructions
The section below is supporting source material from the upstream repository. Use the Killer-Skills review above as the primary decision layer.
Supporting Evidence

Smart Worktree Management

You are managing git worktrees for the USOPC Athlete Support Agent monorepo. The argument is: $ARGUMENTS.

Parse the argument to determine the subcommand:

  • create <issue-number> — Create a new worktree for an issue
  • list — List active worktrees with status
  • cleanup — Remove worktrees whose branches have been merged

If no subcommand is provided or the argument is empty, print the usage:

Usage: /worktree <command> [args]
  create <issue-number>  — Create worktree for a GitHub issue
  list                   — List active worktrees with branch status
  cleanup                — Remove merged worktrees and prune refs

Subcommand: create <issue-number>

Step 1: Validate the issue exists

Run gh issue view <issue-number> --json number,title,state to confirm the issue exists and is open. If the issue doesn't exist or is closed, warn the user and stop.

Step 2: Determine paths

  • Get the main repo root: git rev-parse --show-toplevel (if in a worktree, use git worktree list to find the main repo)
  • Worktree path: ../usopc-issue-<number> relative to the main repo (i.e., a sibling directory)
  • Derive a short branch name from the issue title: feat/<kebab-case-summary> (max 50 chars, lowercase, hyphens only)

Step 3: Fetch latest main

Run git fetch origin main to ensure we branch from the latest main.

Step 4: Create the worktree

bash
1git worktree add <worktree-path> -b <branch-name> origin/main

If the worktree path already exists, warn and stop.

Step 5: Install dependencies

bash
1cd <worktree-path> && pnpm install

Step 6: Print summary

Worktree created:
  Path:   <worktree-path>
  Branch: <branch-name>
  Issue:  #<number> — <title>

Dependencies installed.
Navigate with: cd <worktree-path>

Subcommand: list

Step 1: List worktrees

Run git worktree list and parse the output.

Step 2: For each worktree (excluding bare/main)

  • Show the path, branch name
  • Run git -C <path> log --oneline -1 for latest commit
  • Run git -C <path> rev-list --left-right --count origin/main...<branch> for ahead/behind status

Step 3: Print formatted table

Active worktrees:
  ../usopc-issue-42  feat/add-auth        +3 / -0  (latest: abc1234 Add auth middleware)
  ../usopc-issue-55  fix/query-perf       +1 / -2  (latest: def5678 Fix slow query)

Subcommand: cleanup

Step 1: List worktrees

Run git worktree list and identify non-main worktrees.

Step 2: Check each branch

For each worktree branch, check if it has been merged into origin/main:

bash
1git branch --merged origin/main | grep <branch-name>

Step 3: Remove merged worktrees

For each merged worktree, remove it:

bash
1git worktree remove <path>

Print which worktrees were removed.

Step 4: Prune and clean up

bash
1git worktree prune 2git fetch --prune origin

Step 5: Print summary

Cleaned up:
  Removed: ../usopc-issue-42 (feat/add-auth — merged)
  Removed: ../usopc-issue-55 (fix/query-perf — merged)
  Pruned stale worktree references.

If no worktrees were eligible for cleanup, say so.

Important notes

  • Always use absolute paths when running git commands to avoid confusion between worktree and main repo.
  • The main repo root can be found via git worktree list — it's the first entry (the one without [branch] or with [main]).
  • scripts/update-hours.mjs and scripts/stamp-readme-hours.mjs are tracked in git, so they'll be available in worktrees automatically — no copying needed.

相关技能

寻找 worktree 的替代方案 (Alternative) 或可搭配使用的同类 community Skill?探索以下相关开源技能。

查看全部

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

为prompts.chat的信息反馈系统生成可定制的插件小部件

149.6k
0
AI

flags

Logo of vercel
vercel

React 框架

138.4k
0
浏览器

pr-review

Logo of pytorch
pytorch

Python中具有强大GPU加速的张量和动态神经网络

98.6k
0
开发者工具