Complex workflows crash single-agent systems. Multi-Agent Orchestration distributes the cognitive load by dividing a task among specialized agents (e.g. Researcher, Coder, Reviewer). Prompting a multi-agent system means defining not just individual roles, but the communication protocol, state machine, and handoff contracts between them.
02 Weak vs. Strong
EX 01Software Developer Workflow Spec
AGENT_PLAN:
1. [Architect] Propose file structure and database schema in JSON.
2. [Coder] Read the schema, write the Python code. Wrap code in ```python blocks.
3. [Tester] Execute the code in a sandbox. Return stdout, stderr, and exit code.
4. [Coder] If exit code != 0, read stderr and rewrite the code. Repeat up to 3 times.
CODER_SYSTEM_PROMPT:
You are the Coder. Your only job is to write Python code based on the Architect's JSON spec.
Input: { 'spec': {...}, 'prior_errors': [...] }
Output: Write ONLY valid python code. No explanations.
TESTER_PROTOCOL:
Input: {{coder_output}}
Action: Execute script in sandbox.
Output format:
Exit Code: [0 or 1]
Stdout: [console output]
Stderr: [compiler/execution errors]
→ Why it works
Specializes roles and automates verification. Instead of hoping the model writes perfect code on the first try, a specialized Tester agent/code verifies the output and drives a closed feedback loop.
EX 02Content Editing Quality Loop
WRITER_PROMPT:
You are the Writer. Write a 100-word post explaining prompt compilers. Format as plain Markdown.
EDITOR_PROMPT:
You are the Editor. Review the Writer's draft against these criteria:
1. Word count under 120 words.
2. No business buzzwords (e.g., 'leverage', 'synergy').
Output format:
Status: [APPROVED or REJECTED]
Feedback: [Constructive notes if rejected, else blank]
LOOP:
1. Writer drafts content.
2. Editor evaluates. If REJECTED, send Feedback to Writer to edit. Limit: 3 attempts.
→ Why it works
Distributing generation and evaluation between two separate agent personas prevents the model from ignoring its own rules due to confirmation bias.
03 Key Points
01Division of labor: smaller, focused system prompts improve model performance and reduce token usage.
02Handoff protocols: define the exact input/output format agents must use to communicate with each other.
03State transitions: control the execution flow deterministically via code or router agents.
05Shared memory: manage a global state or message history that agents can access as needed.
04 Model-Specific Notes
Claude's high reasoning makes it an excellent Architect or Reviewer. Use Sonnet/Opus for planning/review, and Haiku for fast, repetitive execution sub-agents.
05 For Your Role
It's like a software company. You don't hire one person to do design, coding, testing, and sales. You hire specialists and set up meetings (handoffs) between them.