Source

Primary source: simon-willison's Substack article "Agentic Engineering Patterns" (https://simonw.substack.com/p/agentic-engineering-patterns). The guide is maintained at https://simonwillison.net/guides/agentic-engineering-patterns/ and was published 2026-02-23 with ongoing updates. Author: Simon Willison, simonwillison.net.


Overview

Simon Willison launched a structured guide project called Agentic Engineering Patterns — a collection of coding practices and patterns to help professional software engineers get the best results from coding agents (Claude Code, OpenAI Codex, and similar tools). The project is inspired by the Design Patterns book format (Gang of Four, 1994) and is published as a series of "chapters" on his blog, designed to be updated over time rather than frozen at first publication.

Willison distinguishes this from "vibe coding" (where you pay no attention to the code and is often associated with non-programmers using LLMs). Agentic Engineering is the professional end of the spectrum: experienced engineers using coding agents to amplify their existing expertise.

This guide is a living document — Willison publishes 1-2 chapters per week and does not consider it "finished."


Key Patterns

1. Writing Code Is Cheap Now

The central insight of agentic engineering: the cost to churn out initial working code has dropped to almost nothing, which disrupts many existing engineering intuitions.

At the macro level, this challenges project planning and estimation — if code is cheap to produce, the traditional calculus of "is this feature worth the development cost?" shifts.

At the micro level, every local decision changes: Should I refactor that function? Write documentation? Add a test for this edge case? Build that debug interface?

The key tension: Delivering new code is cheap, but delivering good code still has significant cost. "Good code" means it works, is tested, handles errors gracefully, is simple and minimal, documented, and designed for future changes.

New habit to build: Any time your instinct says "don't build that, it's not worth the time" — fire off a prompt anyway, in an asynchronous agent session. The worst case: you check 10 minutes later and find it wasn't worth the tokens.

2. Red/Green TDD

"Use red/green TDD" is a succinct way to get better results from a coding agent.

Why it works for agents:
- Protects against code that doesn't work
- Protects against building code that's unnecessary
- Ensures a robust automated test suite for regressions

The pattern:
1. Write the test first (it will fail = "red")
2. Implement the code to make the test pass ("green")
3. Confirm the test fails before implementing — otherwise you risk a test that passes already

Every capable model understands "red/green TDD" as shorthand for the full workflow.

3. Linear Walkthroughs

When vibe coding (or inheriting any codebase), ask the agent to give you a linear walkthrough of the entire codebase — a structured, file-by-file explanation.

