From emasoft-orchestrator-agent
Task distribution based on skills and availability. Use when assigning work to agents, balancing load, or resolving dependencies. Trigger with assignment requests.
npx claudepluginhub emasoft/emasoft-plugins --plugin emasoft-orchestrator-agentThis skill uses the workspace's default tool permissions.
This skill defines how the Orchestrator (EOA) distributes tasks to agents. Distribution is based on **order**, **priority**, and **agent state** - not arbitrary timing. Tasks are selected from the ready queue, sorted by priority, filtered by dependencies, matched to agent capabilities, and assigned via labeled issues and AI Maestro messages.
Distributes GitHub tasks to AI agents by priority, dependencies, availability, skills, and load using labels and AI Maestro messaging. For task assignment requests.
Decomposes complex tasks into parallel units, designs dependency graphs with blockedBy/blocks, and coordinates multi-agent teams via task descriptions and workload balancing. For agent workflows and progress monitoring.
Routes tasks to specialized AI agents with anti-duplication checks via task registry, quality gates, and 30-minute heartbeat monitoring. Use for coordinating 3+ agents on complex tasks.
Share bugs, ideas, or general feedback.
This skill defines how the Orchestrator (EOA) distributes tasks to agents. Distribution is based on order, priority, and agent state - not arbitrary timing. Tasks are selected from the ready queue, sorted by priority, filtered by dependencies, matched to agent capabilities, and assigned via labeled issues and AI Maestro messages.
gh) and AI Maestro APITasks are distributed following this order:
| Step | Action | Condition |
|---|---|---|
| 1 | Identify ready tasks | Tasks with status:ready label |
| 2 | Sort by priority | priority:critical > priority:high > priority:normal > priority:low |
| 3 | Check dependencies | Task's blockedBy list is empty |
| 4 | Select agent | Match task requirements to available agents |
| 5 | Assign task | Add assign:<agent> label, send AI Maestro message using the agent-messaging skill |
When selecting an agent for a task, evaluate in this order:
| State | Can Assign | Action |
|---|---|---|
| Active, no current task | Yes | Assign immediately |
| Active, has current task | Maybe | Check if at capacity |
| Hibernated | No | Wake first or select different agent |
| Offline | No | Select different agent |
Match task requirements (toolchain:*, component:* labels) to agent capabilities:
Task labels: toolchain:python, component:api
Agent skills: python, api, testing
Match score: 2/2 required = 100% match
| Agent Load | Can Assign |
|---|---|
| 0 active tasks | Yes |
| 1-2 active tasks | Yes, if high priority |
| 3+ active tasks | No, agent at capacity |
# Remove any existing assign:* label first
gh issue view $ISSUE --json labels | jq -r '.labels[].name' | grep '^assign:' | while read label; do
gh issue edit $ISSUE --remove-label "$label"
done
# Add new assignment
gh issue edit $ISSUE --add-label "assign:$AGENT_NAME"
# Update status
gh issue edit $ISSUE --remove-label "status:ready" --add-label "status:in-progress"
Use template from eoa-messaging-templates (section 2.1):
Note: Use the
agent-messagingskill to send messages. The JSON structure below shows the message content.
{
"from": "orchestrator",
"to": "<agent-name>",
"subject": "Task Assignment: <task-title>",
"priority": "high",
"content": {
"type": "request",
"message": "You are assigned: <task-description>. Success criteria: <criteria>. Report status when starting and when complete.",
"data": {
"task_id": "<task-id>",
"issue_number": "<github-issue-number>",
"handoff_doc": "docs_dev/handoffs/<handoff-filename>.md"
}
}
}
After sending assignment, wait for agent acknowledgment. See eoa-progress-monitoring for response handling.
| Type | Example | Handling |
|---|---|---|
| Hard | Module B needs Module A's API | Block B until A complete |
| Soft | Testing can start with stubs | Assign with note about dependency |
| None | Independent tasks | Assign in parallel |
Task A: status:in-progress, blocks: [B, C]
Task B: status:ready, blockedBy: [A] → Cannot assign yet
Task C: status:ready, blockedBy: [A] → Cannot assign yet
When Task A completes:
- Update A: status:done
- B and C become assignable
If detected, STOP and report to user:
CIRCULAR DEPENDENCY:
Task A → depends on → Task B
Task B → depends on → Task A
Cannot proceed. User decision required.
When multiple agents can handle a task:
Some tasks benefit from agent specialization:
| Task Type | Preferred Agent |
|---|---|
| Code review | Agent who wrote the code (context) |
| Bug fix | Agent who implemented feature |
| New feature | Agent with matching skills |
When reassigning a task (agent unresponsive or blocked):
assign:* labelassign:<new-agent> labelagent-messaging skill with contextCopy this checklist and track your progress:
assign:* label from the issueassign:<new-agent> label to the issueagent-messaging skill (include all task context and partial progress)If an agent reports that a distributed task is blocked, EOA must take IMMEDIATE action:
status:*, add status:blockedtype:blocker, referencing the blocked task). This makes the blocking problem visible to all agents and team members on the issue tracker. Example:
gh issue create --title "BLOCKER: Missing AWS credentials" --label "type:blocker" \
--body "Blocking task #42. Category: Access/Credentials. What's needed: AWS credentials provisioned."
Note: Use the
agent-messagingskill to send messages. The JSON structure below shows the message content.
{
"from": "eoa-orchestrator",
"to": "eama-assistant-manager",
"subject": "BLOCKER: Task #42 - Missing API Credentials",
"priority": "high",
"content": {
"type": "blocker-escalation",
"message": "Task #42 is blocked. Agent impl-01 reports: Cannot deploy to staging - missing AWS credentials. Blocker tracked in issue #99.",
"data": {
"task_id": "42",
"blocker_issue_number": "99",
"assigned_agent": "impl-01",
"blocker_category": "access-credentials",
"previous_status": "status:ai-review",
"impact": "Cannot complete deployment testing"
}
}
}
Before escalating, verify the blocker is REAL:
| Check | Question | Action if False |
|---|---|---|
| Cannot self-resolve | Can the agent solve this themselves? | Guide agent to solution, do not escalate |
| Not a knowledge gap | Is this a "how to" question? | Direct to documentation/skills, do not escalate |
| Not a process issue | Is this a team process the agent should follow? | Explain process, do not escalate |
| Truly blocking | Can work continue on other parts of the task? | Suggest parallel work, escalate only the blocking part |
Only escalate TRUE blockers that require user/architect intervention or resources the agent cannot access.
Copy this checklist and track your progress:
status:* label, add status:blockedPrevious status: $CURRENT_STATUS)type:blocker label, referencing the blocked task)agent-messaging skill (include blocker_issue_number)Copy this checklist and track your progress:
Previous status: ...)gh issue close $BLOCKER_ISSUE --comment "Resolved: [details]"status:blocked label from the taskstatus:in-progress, status:ai-review)Follow these steps to distribute tasks to agents:
status:ready labelassign:* label from the issueassign:<agent-name> label to the issuestatus:ready to status:in-progressagent-messaging skill (see section 3.2)Copy this checklist and track your progress:
Task Distribution Workflow:
status:ready labelassign:* label from the issueassign:<agent-name> label to the issuestatus:ready to status:in-progressagent-messaging skill| Output Type | Format | Example |
|---|---|---|
| Assignment confirmation | GitHub label + AI Maestro message | assign:implementer-1 label + ACK message received |
| Task queue report | Markdown table | List of ready tasks sorted by priority |
| Agent availability report | JSON | {"agent": "impl-01", "load": 1, "state": "active"} |
| Dependency graph | Text or diagram | Task A blocks [B, C], Task D ready |
| Delegation log entry | Timestamped text | 2024-01-15T10:30:00Z: Assigned #42 to implementer-1 |
| Error | Cause | Solution |
|---|---|---|
| No available agents | All agents at capacity or offline | Wait for agent capacity or escalate to user |
| Circular dependency detected | Task A blocks B, B blocks A | Report to user for manual resolution |
| Agent does not ACK assignment | Agent unresponsive or hibernated | Send reminder, then escalate to eoa-progress-monitoring |
| Skill mismatch | No agent has required toolchain | Escalate to user or reassign with training |
| Dependency never completes | Blocking task stuck | Escalate to eoa-progress-monitoring for blocker resolution |
| Label conflict (multiple assign:*) | Concurrent update | Remove all assign:* labels, reapply correct one |
# Get all ready tasks as JSON
gh issue list --label "status:ready" --json number,title,labels,createdAt | \
jq 'sort_by(
.labels[] | select(.name | startswith("priority:")) | .name |
if . == "priority:critical" then 0
elif . == "priority:high" then 1
elif . == "priority:normal" then 2
else 3 end
)'
Use the ai-maestro-agents-management skill to query agent availability:
implementer-1 to get their current task countISSUE=42
AGENT="implementer-1"
# 1. Remove existing assignment
gh issue view $ISSUE --json labels | jq -r '.labels[] | select(.name | startswith("assign:")) | .name' | \
xargs -I {} gh issue edit $ISSUE --remove-label "{}"
# 2. Add new assignment
gh issue edit $ISSUE --add-label "assign:$AGENT"
# 3. Update status
gh issue edit $ISSUE --remove-label "status:ready" --add-label "status:in-progress"
# 4. Send task assignment using the agent-messaging skill:
# - Recipient: $AGENT
# - Subject: "Task Assignment: Implement feature X"
# - Content: "You are assigned issue #$ISSUE. Success criteria: implement X, pass tests. Report when complete."
# - Type: request, Priority: high
# - Data: issue_number
# Verify: confirm message delivery
# Detect circular dependency
TASK_A_BLOCKS=$(gh issue view 10 --json body | jq -r '.body | match("blocks: \\[([0-9, ]+)\\]") | .captures[0].string')
TASK_B_BLOCKS=$(gh issue view 11 --json body | jq -r '.body | match("blocks: \\[([0-9, ]+)\\]") | .captures[0].string')
# If A blocks B and B blocks A:
if echo "$TASK_A_BLOCKS" | grep -q "11" && echo "$TASK_B_BLOCKS" | grep -q "10"; then
echo "CIRCULAR DEPENDENCY DETECTED: #10 ↔ #11"
echo "User intervention required to break cycle."
# Report to user via EAMA
fi