← Build ExercisesDomain 1
Agentic Architecture & Orchestration
7 build exercises to practice the concepts in this domain.
1.1Intermediate45 minutes
1.1 — Build a Multi-Tool Agent Loop
What you will learn
- How a Messages API agent loop starts, calls tools, and stops.
- Why stop_reason, not the shape of the text, decides the next turn.
- How tool_use continues the loop and end_turn ends it.
- How to append each tool result so the next turn can use it.
- When an iteration cap is only a safety ceiling.
1.2Intermediate60 minutes
1.2 — Build a Hub-and-Spoke Research Coordinator
What you will learn
- How hub-and-spoke keeps every message on the coordinator.
- Why a subagent sees only the context you put in its prompt.
- How a broad split avoids dropping whole categories of a topic.
- How a coverage loop finds gaps and sends them back out.
- Why a thin report is a decomposition problem on the coordinator.
1.3Intermediate50 minutes
1.3 — Implement Context Passing with Structured Metadata
What you will learn
- Why allowedTools must include Task or Agent before a coordinator can spawn.
- How a finding keeps the claim separate from its source.
- Why a missing citation is a handoff bug, not a synthesis-prompt bug.
- How to spawn independent subagents in one coordinator response.
- How fork_session differs from a parallel Task call.
1.4Advanced60 minutes
1.4 — Build a Prerequisite Gate for Financial Operations
What you will learn
- Why a money movement needs a code gate, not a prompt reminder.
- How a prerequisite gate refuses the tool call until the earlier step has succeeded.
- Why a prompt still fails on a slice of runs while a gate does not.
- How a handoff carries customer id, summary, root cause, and a recommended action.
- How a request with two independent concerns is split and handled together.
1.5Advanced60 minutes
1.5 — Implement Agent SDK Hooks for Normalisation and Policy Enforcement
What you will learn
- PostToolUse runs after a tool returns and is where you normalise data.
- PreToolUse runs before a tool executes and is where you enforce policy.
- Why a hook can guarantee a rule that a prompt cannot.
- How to fold different MCP payloads into one schema.
- The split: hooks for requirements that must always hold, prompts for preferences.
1.6Advanced60 minutes
1.6 — Build a Multi-Pass Code Review Pipeline
What you will learn
- Why one pass over many files reviews some deeply and others barely.
- How a per-file pass plus a cross-file pass fixes that split of attention.
- When a fixed pipeline fits, and when the split should be decided at runtime.
- Why batching files without an integration pass still misses cross-cutting issues.
- How to spot the artefact: the same pattern flagged in one file and approved in another.
1.7Intermediate45 minutes
1.7 — Implement Session Management Strategies
What you will learn
- The three options: resume, fork_session, and a fresh start that injects a summary.
- Why resuming after the files have changed leaves the session on stale tool results.
- How a structured summary keeps the decisions without the old tool payloads.
- When a targeted re-read beats exploring the repo again.
- Fork compares approaches from one start. Resume continues the same line of work.