← 返回 Skills 市场
weidongkl

Git Worktree

作者 wei dong · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
115
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install git-worktree
功能描述
Git Worktree 多需求并行开发助手。在当前 worktree 目录下独立开发、修改、提交代码,不跨目录操作。基于目录命名规范自动识别仓库归属(如 main-repo-feature-a → main-repo 仓库)。遵循最小改动原则,从需求分析到 commit 交付全流程负责。触发场景:用户在 wor...
使用说明 (SKILL.md)

git-worktree - Git Worktree 多需求并行开发


🏗️ 目录命名规范

/workspace/main-repo                ← 主仓库(main 分支)
/workspace/main-repo-feature-a      ← main-repo 的需求 A
/workspace/main-repo-bugfix-c       ← main-repo 的修复 C
/workspace/other-repo-feature-d     ← other-repo 的需求 D

规则:前缀 = 仓库名后缀 = 需求标识


📋 执行流程

1. 识别仓库与需求

从目录名解析:main-repo-feature-a → 仓库 main-repo,需求 feature-a

目录名不规范时,通过 git remote -v 确认归属。

2. 确认工作区状态

git branch
git status
git log -5 --oneline

⚠️ 脏工作区先提醒,不覆盖未提交内容。

3. 理解需求上下文

优先读取:TASK.md / README.md / ARCH.md / 构建文件(go.mod、pom.xml 等)。

4. 开发

  • 最小改动,复用现有代码
  • 保持风格一致,不做无关重构
  • 只改当前需求涉及的代码

5. 完成输出

  • 修改文件清单 + 摘要
  • 设计理由 + 风险点
  • 测试建议 + commit message 建议

⚠️ 规则

允许 ✅ 禁止 ❌
当前目录开发当前需求 切换其他 worktree 目录
当前分支提交代码 修改其他需求代码
分析当前目录代码 操作其他仓库/分支
从目录名解析归属 git reset --hard / clean -fd(除非要求)

🔄 新任务初始化

  1. 解析目录名 → 确认仓库和需求
  2. 查看 git 状态
  3. 输出执行计划
  4. 等待确认后开始

最后更新: 2026-04-20

安全使用建议
This skill is internally consistent: it will read files in the current worktree and run standard git commands (status, branch, log, remote) to produce development plans and commit suggestions. Before using it, confirm you trust the skill owner/repo (no homepage is provided) and only run it in repositories where it's safe to allow automated inspection. Although the SKILL.md says destructive commands are prohibited, any automated agent that executes commands can potentially change files — review its actions before confirming tasks and avoid running it on sensitive or production repositories.
功能分析
Type: OpenClaw Skill Name: git-worktree Version: 1.0.0 The git-worktree skill is a well-defined set of instructions for managing parallel development within Git worktrees. It includes explicit safety constraints in SKILL.md that prohibit the agent from accessing directories outside the current worktree or performing destructive operations like 'git reset --hard'. No indicators of data exfiltration, malicious execution, or prompt injection attacks were found.
能力评估
Purpose & Capability
Name/description (Git Worktree helper) align with the runtime instructions: parsing directory names, checking git status/log, reading TASK.md/README/build files, and producing commit/messages. No unrelated credentials, binaries, or install steps are required.
Instruction Scope
SKILL.md confines actions to the current worktree: running git branch/status/log, reading local task and build files, and producing change summaries. It explicitly forbids switching to other worktrees/repos or running destructive commands (git reset --hard / clean -fd) unless requested. No instructions to access unrelated system paths or external endpoints.
Install Mechanism
No install specification or code files are present (instruction-only). Nothing will be downloaded or written to disk by an installer.
Credentials
The skill requires no environment variables, credentials, or config paths. Its declared inputs are proportional to its purpose (local repository inspection and guidance).
Persistence & Privilege
always is false and the skill is user-invocable. It does not request persistent system-wide privileges or modify other skills' configuration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install git-worktree
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /git-worktree 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Git Worktree parallel development skill with directory naming conventions
元数据
Slug git-worktree
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Git Worktree 是什么?

Git Worktree 多需求并行开发助手。在当前 worktree 目录下独立开发、修改、提交代码,不跨目录操作。基于目录命名规范自动识别仓库归属(如 main-repo-feature-a → main-repo 仓库)。遵循最小改动原则,从需求分析到 commit 交付全流程负责。触发场景:用户在 wor... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 115 次。

如何安装 Git Worktree?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install git-worktree」即可一键安装,无需额外配置。

Git Worktree 是免费的吗?

是的,Git Worktree 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Git Worktree 支持哪些平台?

Git Worktree 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Git Worktree?

由 wei dong(@weidongkl)开发并维护,当前版本 v1.0.0。

💬 留言讨论