Willison used this pattern after vibe coding a SwiftUI app with Claude Code: he asked a fresh agent instance to walk through the GitHub repo and explain how the code worked. The agent used Showboat (Willison's own tool) to construct a document that included live command output, avoiding copied code snippets that could hallucinate.

Key benefit: Even a ~40-minute vibe-coded toy project becomes an opportunity to explore new ecosystems and actually learn how the code works.

4. How Coding Agents Work

A technical foundation chapter covering the internals:

  • LLMs work by completing text (converted to tokens) — not magic
  • Chat templated prompts simulate conversation by replaying the full history every turn
  • Token caching — providers charge less for cached prefix tokens; agents are designed to minimize cache invalidation
  • Tool calling — agents can invoke functions (Bash, Python, etc.) by outputting structured call syntax; the harness executes and returns results
  • System prompts — hidden instructions telling the model how to behave; often hundreds of lines
  • Reasoning — models spend extra tokens "thinking out loud" before responding, particularly useful for debugging complex code paths
  • The loop — LLM + system prompt + tools = a coding agent; the fundamental mechanics are surprisingly simple

5. Subagents

Using parallel or specialist subagents:
- Claude Code's Explore subagent for research tasks
- Parallel subagents for implementing multiple things simultaneously
- Specialist subagents for domain-specific work (e.g., a subagent that only handles SQL, or only writes tests)

6. Hoard Things You Know How to Do

Your accumulated personal pattern library becomes more valuable with agents — you can describe what you want and the agent assembles from your hoard. Agents make it easier to recombine known patterns in new ways.

7. Anti-patterns

Things to avoid:
- Inflicting unreviewed code on collaborators — agents can generate a lot of code quickly, but that doesn't mean it should go straight into a shared codebase without review


The Present App — Vibe Coding Case Study

Willison vibe coded a macOS SwiftUI app called Present in ~45 minutes the night before a talk. It:
- Loads a sequence of URLs and displays them full-screen
- Left/right keys navigate between slides
- Embeds a web server on port 9123 so his phone (via Tailscale) could remotely control the presentation
- Auto-saves presentation state

Notable observations:
- Swift (a language he didn't know) was the right choice — native macOS, tiny binaries (76KB compressed)
- The code was simple and straightforward when he finally looked at it
- Claude Code implemented the HTTP routing using raw socket programming without a library (minimal HTTP parser in ~10 lines)
- Linear walkthrough pattern was used post-hoc to understand what had been built


Additional Patterns in the Guide

  • Better Code — AI tools helping produce better code, avoiding technical debt, the compound engineering loop
  • Using Git with coding agents — Git essentials, core concepts, rewriting history
  • Agentic manual testing — using browser automation for web UIs, having agents take notes with Showboat
  • Interactive explanations — understanding code through agent-driven exploration
  • GIF optimization tool — annotated prompt example
  • Adding a new content type — annotated prompt example
  • Prompts I use — Proofreader, Alt text, Podcast highlights

Notable Quotes

"The biggest challenge in adopting agentic engineering practices is getting comfortable with the consequences of the fact that writing code is cheap now."

"Every good model understands 'red/green TDD' as a shorthand for the much longer 'use test driven development, write the tests first, confirm that the tests fail before you implement the change that gets them to pass'."

"A coding agent is a piece of software that acts as a harness for an LLM, extending that LLM with additional capabilities that are powered by invisible prompts and implemented as callable tools."


Key Takeaways for dark-factory-kb

This is highly relevant to the Kelly software factory concept. Simon Willison is essentially documenting the craft of working with coding agents professionally — exactly the kind of knowledge a software factory would need to systematize. The patterns map well onto factory concerns:

Pattern Factory Relevance
Writing code is cheap Shifts cost calculus for build-vs-buy decisions, prototyping
Red/green TDD QA discipline for agent output
Linear walkthroughs Code review / understanding patterns
Subagents Parallel execution — core factory architecture
Anti-patterns Quality gates in the factory pipeline
How coding agents work Technical literacy for architecture decisions

Referenced from:
- kelly-factory-overview — patterns for agentic engineering are directly applicable to factory operations
- kelly-handbook-appendix-e-patterns — agentic engineering patterns would fit as a new pattern category

Bibliography

  • Simon Willison, "Agentic Engineering Patterns" (Substack announcement), February 23, 2026 — https://simonw.substack.com/p/agentic-engineering-patterns
  • Simon Willison, "Writing code is cheap now" (chapter), Agentic Engineering Patterns guide — https://simonwillison.net/guides/agentic-engineering-patterns/code-is-cheap/
  • Simon Willison, "Red/green TDD" (chapter), Agentic Engineering Patterns guide — https://simonwillison.net/guides/agentic-engineering-patterns/red-green-tdd/
  • Simon Willison, "Linear walkthroughs" (chapter), Agentic Engineering Patterns guide — https://simonwillison.net/guides/agentic-engineering-patterns/linear-walkthroughs/
  • Simon Willison, "How coding agents work" (chapter), Agentic Engineering Patterns guide — https://simonwillison.net/guides/agentic-engineering-patterns/how-coding-agents-work/
  • Simon Willison, "Subagents" (chapter), Agentic Engineering Patterns guide — https://simonwillison.net/guides/agentic-engineering-patterns/subagents/
  • Simon Willison, "Present" vibe-coded SwiftUI app, February 25, 2026 — https://github.com/simonw/present