# Task Coordination

Coordinate access to shared task directories using .processing marker files.

- Repository: https://github.com/agentscope-ai/AgentTeams (5913 stars)
- Category: Engineering
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add agentscope-ai/AgentTeams --skill task-coordination -g -a claude-code -y`
Codex: `npx skills add agentscope-ai/AgentTeams --skill task-coordination -g -a codex -y`
Cursor: `npx skills add agentscope-ai/AgentTeams --skill task-coordination -g -a cursor -y`
Gemini CLI: `npx skills add agentscope-ai/AgentTeams --skill task-coordination -g -a gemini-cli -y`

## Description

Coordinate access to shared task directories using .processing marker files. Use before accessing a Worker's workspace to prevent conflicts when both Manager and Worker might modify files simultaneously.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Task Coordination

This skill provides a general coordination mechanism for shared task directories. It prevents conflicts when both Manager and Workers need to access/modify the same task workspace.

## Problem

When a Worker delegates work to Manager (e.g., git operations), the Manager modifies the Worker's workspace. During this time, the Worker might also be modifying files, causing potential conflicts.

## Solution

Use `.processing` marker files to signal "work in progress". Any party (Worker or Manager) must check for this marker before modifying a task directory.

---

## Task Directory Structure

```
tasks/{task-id}/
├── workspace/          # Code workspace (shared between Worker and Manager)
├── notes/              # Worker's notes, plan.md, memory (not synced by Manager)
├── meta.json           # Task metadata
└── .processing         # Processing marker file (created when work in progress)
```

---

## The `.processing` Marker

### Format

Location: `tasks/{task-id}/.processing`

```json
{
  "processor": "manager",
  "started_at": "2026-02-25T10:30:00Z",
  "expires_at": "2026-02-25T10:45:00Z",
  "operation": "git-delegation"
}
```

### Fields

| Field | Description |
|-------|-------------|
| `processor` | Who is processing: `manager` or worker name |
| `started_at` | ISO 8601 timestamp when processing started |
| `expires_at` | ISO 8601 timestamp when marker expires (15 min default) |
| `operation` | What operation is in progress (optional) |
| `run_id` | Optional unique identifier for your current operation; coding CLI execution requires it to match before passing through an active marker |

### Expiration

The marker auto-expires after 15 minutes (configurable). This prevents deadlocks if a process crashes without removing the marker.

---

## Coordination Protocol

### Before Modifying Task Directory

**Always follow this sequence:**

The rest: https://github.com/agentscope-ai/AgentTeams/blob/HEAD/manager/agent/skills/task-coordination/SKILL.md
