Token导航 LogoToken导航

Agent Skill · 研究检索

git:compare-worktrees(git 比较工作树)

git:compare-worktrees 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

git:compare-worktrees 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,暂无第三方扫描结果,按安装量在研究检索类的 73,675 个 Skill 里排第 11,840。

总安装 10,845周安装 443GitHub Stars 891下载 3,473核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

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

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

git-compare-worktrees 比较不同工作树之间的文件差异,辅助并行开发。适用于同时维护多个功能分支或实验性修改的场景。可生成统一 diff 报告,标识各工作树间的变更交集与差异。需确保所有工作树基于同一仓库,避免路径或引用错误。

git:compare-worktrees 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/git:compare-worktrees

上手步骤

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:compare-worktrees 怎么安装?

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

git:compare-worktrees 支持哪些 AI 工具?

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

git:compare-worktrees 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

git:compare-worktrees 是免费的吗?

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

git:compare-worktrees 用的人多吗?

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

git:compare-worktrees 安全吗?

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

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

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

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

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

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
git:compare-worktrees

git 比较工作树 · 本页

10,845891只读未明确未收录

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

SKILL.md 原文

Claude Command: Compare Worktrees

Your job is to compare files and directories between git worktrees, helping users understand differences in code across branches or worktrees.

Instructions

CRITICAL: Perform the following steps exactly as described:

  1. Current state check: Run git worktree list to show all existing worktrees and their locations
  2. Parse user input: Classify each provided argument:

- No arguments: Interactive mode - ask user what to compare - --stat: Show summary statistics of differences (files changed, insertions, deletions) - Worktree path: A path that matches one of the worktree roots from git worktree list - Branch name: A name that matches a branch in one of the worktrees - File/directory path: A path within the current worktree to compare

  1. Determine comparison targets (worktrees to compare): a. If user provided worktree paths: Use those as comparison targets b. If user specified branch names: Find the worktrees for those branches from git worktree list c. If only one worktree exists besides current: Use current and that one as comparison targets d. If multiple worktrees exist and none specified: Present list and ask user which to compare e. If no other worktrees exist: Offer to compare with a branch using git diff
  2. Determine what to compare (files/directories within worktrees): a. If user specified file(s) or directory(ies) paths: Compare ALL of them b. If no specific paths given: Ask user:

- "Compare entire worktree?" or - "Compare specific files/directories? (enter paths)"

  1. Execute comparison: For specific files between worktrees: diff <worktree1>/<path> <worktree2>/<path> # Or for unified diff format: diff -u <worktree1>/<path> <worktree2>/<path> For directories between worktrees: diff -r <worktree1>/<directory> <worktree2>/<directory> # Or for summary only: diff -rq <worktree1>/<directory> <worktree2>/<directory> For branch-level comparison (using git diff): git diff <branch1>..<branch2> -- <path> # Or for stat summary: git diff --stat <branch1>..<branch2> For comparing with current working directory: diff <current-file> <other-worktree>/<file>
  2. Format and present results:

- Show clear header indicating what's being compared - For large diffs, offer to show summary first - Highlight significant changes (new files, deleted files, renamed files) - Provide context about the branches each worktree contains

Comparison Modes

ModeDescriptionCommand Pattern
File diffCompare single file between worktreesdiff -u <wt1>/file <wt2>/file
Directory diffCompare directories recursivelydiff -r <wt1>/dir <wt2>/dir
Summary onlyShow which files differ (no content)diff -rq <wt1>/ <wt2>/
Git diffUse git's diff (branch-based)git diff branch1..branch2 -- path
Stat viewShow change statisticsgit diff --stat branch1..branch2

Worktree Detection

The command finds worktrees using git worktree list:

/home/user/project           abc1234 [main]
/home/user/project-feature   def5678 [feature-x]
/home/user/project-hotfix    ghi9012 [hotfix-123]

From this output, the command extracts:

  • Path: The absolute path to the worktree directory
  • Branch: The branch name in brackets (used when user specifies branch name)

Examples

Compare specific file between worktrees:

> /git:compare-worktrees src/app.js
# Prompts to select which worktree to compare with
# Shows diff of src/app.js between current and selected worktree

