跳到正文
cccskills
免费在 GitHub 公开

git-delegation

Delegate Git operations to a Manager when a worker lacks credentials. The skill explains how to prepare command requests, receive results, and synchronize shared files, covering repository downloads, branches, commits, pushes, and other Git tasks.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

将所有 git 操作委托给 Manager 执行。Worker 无法直接访问 git credentials,因此任何需要认证的 git 操作(clone、push、fetch 等)都需要通过此机制委托给 Manager。

查看安装方法

适用场景

  • Request repository cloning or remote updates
  • Delegate a branch, commit, and push workflow
  • Ask the Manager to merge or reorganize commits
  • Synchronize shared files before and after delegated work

包含的文件(1)

  • SKILL.md8.6 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Git Delegation

This skill allows you to delegate any git operation to the Manager. Since Workers don't have access to git credentials, all git commands that require authentication must be delegated.

What Can Be Delegated

Any git command, including but not limited to:

  • git clone - Clone repositories
  • git fetch / git pull - Fetch/pull from remote
  • git push - Push to remote
  • git checkout / git switch - Switch branches
  • git branch - Manage branches
  • git add / git commit - Stage and commit
  • git merge - Merge branches
  • git rebase - Rebase commits (including interactive)
  • git cherry-pick - Cherry-pick commits
  • git reset / git revert - Undo changes
  • git stash - Stash changes
  • git tag - Manage tags
  • git submodule - Manage submodules
  • And any other git command...

If git can do it, you can delegate it.


When to Use This Skill vs github-operations

TaskUse git-delegationUse github-operations
Clone repository✅
Pull/fetch changes✅
Read/write files✅
Create/switch branches✅
Commit/push code✅
Rebase/cherry-pick✅
Manage tags✅
Create PR✅
Review/merge PR✅
Comment on PR✅
Create/update Issue✅

Message Format

Send a git-request: message to the Manager.

First, get your actual Matrix domain:

echo $AGENTTEAMS_MATRIX_DOMAIN
# e.g.: matrix-local.agentteams.io:18080

Then send (substitute the real domain — do NOT write $AGENTTEAMS_MATRIX_DOMAIN literally):

