← All posts

One good example beats ten don'ts

We build our websites with coding agents, and we keep a guide file that every agent reads before touching a page. Each time an agent made something we didn't want, we added a rule. The guide grew a long list of "never" lines, and the agents kept producing the things on it.

How a rule list grows

A marketing section needed a figure. An agent drew a card of label/value rows: "Call input · Saved", "External responses · Recorded". It looked like a settings panel, and the reader had to read every row to get the point. So we wrote a rule against cards of label/value rows, status words and check marks. To make it unmistakable, our design gallery rendered the bad card in a dashed red box labelled "Not this".

Next, a full-width diagram. An agent made every element much bigger so the diagram filled the width. It didn't explain anything better; it just got louder. Our first instinct was another rule: render objects at their true size, never scale up. Then we noticed that true size doesn't help if the content is wrong. The elements were enlarged because they carried nothing, and the width was empty because the point was too weak to fill it.

Every fix we reached for was one more thing not to do. So we asked whether that works at all, and searched for what others have found.

Telling a model "don't" names the thing

Negation is a known weak spot for language models. A recent paper, summarised by Unite.ai, tested 16 models: open models endorsed an explicitly banned action 77% of the time when the ban was a simple "don't". Practitioners call this the pink elephant problem (16x Eval, Swimm). To forbid something, you have to describe it, and the description is what the model sees.

Anthropic's own guidance says the same thing from the other side. Its prompting best practices tell you to say what you want instead of what you don't: "Your response should be composed of smoothly flowing prose paragraphs" rather than "Do not use markdown". The same page calls examples one of the most reliable ways to steer format, tone and structure, and the multishot guide explains how to write them.

By that standard, our gallery was working against itself. The reference page agents copied from contained, rendered in full, the exact card we wanted gone.

People learn the same way

This isn't only a model quirk. Learning research has long found that beginners learn more from studying worked examples than from rules or problem solving alone, and that they can pull the general rule out of a good example themselves (van Gog and Rummel's review). The example-rule coordination principle adds a refinement: rules work best when they're attached to an example, so the learner sees which features of the example the rule is about.

A coding agent opening a design guide is a beginner every time. It has no memory of the last page, and it builds from whatever the guide puts in front of it.

What we're changing

The design gallery becomes a set of finished figures we're proud of, and each one is annotated like a worked example:

  • The point, in one sentence. For our hosting diagram: you write only your service; everything else is already plugged in.
  • What each element carries. The code is the only thing you write. Each capability lights up when a line of code uses it, which is how the reader sees that it's ready.

The guide stops listing bans. Its instruction becomes one positive line: start from the closest example in the gallery, keep its structure, and replace its point and content with yours. The "Not this" panels go. When an agent makes a mistake, we add or improve an example instead of writing a prohibition.

The annotation is what would have caught the enlarged diagram. An element that has to say which part of the point it carries can't just be made bigger to fill space: if it carries nothing, it goes, and if the figure is then too small for its frame, it gets a smaller frame.

A caveat

Negative examples aren't useless. An AAAI paper found that showing a model positive and negative examples together beat standard few-shot prompting on some tasks. What we found weakest was the shape our guide had drifted into: a growing list of don'ts, plus a rendered bad example, with no good example of the same thing next to it. We haven't benchmarked the new setup; this is a change we're making because the evidence and our own sessions point the same way.

Sources