agent-task-delegation

agent-task-delegation is a skill for Claude Code, Codex from cosmicstack-labs/mercury-agent-skills. It costs 39 tokens per session (2,964 once invoked), scanned A, original, MIT.

Guidance for distributing work across multiple AI agents, where each agent is software assigned to handle tasks. It covers routing, queues, priorities, workload balancing, handling overload, and adding or removing agent capacity.

In plain words
What is it for?
It is for building work queues, choosing agents by task type, scheduling urgent work, balancing active tasks, managing backpressure, and coordinating complex workflows.
Why use it?
It helps prevent tasks from going to the wrong agent or piling up unevenly when many agents work at the same time.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for building work queues, choosing agents by task type, scheduling urgent work, balancing active tasks, managing backpressure, and coordinating complex workflows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cosmicstack-labs/mercury-agent-skills/agent-task-delegation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cosmicstack-labs/mercury-agent-skills --skill agent-task-delegation
Clone the repo
git clone --depth 1 https://github.com/cosmicstack-labs/mercury-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-task-delegation

README.md
[![agentmods](https://agentmods.dev/badge/skills/cosmicstack-labs/mercury-agent-skills/agent-task-delegation/github.svg)](https://agentmods.dev/skills/cosmicstack-labs/mercury-agent-skills/agent-task-delegation)
Your own site
<a href="https://agentmods.dev/skills/cosmicstack-labs/mercury-agent-skills/agent-task-delegation"><img src="https://agentmods.dev/badge/skills/cosmicstack-labs/mercury-agent-skills/agent-task-delegation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agent-task-delegation

Your own site · 80×15
<a href="https://agentmods.dev/skills/cosmicstack-labs/mercury-agent-skills/agent-task-delegation"><img src="https://agentmods.dev/badge/skills/cosmicstack-labs/mercury-agent-skills/agent-task-delegation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,964 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 93
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.02964
Opus 5.5 $0.00016 $0.01186
Sonnet 5.5 $0.00008 $0.00593
Haiku 4.5 $0.00004 $0.00296

Measured 3mo ago against content hash 8bd9164b7fb7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

agent-task-delegation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

categories/ai-ml/agent-task-delegation/SKILL.md · 381 lines

How it starts

The opening of the file, as written. The whole thing — 381 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Task Delegation & Load Balancing

Overview

A multi-agent system without delegation logic is a mob, not a team. Tasks must be routed to the right agent, prioritized correctly, and balanced across available capacity. This skill covers queue-based architectures, routing strategies, backpressure handling, and dynamic scaling for production agent workloads.


Core Concepts

Delegation Models

Model Description Best For
Direct Assignment Task is routed to a specific agent by name Known, fixed responsibilities
Work Queue Tasks go into a queue; agents pull when ready Variable workloads, many agents
Router Classifier decides which agent handles each task Heterogeneous task types
Supervisor Orchestrator delegates and synthesizes Complex multi-step workflows
Broadcast All agents receive task; first responder claims it Redundancy, SLA-critical tasks

Load Balancing Strategies

Strategy Algorithm When to Use
Round Robin Cycle through agents in order Identical agents, uniform tasks
Least Connections Assign to agent with fewest active tasks Variable task duration
Weighted Based on agent capacity/priority Heterogeneous agent capabilities
Consistent Hashing Hash task → agent (deterministic) Session affinity, cache locality
Latency-Based Route to fastest available agent Performance-sensitive tasks
Random Pick agent at random Simple, symmetrical setups

Step-by-Step Implementation

Step 1: Build the Task Queue

from dataclasses import dataclass
from enum import Enum
import asyncio
import time

class Priority(Enum):
    CRITICAL = 0
    HIGH = 1
    MEDIUM = 2
    LOW = 3

@dataclass
class Task:
    id: str
    agent_type: str
    payload: dict
    priority: Priority = Priority.MEDIUM
    created_at: float = None
    timeout: int = 30
    retry_count: int = 0
    max_retries: int = 3
    
    def __post_init__(self):
        if self.created_at is None:
            self.created_at = time.time()

class TaskQueue:
    """Priority-based task queue with timeout handling."""
    
    def __init__(self):
        self.queues = {
            Priority.CRITICAL: asyncio.Queue(),
            Priority.HIGH: asyncio.Queue(),
            Priority.MEDIUM: asyncio.Queue(),
            Priority.LOW: asyncio.Queue(),
        }
    
    async def enqueue(self, task: Task):
        """Add task to the appropriate priority queue."""
        await self.queues[task.priority].put(task)
    
    async def dequeue(self) -> Task:
        """Get the highest-priority available task."""
        for priority in sorted([p for p in Priority]):
            queue = self.queues[priority]
            if not queue.empty():
                task = await queue.get()
                # Check if task has expired
                if time.time() - task.created_at > task.timeout:
                    return await self.dequeue()  # Skip expired task
                return task
        
        return None  # All queues empty

Read the full file on GitHub · 381 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 381 lines · 39 tokens per session scan A 8bd9164b7fb7

Subscribe to this mod's changes

agent-task-delegation is a skill published in the GitHub repository cosmicstack-labs/mercury-agent-skills (496 stars, last pushed 3mo ago), licensed MIT. It adds 39 tokens to every session and 2,964 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

agent-task-delegation compared with skills from other repositories

agent-task-delegation next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
agent-task-delegationcosmicstack-labs/mercury-agent-skillsSkill4963mo agoMITA39Claude Code, Codex
modern-saas-builderlijnati/modern-saas-builder-skillsSkill21mo agoMITA98Claude Code
agent-platform-model-registrygoogle/skillsSkill25ktodayApache-2.0A60Claude Code, Codex
google-cloud-solution-agentic-analytics-spark-knowledge-cataloggoogle/skillsSkill25ktodayApache-2.0A132Claude Code, Codex
viteantfu/skillsSkill6.1k6d agoMITA49Claude Code, Codex
add-analyticsLeoYeAI/openclaw-master-skillsSkill2.2k11d agoMITA32Claude Code
twitter-readerhimself65/finance-skillsSkill3.6k29d agoMITA110Claude Code