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 reportsposition-risk-analyzer agent - analyzes why positions are at riskBy the end of this lesson:
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:
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?
| Pattern | Best For | Riley's Example |
|---|---|---|
| Sequential | Multi-stage processes | Data β Analysis β Report |
| Parallel | Independent similar tasks | Analyze 5 positions simultaneously |
| Builder + Reviewer | Quality-critical output | Analysis β 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 Situation | Pattern | Example |
|---|---|---|
| "I have multiple stages" | Sequential | Report β Analysis β Summary |
| "I have similar independent tasks" | Parallel | Analyze multiple items |
| "Quality is critical" | Builder + Reviewer | Draft β 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:
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:
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:
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:
| Stage | Check For |
|---|---|
| Stage 1 | Output is complete, at-risk positions identified |
| Handoff 1β2 | All at-risk positions passed to analyzer |
| Stage 2 | Each at-risk position has analysis and recommendations |
| Handoff 2β3 | Analysis passed to validator (if using) |
| Stage 3 | Final 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:
| Problem | Fix |
|---|---|
| Stage 2 missing some items | Add explicit "For EACH item" in Stage 1 output |
| Duplicate analysis | Check if positions are being passed multiple times |
| Final summary incomplete | Ensure coordinator references ALL previous outputs |
| Reviewer too harsh | Adjust reviewer to focus on material issues only |
β Success Check:
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:
π¬ "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:
Quick Test:
/clear[your trigger phrase]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:
| Before | After |
|---|---|
| π 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.