orchestration-protocol
Multi-agent orchestration patterns for delegation, coordination, and conflict resolution
What this skill does
# Orchestration Protocol
**Version:** 1.0.0
**Portability:** Medium
---
## Objective
Defines patterns for orchestrating multiple specialized agents in complex workflows, including delegation strategies, context provision, conflict resolution, and workflow state management.
**Purpose:** Enable coordinated multi-agent systems where a main orchestrator delegates to specialized agents while maintaining workflow integrity and clear responsibility boundaries.
**Scope:**
- **Included:** Delegation patterns, context provision, agent specialization, conflict resolution, workflow coordination
- **Excluded:** Specific agent implementations, tool-specific orchestration APIs
---
## Core Principles
### Principle 1: Orchestrator Delegates, Never Acts Directly
**The Principle:** The main orchestrator coordinates work by delegating to specialized agents but never performs specialized work itself.
**Why this matters:** Mixing orchestration logic with specialized work creates single points of failure and makes systems harder to maintain. Specialization enables focused expertise.
**How to apply:**
- Orchestrator decides WHAT to do and WHO should do it
- Specialized agents decide HOW to do their specific work
- Orchestrator never writes code, edits files, or performs domain-specific tasks
- All specialized work flows through appropriate agents
**Example:**
```
❌ Bad: Orchestrator writes test directly
Orchestrator: (uses Write tool to create test file)
✓ Good: Orchestrator delegates to test-writing agent
Orchestrator: Delegate to TestWriter agent with context:
"Create test for user authentication"
TestWriter: (writes test using domain knowledge)
```
### Principle 2: Fresh Context Per Agent (Zero Memory Assumption)
**The Principle:** Agents have zero context from the main conversation. Every delegation must include complete context.
**Why this matters:** Agents don't share conversation history. Assuming they know "what we discussed" leads to failures.
**What to provide:**
- File paths being modified
- Current state (what's passing/failing)
- Requirements (what "done" looks like)
- Domain constraints (types to use, patterns to follow)
- Error messages (exact text, not summaries)
**How to apply:**
```
❌ Bad: Vague delegation
"Continue where we left off"
"Fix the issue we discussed"
"You know what to do"
✓ Good: Complete context
"The test at `tests/auth_test.rs:45` fails with error: 'Email type not found'.
Create the Email type in `src/domain/types.rs` using newtype pattern.
Test expects: `Email::new(string) -> Result<Email, ValidationError>`"
```
**Template:**
```
WORKING_DIRECTORY: [Absolute path to project root]
TASK: [What to accomplish]
FILES: [Specific paths]
CURRENT STATE: [What exists, what's failing]
REQUIREMENTS: [Success criteria]
CONSTRAINTS: [Patterns to follow, types to use]
ERROR: [Exact error message if applicable]
```
### Principle 3: Workflow Gates Enforce Discipline
**The Principle:** Agents require explicit context confirmations before proceeding, preventing workflow step skipping.
**Why this matters:** Complex workflows have dependencies. Skipping steps (like domain review) leads to incomplete or incorrect work.
**Gate pattern:**
```
Agent checks for required context marker.
If missing → Reject with "GATE FAILED: Missing [context]"
If present → Proceed with work
```
**Example gates:**
```
Test-writing agent requires:
- Confirmation of acceptance criteria
- OR confirmation previous cycle completed
Implementation agent requires:
- Confirmation test exists and fails
- Confirmation domain review passed
Domain review agent requires:
- Confirmation of which phase is being reviewed (after test or after implementation)
```
**Benefits:**
- Prevents "quick fix" shortcuts
- Forces conscious workflow state tracking
- Makes workflow violations immediately visible
- Documents that required steps occurred
### Principle 4: Domain Expert Has Veto Power
**The Principle:** In multi-agent systems with domain modeling, the domain expert agent has veto authority over design decisions that violate domain principles.
**Why this matters:** Domain integrity is foundational. Compromising it for expediency creates technical debt that compounds.
**Domain veto authority covers:**
- Primitive obsession (String where Email type should exist)
- Invalid states representable (type allows impossible situations)
- Parse-don't-validate violations
- Domain boundary violations
**Resolution protocol:**
1. Domain raises concern
2. Affected agent responds with rationale
3. Orchestrator facilitates discussion
4. Seek compromise
5. If no consensus after 2 rounds → Escalate to user
**Example:**
```
TestWriter: Creates test using `String` for email parameter
↓
DomainReviewer: VETO - Primitive obsession. Use Email type.
↓
TestWriter: "Email type doesn't exist yet, using String for now"
↓
DomainReviewer: "That's why I review BEFORE implementation - so I can create Email type"
↓
Orchestrator: "DomainReviewer will create Email type, TestWriter will revise test to use it"
↓
TestWriter: Revises test with Email type
↓
DomainReviewer: Creates Email type
↓
Consensus reached, proceed
```
---
## Constraints and Boundaries
### DO (Orchestrator):
- Decide which agent handles which task
- Provide complete context to every agent
- Enforce workflow gates
- Facilitate agent conflicts
- Track workflow state
- Monitor for agent pause signals (questions, blockers)
- Ensure required confirmations before proceeding
### DON'T (Orchestrator):
- Perform specialized work (write code, edit files)
- Skip workflow steps ("just this once")
- Assume agents have context ("as we discussed")
- Override domain veto without user consultation
- Let agent debates drag (escalate after 2 rounds)
- Bypass gates ("I know this step isn't needed")
### DO (Specialized Agents):
- Focus on your specialty
- Validate input gates
- Provide clear output
- Signal when user input needed
- Raise concerns when design violates principles
- Document your decisions
### DON'T (Specialized Agents):
- Work outside your specialty
- Assume context from main conversation
- Proceed when gate validation fails
- Silently accept violations of your principles
**Rationale:** Clear boundaries prevent responsibility diffusion and maintain workflow integrity.
---
## Usage Patterns
### Pattern 1: Agent Specialization Hierarchy
**Scenario:** Multi-agent system needs clear responsibility boundaries.
**Specialization by concern:**
```
Orchestrator (coordinates)
├─ TestWriter (test files only)
├─ Implementer (production code only)
├─ DomainModeler (type definitions only)
├─ Reviewer (read-only analysis)
└─ ConfigManager (configuration files only)
```
**Delegation rules:**
- File pattern match → Appropriate agent
- Never multiple agents editing same file simultaneously
- Each agent has exclusive domain
- Orchestrator never bypasses agents
**Example:**
```
User request: "Add user authentication"
Orchestrator analysis:
- Needs: Test (TestWriter) + Types (DomainModeler) + Implementation (Implementer)
Orchestrator workflow:
1. Delegate to TestWriter: "Create failing test for authentication"
2. Wait for TestWriter completion
3. Delegate to DomainModeler: "Review test, create types"
4. Wait for DomainModeler completion
5. Delegate to Implementer: "Implement to pass test"
6. Wait for Implementer completion
7. Delegate to DomainModeler: "Review implementation"
8. Complete when DomainModeler approves
```
### Pattern 2: Workflow State Tracking
**Scenario:** Complex multi-step workflow needs state management.
**State markers:**
```
Workflow phases:
- Test: Not started | In progress | Failing (expected) | Passing | Approved
- Types: Not started | In progress | Created | Approved
- Implementation: Not started | In progress | Test passing | Approved
Current state determines next valid action.
```
**Gate enforcement:**
```python
def can_proceed_to_implementation(state):
return (
state.test == "FaRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.