/install git-delegation-management
Git Delegation Management
This skill enables the Manager to execute any git operation on behalf of Workers. Workers cannot access git credentials, so they delegate all git operations to the Manager.
Prerequisites
The Manager has access to:
- Host's
.gitconfigvia/host-share/.gitconfig(symlinked to/root/.gitconfig) - Git credentials (SSH keys, credential helpers) configured on the host
This allows git operations to use the correct author name, email, and authentication.
Handling git-request: Messages
When a Worker sends a message containing git-request::
task-{task-id} git-request:
workspace: /root/hiclaw-fs/shared/tasks/{task-id}/workspace/{repo-name}
operations:
- git clone https://github.com/org/repo.git
- git checkout -b feature-auth
- git add .
- git commit -m "feat: add authentication"
- git push origin feature-auth
---CONTEXT---
{description of what they're trying to accomplish}
---END---
Extract:
task-id: Task identifierworkspace: Path to work in (for clone: parent directory; for other ops: repo directory)operations: List of git commands to execute (literally what to run)context: (Optional) What the Worker is trying to accomplish
Execution Flow
1. Sync and Check Processing Marker
task_id="task-YYYYMMDD-HHMMSS"
workspace="/root/hiclaw-fs/shared/tasks/${task_id}/workspace/{repo-name}"
# Sync from MinIO
mc mirror "hiclaw/hiclaw-storage/shared/tasks/${task_id}/" \
"/root/hiclaw-fs/shared/tasks/${task_id}/"
# Check for processing marker
bash /opt/hiclaw/agent/skills/task-coordination/scripts/check-processing-marker.sh "$task_id"
if [ $? -ne 0 ]; then
# Respond with git-failed: explaining the conflict
exit 1
fi
# Create processing marker
bash /opt/hiclaw/agent/skills/task-coordination/scripts/create-processing-marker.sh "$task_id" "manager" 15
2. Execute Git Commands
Navigate to the workspace and execute the git commands:
cd "$workspace"
# Execute each git command
git clone https://github.com/org/repo.git
git checkout -b feature-auth
# ... etc
# Log output for debugging
You know how to use git. Execute the commands the Worker requests. If something goes wrong (merge conflict, authentication failure, etc.), handle it appropriately.
3. Cleanup and Respond
# Remove processing marker
bash /opt/hiclaw/agent/skills/task-coordination/scripts/remove-processing-marker.sh "$task_id"
# Sync to MinIO
mc mirror "/root/hiclaw-fs/shared/tasks/${task_id}/" \
"hiclaw/hiclaw-storage/shared/tasks/${task_id}/" --overwrite
On success — send to Worker:
@{worker}:DOMAIN task-{task-id} git-result:
Git operations completed successfully.
{Summary of what was done - commits, pushes, branches created, etc.}
Run `bash /opt/hiclaw/agent/skills/file-sync/scripts/hiclaw-sync.sh` to sync.
On failure — send to Worker:
@{worker}:DOMAIN task-{task-id} git-failed:
Git operation failed: {error message}
{Suggestion for how to fix it, if applicable}
What Operations Can Be Delegated
Any git operation, including but not limited to:
| Category | Commands |
|---|---|
| Repository | git clone, git init |
| Branches | git branch, git checkout, git switch |
| Remote | git remote, git fetch, git pull, git push |
| Commits | git add, git commit, git reset, git revert |
| History | git log, git show, git diff |
| Rebase | git rebase, git rebase -i |
| Cherry-pick | git cherry-pick |
| Merge | git merge |
| Stash | git stash |
| Tags | git tag |
| Submodules | git submodule |
| Config | git config (local to repo) |
If git can do it, the Worker can delegate it.
Error Handling
When git operations fail:
- Read the error message and understand what went wrong
- Try to fix it if it's a simple issue (e.g., set upstream, configure user locally)
- Report to Worker if it requires their action (e.g., merge conflicts, rebasing decisions)
- Escalate to admin if it's a credential or permission issue
Common issues:
- Merge conflicts → Ask Worker to resolve locally
- Authentication failure → Check
/host-share/.gitconfigand credential helper - Branch divergence → Worker may need to pull/rebase first
Integration with Task Coordination
Always use the .processing marker to prevent conflicts when both Worker and Manager might modify the workspace.
\x3C!-- hiclaw-builtin-end -->
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install git-delegation-management - 安装完成后,直接呼叫该 Skill 的名称或使用
/git-delegation-management触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Git Delegation Management 是什么?
Execute any git command on behalf of Workers without credentials by processing their git-request messages and managing workspace synchronization safely. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 171 次。
如何安装 Git Delegation Management?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install git-delegation-management」即可一键安装,无需额外配置。
Git Delegation Management 是免费的吗?
是的,Git Delegation Management 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Git Delegation Management 支持哪些平台?
Git Delegation Management 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Git Delegation Management?
由 Monty(@montycn)开发并维护,当前版本 v1.0.0。