Design Patterns for AI Coding Agents
The problem
AI coding agents write production code now. Ask one which design pattern fits your problem. You get a confident answer. Nobody measured it.
The references exist. refactoring.guru. Fowler's catalog. SourceMaking. They are clear, and they are thorough. But a human wrote them for a human. An agent cannot retrieve a 40-page chapter while it writes your code. So the agent answers from memory. Sometimes the memory is right. Sometimes it adds a factory to a 50-line script.
The gap is not knowledge. The gap is format.
What we built
AI Patterns is a pattern, refactoring, and code smell reference written for agents first. Every entry follows the same shape:
When to use it. The trigger conditions come first. The agent matches its situation before it reads anything else.
When to not use it. Every pattern page lists the cases that veto the pattern. This is the part most catalogs skip. It stops the agent from adding an abstraction nobody needs.
How to apply it. Refactoring steps come in small units. Tests stay green between steps.
What it costs. Trade-offs sit next to benefits, not in a footnote.
The content covers the classic GoF patterns, resilience patterns like circuit breaker and retry, data patterns, refactoring techniques, code smells, and guides for working with agents. Everything is original. We link to the canonical sources. We do not copy them.
How your agent reads it
Two channels, both standard:
MCP server. Add the aipatterns server to Cursor, Claude Code, OpenCode, or any MCP client. The agent gets tools like check_pattern_fit, detect_smells, and get_refactoring_steps. It calls them at the moment of decision, mid-task. The tool descriptions are written trigger-first, so the agent knows when to reach for them without you saying so.
Installable skills. Prefer skills? Each reference ships as a skill your agent loads into context. One command per install. See Agent Skills.
We measured, and we publish the results
We did not assume the reference helps. We built a benchmark harness that runs real coding agents on real tasks, with the server and without it. The harness and the results are public on the site.
The honest summary so far: results are mixed. Some agents call the tools and use them well. Others ignore them. We publish that anyway. A catalog that claims wins it cannot show is part of the problem this site exists to fix.
Start here
Read the guides free: Guides
Add the MCP server: MCP Guide
Install a skill: Agent Skills
Replies
Be the first to reply
Have a question or a thought to share? Add a comment above to start the conversation.