跳到正文
cccskills
免费在 GitHub 公开

git-delegation-management

Let a Manager carry out Git operations for Workers that lack credentials. Structured requests specify the workspace and commands, while the workflow covers shared-file synchronization, processing markers to prevent conflicting edits, and success or failure reports.

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

原文查看原文说明

Execute git operations on behalf of Workers who don't have git credentials. Use when a Worker sends a git-request: message to clone, push, pull, commit, rebase, or perform any git operation.

查看安装方法

适用场景

  • Delegating clone and push operations for Workers without credentials
  • Requesting commits and branch operations
  • Coordinating Git work in a shared workspace
  • Reporting Git failures and required follow-up

包含的文件(1)

  • SKILL.md6.4 KB

SKILL.md(原文)

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

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 .gitconfig via /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 a properly formatted git-request: block (with workspace: and operations: fields), execute the requested operations.

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---
{description of what they're trying to accomplish}
---END---

Extract:

  • task-id: Task identifier
  • workspace: 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/agentteams-fs/shared/tasks/${task_id}/workspace/{repo-name}"

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

# Check for processing marker
bash /opt/agentteams/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/agentteams/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/agentteams/agent/skills/task-coordination/scripts/remove-processing-marker.sh "$task_id"

# Sync to MinIO
mc mirror "/root/agentteams-fs/shared/tasks/${task_id}/" \
  "${AGENTTEAMS_STORAGE_PREFIX}/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 `agentteams-sync` 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:

CategoryCommands
Repositorygit clone, git init
Branchesgit branch, git checkout, git switch
Remotegit remote, git fetch, git pull, git push
Commitsgit add, git commit, git reset, git revert
Historygit log, git show, git diff
Rebasegit rebase, git rebase -i
Cherry-pickgit cherry-pick
Mergegit merge
Stashgit stash
Tagsgit tag
Submodulesgit submodule
Configgit config (local to repo)

If git can do it, the Worker can delegate it.


Error Handling

When git operations fail:

  1. Read the error message and understand what went wrong
  2. Try to fix it if it's a simple issue (e.g., set upstream, configure user locally)
  3. Report to Worker if it requires their action (e.g., merge conflicts, rebasing decisions)
  4. 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/.gitconfig and 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.


Gotchas

  • Wait for the actual git-request: block — if a Worker says "Let me prepare the git-request" or "I'll delegate git operations", that is a preview, not a request. Do NOT execute any git operations until you receive a message with the structured workspace: + operations: fields.
  • Execute git-request immediately when received — when a message contains git-request: with workspace: and operations: fields, you MUST execute the git commands yourself and reply with git-result:. Workers cannot run git operations — that's why they delegated to you. Never "wait for the Worker to complete" after receiving a git-request; the Worker is waiting for YOUR git-result.
  • Duplicate git-request after you already executed — if you already completed the git operations for a task and the Worker sends a git-request: for the same operations, reply with git-result: confirming the operations were already completed. Do not re-execute or re-verify the repo state.
  • Ignore superseded requests — if a Worker sends multiple git-request: messages for the same task before you respond, only execute the LAST one (it is the most complete). Earlier requests were likely incomplete or had wrong paths.
  • Never delete or overwrite the remote repo — the remote URL (bare repo or GitHub) is shared across phases and Workers. Never rm -rf a remote path, never git init --bare over an existing repo.
  • git-result is not task completion — after sending git-result:, the Worker still needs to verify the outcome and report completion (e.g., PHASE_DONE). Do NOT treat a successful git-result as the Worker's task completion signal. Wait for the Worker's explicit completion report before advancing to the next phase.

评价

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

评论

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

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

提交后会立即公开。请勿填写邮箱、电话等个人信息。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/AgentTeams57862026年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/AgentTeams57862026年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/AgentTeams57862026年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/AgentTeams57862026年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/AgentTeams57862026年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/AgentTeams57862026年10月17日 更新

查看 agentscope-ai 的全部技能

报告此技能的问题