Git Workflows Pro
Advanced Git operations wrapped as tools for OpenClaw agents. These are the operations you do rarely but need to be correct.
Why This Exists
Standard git skill covers add/commit/push/status. This skill covers everything else:
- - Interactive rebase (squash, reorder, edit, autosquash)
- Worktrees for parallel development
- Reflog recovery when you think you've lost commits
- Subtrees for dependency management
- PR creation with required human-written intent
- Changelog generation
All based on battle-tested patterns from ClawHub's git-workflows and pr-commit-workflow.
Tools
gitrebaseinteractive
Start an interactive rebase. Returns the todo list and guidance.
CODEBLOCK0
Response includes:
- -
todo_list — the generated todo with current commit hashes and messages - INLINECODE4 — how to edit, save, continue, abort
gitworktreeadd
Create a new worktree for a branch, allowing simultaneous work on multiple branches without cloning.
CODEBLOCK1
Creates directory, checks out branch. Returns new worktree path.
gitreflogrecover
List reflog entries or restore a lost commit.
List:
CODEBLOCK2
Restore:
CODEBLOCK3
Creates a new branch at that commit or updates existing.
gitsubtreeadd
Add another repository as a subtree under a prefix.
CODEBLOCK4
Runs git subtree add --prefix.
gitprcreate
Create a PR on GitHub. Requires human-written title and body (no generation). Uses gh CLI.
CODEBLOCK5
Returns PR URL and number.
gitchangeloggenerate
Generate a markdown changelog between two tags or from last tag to HEAD.
CODEBLOCK6
Outputs grouped commits by type (feat, fix, breaking) if conventional commits used.
Prerequisites
- - Git installed
- GitHub CLI (
gh) for PR creation - Authenticated with INLINECODE8
Usage
All tools are invoked via the registry:
CODEBLOCK7
Safety
- - Interactive rebase returns todo but does NOT execute; agent must apply changes manually
- PR creation requires explicit human-written title/body (no autogeneration)
- All destructive operations (subtree, reflog restore) print warnings and require additional flag if truly dangerous (not yet implemented)
Future
- - Add
git_bisect_start, INLINECODE10 - Add
git_cherry_pick_across_fork for cross-repo pick - Add
git_merge_conflict_resolution strategies - Add MCP server for Git operations (read-only)
License
Commercial. $49 one-time. Includes lifetime updates.
Patterns from ClawHub's git-workflows, pr-commit-workflow, and agent-harness-architect.
Git Workflows Pro
为OpenClaw代理封装的高级Git操作。这些是你很少执行但必须确保正确的操作。
为什么存在
标准的git技能涵盖添加/提交/推送/状态。此技能涵盖其他所有内容:
- - 交互式变基(压缩、重排、编辑、自动压缩)
- 用于并行开发的工作树
- 当你认为丢失提交时的引用日志恢复
- 用于依赖管理的子树
- 需要人工编写意图的PR创建
- 变更日志生成
全部基于ClawHub的git-workflows和pr-commit-workflow中经过实战检验的模式。
工具
gitrebaseinteractive
启动交互式变基。返回待办列表和指导。
json
{
base: HEAD~5,
autosquash: true
}
响应包括:
- - todo_list — 生成的待办列表,包含当前提交哈希和消息
- instructions — 如何编辑、保存、继续、中止
gitworktreeadd
为分支创建新的工作树,允许无需克隆即可同时在多个分支上工作。
json
{
branch: feature/new-ui,
path: /path/to/worktrees/new-ui
}
创建目录,检出分支。返回新的工作树路径。
gitreflogrecover
列出引用日志条目或恢复丢失的提交。
列出:
json
{ action: list }
恢复:
json
{
action: restore,
commit_hash: abc123,
target_branch: main
}
在该提交处创建新分支或更新现有分支。
gitsubtreeadd
将另一个仓库作为子树添加到指定前缀下。
json
{
repo_url: https://github.com/user/lib.git,
prefix: vendor/lib,
branch: main
}
运行git subtree add --prefix。
gitprcreate
在GitHub上创建PR。需要人工编写的标题和正文(不生成)。使用gh CLI。
json
{
title: 为用户模型添加输入验证,
body: 修复了用户可提交空表单的问题。验证检查空值和空字符串。\n\n测试:为边界情况添加了单元测试。,
head: feature/input-validation,
base: main,
draft: false
}
返回PR URL和编号。
gitchangeloggenerate
在两个标签之间或从最后一个标签到HEAD生成Markdown格式的变更日志。
json
{
from_tag: v1.2.0,
to_tag: v1.3.0,
output_format: markdown
}
如果使用约定式提交,则按类型(特性、修复、破坏性变更)分组输出提交。
前置条件
- - 已安装Git
- GitHub CLI (gh) 用于创建PR
- 使用gh auth login进行身份验证
使用方法
所有工具通过注册表调用:
python
tool(git-workflows-pro, gitrebaseinteractive, {base: HEAD~10, autosquash: true})
tool(git-workflows-pro, gitworktreeadd, {branch: feature/foo, path: ./worktrees/foo})
tool(git-workflows-pro, gitprcreate, {title: ..., body: ..., head: my-branch})
安全性
- - 交互式变基返回待办列表但不执行;代理必须手动应用更改
- PR创建需要明确的人工编写标题/正文(不自动生成)
- 所有破坏性操作(子树、引用日志恢复)会打印警告,如果真正危险则需要额外标志(尚未实现)
未来计划
- - 添加gitbisectstart、gitbisectrun
- 添加gitcherrypickacrossfork用于跨仓库挑选
- 添加gitmergeconflict_resolution策略
- 添加用于Git操作的MCP服务器(只读)
许可证
商业用途。一次性付费$49。包含终身更新。
来自ClawHub的git-workflows、pr-commit-workflow和agent-harness-architect的模式。