Key takeaways from Module 07: Multi-Agent Workflows. Read this after the module; use it as your quick reference afterwards.
- A multi-agent workflow is an ordered sequence of bounded sessions: each role produces exactly one named, committed artifact and hands off with the 3-part prompt from Module 06.
- The context window resets at every role boundary — that reset is the design, not a limitation. Planner output does not occupy the Implementer's context.
- A well-formed sub-task has 3 properties: bounded scope (named files), single acceptance criterion, no compound steps. If it needs more than one role, it is too large.
- Three patterns cover ~90% of scenarios: Feature Delivery (Planner → [Architect] → Implementer → Code Reviewer → [Test Engineer]), Bug Investigation (Analyst → Implementer → Test Engineer → Code Reviewer), Refactor and Validate (Refactoring Specialist → Test Engineer → Code Reviewer). Extend by inserting one role at the right position — do not invent new patterns.
- The workflow file (
agents/workflow-[purpose].md) is a plan written before the first session, never a transcript written after. Its 5 sections: Pattern, Problem statement, Steps, Active context, Outcome. - Artifact quality determines handoff quality: named and committed, self-contained, scoped, dated.
- One role per session. End the session the moment the role's deliverable exists — never continue a Planner session into implementation.
- Artifacts over chat memory. Every session closes with a committed file; if output exists only in chat history, it does not exist.
- The 3-part handoff prompt (Summary / Objective / Carry-forward) is the only bridge between sessions — nothing else transfers reliably.
- State the active instruction file path explicitly in every initialization prompt; copy key constraints verbatim from the workflow file's
## Active context. - Write the workflow file before opening any session; record deviations in
## Outcomeinstead of rewriting the plan mid-run. - Every session has an exit condition; stop the Planner as soon as the sub-task list is complete.
- Stop rule for wrong hypotheses: if the Implementer cannot reproduce the bug from the Analyst's hypothesis, close the session without modifying anything and return to the Analyst with new evidence.
- Escalate only Solution Architect and Security Reviewer sessions to a frontier model; auto selection handles Planner, Implementer, Code Reviewer, and Test Engineer.
The 4 workflow failure modes:
- One-session sprawl — plan, implementation, and review in a single session. End at role completion; write the handoff before opening the next session.
- No artifact discipline — output lives only in chat history. Commit a file before closing, no exceptions.
- Skipped review — Implementer output merges without a Code Reviewer pass. The reviewer step is required, especially when you feel confident.
- Workflow drift — the workflow file is edited mid-run to drop inconvenient steps. Keep the original plan; log deviations in
## Outcome.
Decomposition decision matrix — run every sub-task through it before assigning a session:
| Question | If yes | If no |
|---|---|---|
| Does the sub-task name at least one specific file? | Proceed | Narrow the scope to a named file |
| Does the sub-task have exactly one acceptance criterion? | Proceed | Split or rewrite to isolate one criterion |
| Can one agent role complete it without switching roles? | Proceed | Assign the second concern to a separate session |
| Is the expected implementation time under 20 minutes? | Proceed | Split the sub-task |
| Does the description contain the word "and"? | Split immediately | Proceed |
Pattern selection: root cause unknown → Bug Investigation · written spec or new capability → Feature Delivery · behavior correct but structure poor → Refactor and Validate.
Before moving to Module 08, confirm:
- I can define a multi-agent workflow and state the 4 properties that distinguish it from one long session
- I can state the 3 properties of a well-formed sub-task and rewrite a broken one
- I can state the role sequence of all three workflow patterns without looking them up
- I can select the correct pattern for a feature, a bug, and a refactor scenario — and justify the choice
- I know when to add the Solution Architect step to Feature Delivery and when to skip it
- I write the workflow file before opening any session, with all 5 required sections
- I can explain why
## Active contextis not optional - I can state what transfers across session boundaries and what does not
- I commit every session's output as a file before closing the session
- I can name the 4 workflow failure modes and the safeguard for each
- I know what to do when an Analyst hypothesis turns out to be wrong
- I know which roles run on auto model selection and which two justify a frontier model