mayor-worker-pattern

Coordinate multiple autonomous agents with a Mayor-Worker hierarchy and ledger-based task handoffs.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Jtapias92672/OneDrive_1_1-19-2026-2 --skill mayor-worker-pattern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mayor-worker-pattern
Source: https://github.com/Jtapias92672/OneDrive_1_1-19-2026-2/tree/main/mcp-gateway/.forge/skills/mayor-worker-pattern
Command: npx skills add https://github.com/Jtapias92672/OneDrive_1_1-19-2026-2 --skill mayor-worker-pattern

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Mayor-Worker pattern solves coordination collapse in large multi-agent systems by clearly separating planning (Mayor) from execution (Workers), ensuring isolated tasks and controlled information flow.

Core Features & Use Cases

  • Two-tier architecture: Mayor coordinates work at a global level while workers execute single tasks in isolated environments.
  • Fault isolation: Workers are ephemeral and stateless, reducing cross-task contamination and simplifying recovery.
  • Controlled coordination: External ledger-based handoff ensures traceability and prevents direct inter-worker communication.
  • Use Case: Deploy this pattern when orchestrating 3+ agents on related projects to improve reliability and scalability.

Quick Start

Set up a Mayor-Worker pattern with a Mayor dispatching a single worker task and monitoring the ledger for results.

Frequently Asked Questions about mayor-worker-pattern

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent coordination collapse when orchestrating multiple autonomous agents?

Prevent coordination collapse in multi-agent orchestration by separating planning from execution. A central Mayor creates isolated tasks for ephemeral workers, using a ledger for controlled handoffs to ensure reliable, scalable collaboration.

How does a ledger-based task handoff work in multi-agent systems?

Ledger-based task handoff works by recording task assignments and results externally rather than allowing direct inter-worker communication. This controlled coordination ensures traceability and prevents cross-task contamination in multi-agent orchestration.

How do I isolate tasks to prevent cross-contamination in large multi-agent systems?

Isolate tasks by making workers ephemeral and stateless, executing one task at a time. This two-tier architecture reduces cross-task contamination and simplifies recovery during large-scale multi-agent orchestration.

Can I use this multi-agent orchestration pattern for a small number of agents?

This multi-agent orchestration pattern is designed for orchestrating three or more agents on related projects. Deploying it at a smaller scale may introduce unnecessary hierarchical overhead without yielding significant reliability improvements.

What is the best way to scale agent orchestration for related projects?

The best way to scale agent orchestration is implementing a strict Mayor-Worker hierarchy. A central Mayor coordinates global work while isolated, stateless workers execute single tasks, enabling controlled and scalable collaboration.

Why does direct inter-worker communication cause failures in multi-agent orchestration?

Direct inter-worker communication causes failures by creating uncontrolled dependencies and cross-task contamination. The Mayor-Worker pattern enforces isolation by routing all task coordination through an external ledger.