Part IV

The Seven Patterns

Chapter 9

The Specialist Ensemble

In October 1994, four computer scientists — Erich Gamma from Switzerland, Richard Helm from Australia, Ralph Johnson from the University of Illinois, and John Vlissides from IBM Research — published a book at the OOPSLA conference in Portland, Oregon.

They didn't invent a new language. They didn't build a framework. They did something simpler and more lasting: they named things.

Factory. Observer. Strategy. Decorator. Singleton. Twenty-three names for twenty-three recurring solutions to object-oriented design problems. Before their book, every developer who discovered one of these patterns had to explain it from scratch. After, you could say "use a Strategy pattern here" and your entire team understood instantly.

Over 500,000 copies sold. Fourteen languages. The ACM SIGPLAN awarded them the Programming Languages Achievement Award in 2005. Thirty-two years later, in 2026, those patterns are embedded in Java, Spring, .NET, Android, React, and virtually every major codebase on earth.20Gang of Four. Design Patterns. 1994. 500,000+ copies. Wikipedia

The Gang of Four didn't make OOP work. They made it learnable. They compressed decades of hard-won experience into transmissible knowledge.

Agent Composition Lacks a Shared Language — no named patterns, no shared vocabulary

Agent composition has no such vocabulary. When you solve a composition problem today, you explain it from scratch tomorrow. This chapter and the next two change that. Seven patterns. Seven names. Each observed in real production agent systems.

The pattern

You have a task that spans multiple domains of expertise. No single agent — no matter how capable the underlying model — can master all of them simultaneously. The solution: decompose the task into specialist roles. Each agent has deep expertise in one domain. Each has a typed contract for its inputs and outputs.

Anatomy of an Ensemble — coordinator delegates to specialists, each with role, tools, prompt, and contract

Claude Code does this when you ask it to research a broad topic. It spawns three sub-agents: one for web search with WebSearch and WebFetch tools, one for codebase exploration with Read, Grep, and Glob tools, and one for synthesis with Write tools. Different tools. Different system prompts. Different typed outputs. Each returns a structured result the coordinator assembles.

When to use it: the task requires multiple competency domains — architecture, implementation, review, deployment.

When NOT to use it: the task is within a single domain. The OpenReview benchmark study showed that a single well-prompted agent beats an ensemble on homogeneous tasks. Don't pay the coordination tax when you don't need specialization.

The Ensemble Decision Matrix — when to use single agent vs specialist ensemble based on domains and complexity

The critical detail: each specialist must have a typed output contract. The Architect doesn't pass free-form text to the Implementer. It passes a structured JSON document with defined sections — design decisions, file paths, interface signatures. Structured data doesn't degrade at handoffs. Free-form text does.21"Multi-agent workflows often fail." GitHub Blog: "Natural language is messy. Typed schemas make it reliable." GitHub

Typed Contracts Prevent the Telephone Game — free-form dissolves at handoffs, structured data fits like puzzle pieces
← Chapter 8Two Jobs, One Title