Compare between two specific worktrees:

> /git:compare-worktrees ../project-main ../project-feature src/module.js
# Compares src/module.js between the two specified worktrees

Compare multiple files/directories:

> /git:compare-worktrees src/app.js src/utils/ package.json
# Shows diffs for all three paths between worktrees

Compare entire directories:

> /git:compare-worktrees src/
# Shows all differences in src/ directory between worktrees

Get summary statistics:

> /git:compare-worktrees --stat
# Shows which files differ and line counts

Interactive mode:

> /git:compare-worktrees
# Lists available worktrees
# Asks which to compare
# Asks for specific paths or entire worktree

Compare with branch worktree by branch name:

> /git:compare-worktrees feature-x
# Finds worktree for feature-x branch and compares

Compare specific paths between branch worktrees:

> /git:compare-worktrees main feature-x src/ tests/
# Compares src/ and tests/ directories between main and feature-x worktrees

Output Format

File Comparison Header:

Comparing: src/app.js
  From: /home/user/project (main)
  To:   /home/user/project-feature (feature-x)
---
[diff output]

Summary Output:

Worktree Comparison Summary
===========================
From: /home/user/project (main)
To:   /home/user/project-feature (feature-x)

Files only in main:
  - src/deprecated.js

Files only in feature-x:
  + src/new-feature.js
  + src/new-feature.test.js

Files that differ:
  ~ src/app.js
  ~ src/utils/helpers.js
  ~ package.json

Statistics:
  3 files changed
  2 files added
  1 file removed

Common Workflows

Review Feature Changes

# See what changed in a feature branch
> /git:compare-worktrees --stat
> /git:compare-worktrees src/components/

Compare Implementations

# Compare how two features implemented similar functionality
> /git:compare-worktrees ../project-feature-1 ../project-feature-2 src/auth/

Quick File Check

# Check if a specific file differs
> /git:compare-worktrees package.json

Pre-Merge Review

# Review all changes before merging (compare src and tests together)
> /git:compare-worktrees --stat
> /git:compare-worktrees src/ tests/
# Both src/ and tests/ directories will be compared

Important Notes

  • Argument detection: The command auto-detects argument types by comparing them against git worktree list output:

- Paths matching worktree roots → treated as worktrees to compare - Names matching branches in worktrees → treated as worktrees to compare - Other paths → treated as files/directories to compare within worktrees

  • Multiple paths: When multiple file/directory paths are provided, ALL of them are compared between the selected worktrees (not just the first one).
  • Worktree paths: When specifying worktrees, use the full path or relative path from current directory (e.g., ../project-feature)
  • Branch vs Worktree: If you specify a branch name, the command looks for a worktree with that branch checked out. If no worktree exists for that branch, it suggests using git diff instead.
  • Large diffs: For large directories, the command will offer to show a summary first before displaying full diff output.
  • Binary files: Binary files are detected and reported as "Binary files differ" without showing actual diff.
  • File permissions: The diff will also show changes in file permissions if they differ.
  • No worktrees: If no other worktrees exist, the command will explain how to create one and offer to use git diff for branch comparison instead.

Integration with Create Worktree

Use /git:create-worktree first to set up worktrees for comparison:

# Create worktrees for comparison
> /git:create-worktree feature-x, main
# Created: ../project-feature-x and ../project-main

# Now compare
> /git:compare-worktrees src/

Troubleshooting

"No other worktrees found"

  • Create a worktree first with /git:create-worktree <branch>
  • Or use git diff for branch-only comparison without worktrees

"Worktree for branch not found"

  • The branch may not have a worktree created
  • Run git worktree list to see available worktrees
  • Create the worktree with /git:create-worktree <branch>

"Path does not exist in worktree"

  • The specified file/directory may not exist in one of the worktrees
  • This could indicate the file was added/deleted in one branch
  • The command will report this in the comparison output

平台分布

Codex

35.62%
按下载量换算1,237

Claude

27.23%
按下载量换算946

Cursor

18.82%
按下载量换算654

Gemini CLI

8.99%
按下载量换算312

安全审计

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

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

继续浏览同类 Skills