git-worktree

Git Worktree 多需求并行开发助手。在当前 worktree 目录下独立开发、修改、提交代码,不跨目录操作。基于目录命名规范自动识别仓库归属(如 main-repo-feature-a → main-repo 仓库)。遵循最小改动原则,从需求分析到 commit 交付全流程负责。触发场景:用户在 worktree 目录下发起开发任务、提到 worktree、提到多需求并行开发。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "git-worktree" with this command: npx skills add weidongkl/git-worktree

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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

Git Workflows Advanced

Advanced Git operations as tools: interactive rebase with autosquash, worktree management, reflog recovery, subtree/submodule handling, cherry-pick across fo...

Registry SourceRecently Updated
790Profile unavailable
Coding

Universal Release

Universal release workflow. Auto-detects version files and changelogs. Supports Node.js, Python, Rust, Claude Plugin, and generic projects. Use when user say...

Registry SourceRecently Updated
2560Profile unavailable
Coding

Chief Feature Workflow

Create and implement new features in Chief-managed projects using the Chief CLI. Use when asked to create a new PRD, implement a feature with Chief, set up a...

Registry SourceRecently Updated
4321Profile unavailable
Coding

Dev Chronicle

Generate narrative chronicles of developer work from git history, session transcripts, and memory files. Use when the user asks "what did I do today/this wee...

Registry SourceRecently Updated
7321Profile unavailable