@manager:matrix-local.agentteams.io:18080 task-{task-id} git-request:
workspace: /root/agentteams-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---
{What you're trying to accomplish}
---END---

Fields:

  • workspace: Directory to work in (parent dir for clone, repo dir for other ops)
  • operations: List of git commands to execute (literally what to run)
  • context: (Optional) What you're trying to accomplish - helps Manager understand intent

Step-by-Step Workflow

1. Check for Processing Marker

Before making changes, check if the task directory is being processed:

# Sync from MinIO
mc mirror "${AGENTTEAMS_STORAGE_PREFIX}/shared/tasks/{task-id}/" \
  "/root/agentteams-fs/shared/tasks/{task-id}/"

# Check for processing marker
if [ -f "/root/agentteams-fs/shared/tasks/{task-id}/.processing" ]; then
    echo "Task directory is being processed. Wait for manager to complete."
fi

2. Prepare Your Request

Write out the git commands you want executed:

@manager:DOMAIN task-20260225 git-request:
workspace: /root/agentteams-fs/shared/tasks/task-20260225/workspace
operations:
  - git clone https://github.com/agentscope-ai/AgentTeams.git
  - cd agentteams && git checkout -b feature-xyz
---CONTEXT---
Starting work on feature XYZ
---END---

3. Wait for Response

Success — git-result:

@alice:DOMAIN task-20260225 git-result:
Git operations completed successfully.
Cloned to: /root/agentteams-fs/shared/tasks/task-20260225/workspace/agentteams
Created branch: feature-xyz
Run `agentteams-sync` to sync.

Failure — git-failed:

@alice:DOMAIN task-20260225 git-failed:
Git operation failed: {error message}
{Suggestion for how to fix}

4. Sync and Continue

After receiving git-result::

# Sync from MinIO
agentteams-sync

# Now you can work locally
cd /root/agentteams-fs/shared/tasks/task-20260225/workspace/agentteams

# Read files, modify files, etc.
cat src/main.py
# ... make changes ...

# When ready to commit, sync to MinIO first
mc mirror "/root/agentteams-fs/shared/tasks/task-20260225/" \
  "${AGENTTEAMS_STORAGE_PREFIX}/shared/tasks/task-20260225/" --overwrite

5. Commit and Push

After making local changes:

@manager:DOMAIN task-20260225 git-request:
workspace: /root/agentteams-fs/shared/tasks/task-20260225/workspace/agentteams
operations:
  - git add .
  - git commit -m "feat: implement feature XYZ"
  - git push origin feature-xyz
---CONTEXT---
Completed implementation of feature XYZ
---END---

Local vs Delegated Operations

You can run any git command that doesn't need authentication locally:

# These work locally (no auth needed):
git status
git log
git diff
git branch
git diff --staged

# These require delegation (need auth):
git clone https://github.com/...
git push
git fetch
git pull

Advanced Operations

Interactive Rebase

@manager:DOMAIN task-20260225 git-request:
workspace: /root/agentteams-fs/shared/tasks/task-20260225/workspace/agentteams
operations:
  - git rebase -i HEAD~3
---CONTEXT---
Squashing the last 3 commits into one
---END---

Cherry-pick

@manager:DOMAIN task-20260225 git-request:
workspace: /root/agentteams-fs/shared/tasks/task-20260225/workspace/agentteams
operations:
  - git cherry-pick abc123def
---CONTEXT---
Cherry-picking fix from main branch
---END---

Merge with Strategy

@manager:DOMAIN task-20260225 git-request:
workspace: /root/agentteams-fs/shared/tasks/task-20260225/workspace/agentteams
operations:
  - git merge feature-xyz --no-ff -m "Merge feature XYZ"
---CONTEXT---
Merging feature branch with merge commit
---END---

Critical Rules

Plan First, Send Once

Before sending a git-request:, plan ALL operations in your head first. Think through the entire workflow — clone, branch, file creation, commit, push — and include everything in a SINGLE request. Do NOT send partial requests and iterate.

Bad (multiple requests, trial-and-error):

# Request 1: just clone
git-request: clone repo...
# Wait... then Request 2: create branch
git-request: checkout branch...
# Wait... then Request 3: add files and push
git-request: add, commit, push...

Good (one complete request):

git-request:
workspace: /root/agentteams-fs/shared/tasks/{task-id}/workspace
operations:
  - git clone /path/to/repo.git
  - cd repo && git config user.name "alice"
  - cd repo && git config user.email "alice@agentteams.local"
  - cd repo && git checkout -b feature/my-branch
  - mkdir -p repo/docs
  - 'cat > repo/docs/file.md << "EOF"
file content here
EOF'
  - cd repo && git add docs/file.md
  - cd repo && git commit -m "feat: add file"
  - cd repo && git push origin feature/my-branch
---CONTEXT---
Complete workflow: clone, branch, create file, commit, push
---END---

Wait Silently After Sending

After sending a git-request:, the Manager needs time to execute the operations. Do NOT:

  • Send follow-up messages asking "is it done?"
  • Send duplicate or revised git-request: messages
  • Try alternative approaches while waiting
  • Spawn subagents to work around the wait

Simply wait for the git-result: or git-failed: response. The Manager will reply when done.

Workspace Path Convention

Always use this path pattern:

/root/agentteams-fs/shared/tasks/{task-id}/workspace/{repo-name}
  • For git clone: set workspace to the parent directory (without repo name)
  • For all other operations: set workspace to the repo directory (with repo name)
  • Never use /tmp or other arbitrary paths — the Manager syncs via MinIO and needs the workspace under the shared tasks directory

Include Non-Git Commands When Needed

The operations list can include shell commands like mkdir -p, cat > file, cd dir && prefixes. This lets you do everything in one round-trip:

operations:
  - git clone https://github.com/org/repo.git
  - cd repo && git checkout -b feature/xyz
  - mkdir -p repo/src
  - 'cat > repo/src/main.py << "EOF"
print("hello")
EOF'
  - cd repo && git add .
  - cd repo && git commit -m "feat: add main"
  - cd repo && git push origin feature/xyz

Tips

  1. One request, all commands: Include clone, branch, file creation, commit, and push in a single request
  2. Provide context: Help the Manager understand what you're trying to accomplish
  3. Handle errors: If git-failed: is returned, read the error and send ONE corrected request
  4. Sync before and after: Always sync to/from MinIO when exchanging workspace with Manager
  5. Use github-operations for PRs: After pushing, use the MCP tools to create/manage PRs

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Find worker agents in Nacos that match a task, recommend candidates, and import the administrator's chosen worker. It also supports importing a specified nacos package URI, with worker name confirmation and direct reporting of installation failures.

中文简介正在准备中。当前显示英语简介。

  • Find a suitable worker for an unassigned task
  • Compare Nacos worker candidates before importing
  • Import a worker from a specified nacos package URI
agentscope-ai/AgentTeams58252026年10月17日 更新

Prepare an existing OpenClaw setup for import as an AgentTeams managed Worker. Analyze tool dependencies, adapt role instructions and scheduled jobs, and build a ZIP package containing the configuration and custom image requirements.

中文简介正在准备中。当前显示英语简介。

  • Moving standalone OpenClaw into AgentTeams
  • Reviewing required tool dependencies
  • Adapting role instructions for a Worker
agentscope-ai/AgentTeams58252026年10月17日 更新

Manage communication channels by identifying senders, maintaining trusted contacts, and setting the administrator's primary notification destination. It also covers first contact on a new channel and contacting the administrator across channels, with rules for handling unknown senders.

中文简介正在准备中。当前显示英语简介。

  • Identify who sent a message in a room
  • Add or remove trusted contacts
  • Configure the administrator's primary notification channel
agentscope-ai/AgentTeams58252026年10月17日 更新

Prepare coding tasks for delegation to an authorized agent’s AI command-line tool. Set up and synchronize the workspace, write precise change requests, then review returned changes and run relevant checks before reporting completion.

中文简介正在准备中。当前显示英语简介。

  • Delegating code implementation or bug fixes to an AI CLI
  • Writing coding requests with clear acceptance criteria
  • Reviewing and testing changes returned by a CLI
agentscope-ai/AgentTeams58252026年10月17日 更新

Run AI coding command-line tools on behalf of worker agents using their prepared prompts and workspaces. Detect available tools, configure delegation, return results, and apply supported execution controls such as time budgets and permission settings.

中文简介正在准备中。当前显示英语简介。

  • Running coding tools for worker agents
  • Detecting and selecting available coding CLIs
  • Setting Qwen Code permissions and time budgets
agentscope-ai/AgentTeams58252026年10月17日 更新

Guide agent replies in Matrix chat rooms, including when to mention a coordinator, report completion, raise blockers, or answer questions. The rules limit repetitive acknowledgments and stop exchanges that add no new task, question, or decision.

中文简介正在准备中。当前显示英语简介。

  • Reporting task completion to a coordinator
  • Raising blockers or questions that need action
  • Reducing repetitive acknowledgments
agentscope-ai/AgentTeams58252026年10月17日 更新

查看 agentscope-ai 的全部技能

报告此技能的问题