Akshay Parkhi's Weblog

Agentic Engineering Patterns — Key Takeaways from Simon Willison’s Guide

8th March 2026

Simon Willison recently published an excellent guide on agentic engineering patterns. It collects practical lessons from building with AI coding agents. Here are the key takeaways that matter most for AI agent developers, distilled from his full guide.


The Core Insight

Writing code is cheap now, but bad code is still expensive. The guide isn’t about generating more code faster. It’s about building guardrails for quality into your agent workflows.


Key Patterns Worth Adopting

1. Red/Green TDD as a Default Agent Pattern

The prompt “Use red/green TDD” is a concise way to get much better results. Have your agent do three steps:

  1. Write the tests first.
  2. Confirm that they fail.
  3. Implement.

This prevents hallucinated or dead code and builds a regression suite. Consider making this part of your agent’s default workflow.

2. “First Run the Tests” as a Session Opener

Starting every agent session with “first run the tests” does three things:

  • It teaches the agent that the test harness exists.
  • It gives the agent a sense of project size.
  • It puts the agent in a testing mindset.

This is a great pattern to embed in your agent’s initialization.

3. Agentic Manual Testing

Unit tests aren’t enough. Have agents test their own work manually with:

  • curl for APIs
  • python -c for quick checks
  • browser automation tools (Playwright, Rodney, agent-browser) for web UIs

Manual testing catches bugs that automated tests miss.

4. Hoard Working Examples

Build a personal library of working code snippets, proofs-of-concept, and tools. These become useful inputs for agents. You can tell an agent to combine two existing working examples into something new. The recombination pattern is extremely effective.

5. Linear Walkthroughs to Understand Agent-Written Code

When you vibe-code a project, use agents to generate structured walkthroughs of the codebase. Tools like Showboat capture the agent’s exploration with real commands and outputs (not hallucinated summaries). This reduces cognitive debt.

6. Interactive Explanations

For complex algorithms, have agents build animated/interactive visualizations. This is a good way to truly understand what your agent built rather than treating it as a black box.

7. Never Inflict Unreviewed Code on Collaborators

The #1 anti-pattern is to dump agent-generated PRs without reviewing them yourself. Include evidence of testing (screenshots, manual test notes, small focused PRs).

8. Bias Toward Action — Prompt Anyway

When your instinct says “not worth the time,” start an async agent session anyway. The worst case is that you check the result later and discard it.


Most Actionable for Agent Development

PatternHow to Apply It
Red/green TDD built-inMake your agent default to test-first development
“First run the tests” initializationHave your agent discover and run existing tests at session start
Manual verificationIntegrate curl, python -c, and browser automation — not just unit tests
Hoarding + recombinationBuild a searchable library of working examples your agent can reference
Browser automationIntegrate Playwright/Rodney for agents building web UIs — visual verification catches what unit tests miss
Linear walkthroughsUse agents to document agent-written code with real commands and outputs, not summaries
Small focused PRsBreak agent work into reviewable chunks with evidence of testing

Bottom Line

The biggest shift is treating agents not as code generators but as junior developers who need process. Give them:

  • TDD
  • test suites to run
  • manual verification tools

Then review their work before shipping. The patterns that make human teams productive make agent teams productive too.

Read the full guide: simonwillison.net/guides

More recent articles

This is Agentic Engineering Patterns — Key Takeaways from Simon Willison’s Guide by Akshay Parkhi, posted on 8th March 2026.

Next: OpenClaw / ClawdBot Architecture — How a Telegram AI Bot Actually Works

Previous: How AWS Strands Hooks Work