Phase 5 · Months 4 to 6
Design agent workflows that survive failure
Learn the patterns before the frameworks
Learn these patterns: the single-agent loop, the router, the supervisor with workers, planner and executor, evaluator and optimiser, map and reduce, and human-in-the-loop. For each one, learn what state it needs, how it stops, and how it recovers. Framework APIs change. These patterns do not. You already used the supervisor pattern by hand in Phase 1, when you ran and watched several coding agents.
Keep control flow in code
Move everything that must behave the same way every time out of the model. State transitions, budgets, permissions, retries, stored state, and approvals belong in code. Use the model for interpretation, planning, summaries, and judgement, where fixed rules would break on unexpected input. The model then controls much less of the system.
Save state after every step
Save workflow state after each meaningful step, so that a long-running agent survives a restart. Make each step safe to replay, and make tools idempotent where you can. Store enough history to reconstruct what the agent saw and why it acted.
Then learn the tools that do this for you. A durable execution engine records every model call and tool call as a step in a workflow. The run can then crash, wait hours for an approval, or back off from rate limits, and continue from where it stopped. Temporal is the mature choice, and it reportedly runs agent workloads at OpenAI for Codex, at Replit, and at Cursor. There are lighter options. DBOS stores its state in the Postgres database you already have. Inngest is a managed service that suits serverless TypeScript apps on Vercel or Cloudflare. Restate is a single small server. AWS Step Functions does the same job inside AWS. Learn Temporal properly, and learn one lighter option that fits your product.
Try the frameworks
Now learn the Claude Agent SDK and LangGraph. The Claude Agent SDK is built for agents that work with code and files, which is what internal developer tooling needs. LangGraph builds workflows as graphs and saves checkpoints. Rebuild one workflow that you built from scratch earlier, and compare how the two versions are to run and debug. Often the model provider's SDK plus a durable execution engine is the simplest answer. Also run a coding agent without a person in CI. It is the same agent you use every day, now running as a workload.
Two more frameworks are worth learning if they fit your work. Use the Vercel AI SDK if your product or your daily work is in TypeScript. Learn Microsoft Agent Framework, the successor to AutoGen with the same features in C# and Python, before you interview at .NET companies. Pydantic AI is a good lighter option with typed inputs and outputs in Python. You do not need more frameworks than these.
Build a PR review system
For every pull request, the system does the following:
- Classify which systems the pull request changes.
- Retrieve the relevant architecture docs and standards.
- Run separate reviewers for security, data, architecture, and tests.
- Merge the findings and remove duplicates.
- Score each finding for confidence.
- Post only the findings above a threshold.
Set hard limits on turns, time, and token spend. Run it on your own repositories first. It will review code that agents wrote, which is the real job.
You are done when
You can draw the state machine for an agent workflow and mark which transitions are fixed code and which the model decides. You can recover a run after an interruption, and you can explain whether a task needs more than one agent.
Exit checklist
0 of 7 done