Course/Build/Lesson 3

Lesson 2.3: Multi-Agent Coordination

Duration: 60 min

Learning Objectives

  • Design workflows where skills and agents collaborate
  • Orchestrate multi-step automated processes
  • Handle handoffs between automation components
🎯 What You'll Learn: How to orchestrate multiple agents working together on complex tasks
⏱️ Time Required: 60 minutes
πŸ“¦ What You'll Build: A coordinated workflow with 2+ agents (builder + reviewer pattern)

Riley's Journey Continues

Riley now has her weekly-margin-report skill AND her position-risk-analyzer agent. Both work beautifully on their own.

But she noticed something interesting last Monday.

πŸ’¬ "I ran my margin report skill, got the list of at-risk positions, then manually copied that into my risk analyzer agent. It worked, but I thought... why am I the middleman here? What if they could work together automatically?"
β€” Riley Harper

Where Riley is now:

  • βœ… weekly-margin-report skill - generates Monday reports
  • βœ… position-risk-analyzer agent - analyzes why positions are at risk
  • 🎯 Ready to connect them into a coordinated workflow
  • By the end of this lesson:

  • πŸ”— Riley's agents will work together seamlessly
  • πŸ“‹ She'll understand coordination patterns
  • ⚑ Her Monday workflow will be fully automated

  • What We're Building in This Lesson

    Individual agents are specialists. Coordinated agents are a high-performing team. The magic happens when they hand off work to each other.

    In this lesson:

  • Why coordination matters (Riley's "middleman" problem)
  • Three coordination patterns
  • The Builder + Reviewer pattern in depth
  • Live demo: Connecting Riley's skill and agent
  • When to use which pattern

  • Key Concept: Coordination Patterns

    Pattern 1: Sequential (Pipeline)

    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ Agent A  β”‚ ──▢ β”‚ Agent B  β”‚ ──▢ β”‚ Agent C  β”‚
    β”‚ (Gather) β”‚     β”‚ (Analyze)β”‚     β”‚ (Report) β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    

    When to use: Tasks with clear stages where each stage builds on the previous.

    Example: Data gathering β†’ Analysis β†’ Report generation

    Riley's use: margin report β†’ Risk analysis β†’ Executive summary


    Pattern 2: Parallel (Fan-out)

                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”Œβ”€β”€β–Ά β”‚ Agent A  β”‚
                β”‚    β”‚(Research)β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”‚ Coordinatorβ”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚          β”‚β”œβ”€β”€β–Ά β”‚ Agent B  β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚    β”‚(Analysis)β”‚
                β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                └──▢ β”‚ Agent C  β”‚
                     β”‚(Validate)β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    

    When to use: Independent tasks that can run simultaneously.

    Example: Research competitors A, B, and C at the same time.

    Riley's use: Analyze multiple at-risk positions in parallel.


    Pattern 3: Builder + Reviewer

    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ Builder  β”‚ ──▢ β”‚ Reviewer β”‚ ──▢ β”‚  Final   β”‚
    β”‚ Agent    β”‚     β”‚ Agent    β”‚     β”‚  Output  β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β–²                β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             (Revisions if needed)
    

    When to use: Quality matters and you want a second opinion.

    Example: Draft report β†’ Quality review β†’ Final report

    Riley's use: Generate analysis β†’ Validate recommendations β†’ Deliver


    Which Pattern for What?

    PatternBest ForRiley's Example
    SequentialMulti-stage processesData β†’ Analysis β†’ Report
    ParallelIndependent similar tasksAnalyze 5 positions simultaneously
    Builder + ReviewerQuality-critical outputAnalysis β†’ Validation

    Exercise: Build a Coordinated Workflow

    ⏱️ Total Time: 50 minutes

    What You'll Build

    πŸ”— A multi-agent workflow using the Sequential pattern, connecting your existing skill/agent OR building a new Builder + Reviewer pair.


    Step 1: Choose Your Coordination Pattern

    ⏱️ Time: 5 minutes

    What you're doing:

    Deciding which pattern fits your workflow best.

    Decision Guide:

    Your SituationPatternExample
    "I have multiple stages"SequentialReport β†’ Analysis β†’ Summary
    "I have similar independent tasks"ParallelAnalyze multiple items
    "Quality is critical"Builder + ReviewerDraft β†’ Review β†’ Final

    Riley's Choice:

    πŸ’¬ "My Monday workflow has clear stages: generate margin report, identify at-risk positions, analyze those positions, create action summary. That's a Sequential pattern with 3 agents/skills working together."

    Your choice: ________________

    βœ… Success Check:

    Identified which pattern fits your needs
    Can explain why this pattern is right

    Step 2: Create a Coordinator Skill

    ⏱️ Time: 15 minutes

    What you're doing:

    Building a skill that orchestrates your agents in sequence.

    Why a skill, not an agent?

    The coordinator follows a repeatable process (skill behavior) but delegates complex analysis to agents. It's the project manager, not the specialist.

    Create the coordinator:

    mkdir -p .claude/skills/margin-workflow-coordinator
    touch .claude/skills/margin-workflow-coordinator/SKILL.md
    

    Riley's Coordinator Skill:

    ---
    name: margin-workflow-coordinator
    description: Orchestrates the complete Monday morning workflow - generates margin report, analyses at-risk positions, creates executive summary. Use every Monday morning for the full margin review.
    author: Riley Harper
    version: 1.0
    ---
    
    # Monday Margin Workflow Coordinator
    
    ## Overview
    This skill coordinates the complete Monday morning margin workflow by orchestrating multiple agents and skills in sequence. It acts as the project manager ensuring each stage completes before the next begins.
    
    ## When to Use
    - Every Monday morning for the complete margin review
    - When the Head of Risk Operations asks for "the full picture"
    - When you need report + analysis + recommendations in one package
    
    ## Workflow Stages
    
    ### Stage 1: Generate margin report
    **Invoke:** `weekly-margin-report` skill
    **Input:** Current week's Prime Broker portal data
    **Output:** Formatted margin report with at-risk positions flagged
    **Pass to Stage 2:** List of at-risk positions
    
    ### Stage 2: Deep Risk Analysis
    **Invoke:** `position-risk-analyzer` agent
    **Input:** Each at-risk position from Stage 1
    **Output:** Root cause analysis and recommendations for each position
    **Pass to Stage 3:** Analyzed positions with action plans
    
    ### Stage 3: Executive Summary
    **Generate:** Consolidated summary with:
    - Portfolio risk overview (from Stage 1)
    - At-risk position count and total exposure
    - Top 3 priority actions (from Stage 2)
    - Recommended focus for the week
    
    ## Process
    
    When the user asks for the Monday margin workflow:
    
    1. **Acknowledge and set expectations**
       "Starting your Monday margin workflow. This will generate your margin report, analyse at-risk positions, and create an executive summary."
    
    2. **Execute Stage 1: margin report**
       - Use the weekly-margin-report skill
       - Identify all positions flagged as at-risk
       - Note: If user hasn't provided Prime Broker portal data, ask for it
    
    3. **Execute Stage 2: Risk Analysis**
       - For EACH at-risk position identified in Stage 1
       - Call the position-risk-analyzer agent
       - Collect all analysis results
    
    4. **Execute Stage 3: Executive Summary**
       - Synthesise findings from Stages 1 and 2
       - Create prioritised action list
       - Format for Head of Risk Operations (Marcus Webb)
    
    5. **Deliver complete package**
       - Present all three outputs
       - Highlight the top 3 actions for the week
       - Offer to dive deeper into any specific position
    
    ## Output Format
    
    ### Monday Margin Review - [Date]
    
    ---
    
    **πŸ“Š MARGIN REPORT**
    [Output from Stage 1 - weekly-margin-report skill]
    
    ---
    
    **πŸ” AT-RISK POSITION ANALYSIS**
    [Output from Stage 2 - position-risk-analyzer agent for each at-risk position]
    
    ---
    
    **πŸ“‹ EXECUTIVE SUMMARY**
    
    **Portfolio Status:** [Green/Amber/Red]
    **At-risk positions:** [X] positions, total exposure Β£[Y]
    **Exposure Impact:** [Z]% of portfolio exposure currently on Watch or above
    
    **Top 3 Actions This Week:**
    1. [Most urgent action] - Owner: [Name] - Deadline: [Date]
    2. [Second priority] - Owner: [Name] - Deadline: [Date]
    3. [Third priority] - Owner: [Name] - Deadline: [Date]
    
    **Focus Recommendation:**
    [1-2 sentence strategic guidance for the week]
    
    ---
    
    ## Example
    
    **User:** "Run my Monday margin workflow"
    
    **Coordinator Response:**
    
    "Starting your Monday margin workflow. This will:
    1. Generate your margin report
    2. Analyse any at-risk positions
    3. Create your executive summary
    
    I'll need your Prime Broker portal export if you have it, or I can work with the data you provide."
    
    [User provides data]
    
    "Perfect. Running Stage 1: margin report..."
    [Generates report, identifies 5 at-risk positions]
    
    "Found 5 at-risk positions. Running Stage 2: Deep analysis on each..."
    [Calls position-risk-analyzer for each position]
    
    "Analysis complete. Creating Stage 3: Executive Summary..."
    [Generates executive summary]
    
    "Your Monday Margin Review is ready."
    [Presents complete output]
    

    Your Coordinator Skill:

    Adapt Riley's template for your workflow:

    ---
    name: your-coordinator-name
    description: Orchestrates [your workflow]. Use when [trigger].
    author: Your Name
    version: 1.0
    ---
    
    # [Your Coordinator Name]
    
    ## Overview
    [What this coordinator does]
    
    ## Workflow Stages
    
    ### Stage 1: [First Stage]
    **Invoke:** [skill or agent name]
    **Input:** [what it needs]
    **Output:** [what it produces]
    **Pass to Stage 2:** [what transfers]
    
    ### Stage 2: [Second Stage]
    **Invoke:** [skill or agent name]
    **Input:** [from Stage 1]
    **Output:** [what it produces]
    **Pass to Stage 3:** [what transfers]
    
    ### Stage 3: [Final Stage]
    **Generate:** [final deliverable]
    
    ## Process
    
    [Step-by-step coordination instructions]
    
    ## Output Format
    
    [What the final package looks like]
    

    βœ… Success Check:

    Coordinator skill created
    All stages clearly defined
    Handoffs between stages specified
    Final output format documented

    Step 3: Create a Reviewer Agent (Optional but Recommended)

    ⏱️ Time: 15 minutes

    What you're doing:

    Adding quality control to your workflow with a reviewer agent.

    Riley's Reviewer Agent:

    ---
    name: margin-report-validator
    description: Reviews the Monday margin report analysis for quality, completeness, and accuracy before delivery to the Head of Risk Operations.
    author: Riley Harper
    version: 1.0
    ---
    
    # Margin Report Validator
    
    ## Role
    
    You are a quality assurance specialist for risk operations reports. You think like the Head of Risk Operations who will receive this report β€” demanding accuracy, completeness, and clear escalation guidance.
    
    Your job is to ensure:
    - Analysis is complete and logically sound
    - Recommendations are specific and actionable
    - Escalation flags are clearly marked
    - The report is ready for executive consumption
    
    You are NOT:
    - Re-doing the analysis (that's already done)
    - Adding your own risk opinions about positions
    - Being overly critical β€” focus on material issues
    
    ## Mission
    
    Review the complete margin report package and identify any issues before it goes to the Head of Risk Operations. Flag problems, suggest improvements, and ultimately approve or request revisions.
    
    ## Review Checklist
    
    ### Completeness Check
    - [ ] All at-risk positions have been analyzed
    - [ ] Each position has a root cause identified
    - [ ] Each position has a specific action recommendation
    - [ ] Executive summary reflects all findings
    
    ### Quality Check
    - [ ] Recommendations are SPECIFIC (not "follow up" but "call John to discuss budget timeline")
    - [ ] Owners are assigned to each action
    - [ ] Deadlines are realistic and clear
    - [ ] Analysis matches the data presented
    
    ### Executive Readiness Check
    - [ ] Can be understood in 2-minute scan
    - [ ] Top 3 priorities are clear
    - [ ] Numbers add up correctly
    - [ ] No jargon without explanation
    
    ## Output Format
    
    ### Review Result
    
    **Status:** βœ… APPROVED / ⚠️ NEEDS REVISION / πŸ”΄ MAJOR ISSUES
    
    **Completeness:** [Complete/Missing items]
    **Quality:** [High/Medium/Needs improvement]
    **Executive Ready:** [Yes/Almost/No]
    
    **Issues Found:**
    1. [Issue and suggested fix]
    2. [Issue and suggested fix]
    
    **Recommendation:**
    [Approve and send / Make these changes first]
    

    Why add a reviewer?

    πŸ’¬ "The first time my coordinator ran without a reviewer, it missed that two positions had the same recommended action owner - and that person was on vacation! The reviewer catches things like that."
    β€” Riley Harper

    βœ… Success Check:

    Reviewer agent created (if using Builder + Reviewer pattern)
    Review criteria are specific
    Can approve, request changes, or flag issues

    Step 4: Test Your Coordinated Workflow

    ⏱️ Time: 15 minutes

    What you're doing:

    Running the full coordinated workflow and verifying handoffs work.

    Test Command:

    /clear
    
    # If you have a coordinator skill:
    Run my Monday margin workflow
    
    # Or manually orchestrate:
    1. First: /weekly-margin-report
    2. Then: ask Claude to use the position-risk-analyzer on the output from step 1
    3. Finally: ask Claude to use the margin-report-validator on the output from step 2
    

    What to verify:

    StageCheck For
    Stage 1Output is complete, at-risk positions identified
    Handoff 1β†’2All at-risk positions passed to analyzer
    Stage 2Each at-risk position has analysis and recommendations
    Handoff 2β†’3Analysis passed to validator (if using)
    Stage 3Final output includes all stages

    Riley's Test Results:

    πŸ’¬ "First full test took about 3 minutes for 5 at-risk positions. Used to take me 2+ hours. The handoffs worked perfectly - each stage got exactly what it needed from the previous one."

    Common Coordination Issues:

    ProblemFix
    Stage 2 missing some itemsAdd explicit "For EACH item" in Stage 1 output
    Duplicate analysisCheck if positions are being passed multiple times
    Final summary incompleteEnsure coordinator references ALL previous outputs
    Reviewer too harshAdjust reviewer to focus on material issues only

    βœ… Success Check:

    All stages execute in order
    Handoffs pass complete information
    Final output includes all components
    Quality is production-ready

    Advanced: Parallel Execution

    ⏱️ Time: (Optional - 5 minutes to understand)

    If you have multiple similar items to analyze, you can run agents in parallel:

    In your coordinator, specify:

    ### Stage 2: Deep Risk Analysis (PARALLEL)
    For positions: Position A, Position B, Position C, Position D, Position E
    
    Run `position-risk-analyzer` agent on ALL positions simultaneously.
    Do not wait for one to finish before starting the next.
    
    Collect all results before proceeding to Stage 3.
    

    When Claude sees this:

  • It will invoke the agent for each position
  • Results come back as they complete
  • All are collected before Stage 3 begins
  • πŸ’¬ "Parallel execution cut my 5-position analysis from 3 minutes to about 1 minute. When you have 10+ at-risk positions, it makes a huge difference."
    β€” Riley Harper

    Overall Success Criteria

    By the end of this lesson, you should have:

    🎯 Chosen appropriate coordination pattern
    πŸ“‹ Created coordinator skill with defined stages
    πŸ”— Specified clear handoffs between stages
    πŸ” (Optional) Added reviewer agent for quality
    βœ… Tested complete workflow end-to-end

    Quick Test:

  • Start fresh: /clear
  • Run your coordinator: [your trigger phrase]
  • Verify all stages execute
  • Check final output has all components

  • Troubleshooting


    πŸ”„ "Stages aren't running in order"

    **Why this happens:** Coordinator instructions not explicit enough.

    **Fix:** Add explicit sequencing language:

    1. FIRST, run Stage 1 and wait for complete output
    2. ONLY AFTER Stage 1 completes, run Stage 2
    3. ONLY AFTER Stage 2 completes, run Stage 3
    


    πŸ“€ "Information lost between stages"

    **Why this happens:** Handoffs not specified clearly.

    **Fix:** Explicitly state what passes between stages:

    **Pass to Stage 2:**
    - List of counterparty positions flagged as at-risk
    - Net exposure values and limit utilisation
    - Current risk status (Watch/Restricted/Breached)
    - Open margin call details (age, amount, status)
    


    ⏱️ "Workflow takes too long"

    **Why this happens:** Sequential when parallel would work.

    **Fix:** Identify independent tasks that can run simultaneously. If analysing 5 at-risk positions, all 5 can be analysed in parallel since they don't depend on each other.


    πŸ” "Stuck in revision loop"

    **Why this happens:** Reviewer is too strict.

    **Fix:** Add limits to reviewer:

    - Maximum 2 revision rounds
    - Only flag MATERIAL issues (affects decisions, not formatting)
    - If issues are minor, approve with notes rather than rejecting
    


    You Did It!

    You just built a coordinated multi-agent workflow!

    What Riley accomplished:

    πŸ’¬ "This is the moment it clicked for me. I'm not just automating tasks - I'm building a TEAM that works together. My Monday morning went from 5 hours of work to 10 minutes of review. The agents do the work, I just approve and send."

    The transformation:

    BeforeAfter
    πŸ• 5 hours manual work⏱️ 10 minutes review
    πŸƒ Riley as middlemanπŸ€– Agents hand off automatically
    πŸ” One perspectiveπŸ‘₯ Multiple specialist perspectives
    😰 Rushed, might miss thingsβœ… Systematic, nothing missed

    Riley's complete Monday workflow:

    margin report (Skill)
        β†’ Risk Analysis (Agent, parallel for each position)
            β†’ Quality Review (Agent)
                β†’ Executive Summary (Coordinator)
                    β†’ Riley reviews & sends
    

    Time: 5 hours β†’ 10 minutes

    Annual savings: 250+ hours = Β£18,750

    (Module 1 skill saved 3 hours 42 minutes = Β£13,875. The full skill + agent + coordinator stack adds the manual analysis time on top, total Monday workflow now fully automated.)


    πŸ’‘ The pattern: Most production workflows combine all three patterns, Sequential for the overall flow, Parallel for independent subtasks, and Builder + Reviewer for anything where mistakes are expensive.

    AI Automation Academy is an independent course created by Mercedes Perez-Capilla. It is not affiliated with, endorsed by, or produced by Anthropic. Claudeβ„’ is a trademark of Anthropic. All tool references are for educational purposes.