Willison's one-shot prompt pattern: clone-for-reference, imitate-existing-logic, self-verify
Simon Willison walks through a short Claude Code prompt that extended his blog-to-newsletter tool to include a new content type called ‘beats’ - external items like project releases, tools, and museum visits imported from various sources. Rather than specifying logic in detail, he pointed the agent at his Django blog repo (cloned to /tmp to keep it out of the commit) and told it to mirror the filtering rule already used by his Atom feed: include only beats that have a manual description. The resulting PR added a UNION clause filtering on non-empty notes and non-draft status.
The prompt embeds several reusable agentic-engineering patterns. Cloning reference code to /tmp prevents contamination of the working repo. Naming a single file in a 200+ file repo scopes the change. Piggybacking on an existing heuristic (‘like the Atom feed does’) sidesteps re-specifying business logic. And he hands the agent a validation loop: serve via python -m http.server, drive a browser with uvx rodney, and diff output against the live homepage - giving the model a way to confirm its own work rather than declaring victory blind.
The broader point is that terse prompts work when they lean on shared context the agent can fetch, existing patterns it can imitate, and concrete verification steps it can run. The brevity is load-bearing, not lazy.
Read the full article
Continue reading at Simon Willison →This is an AI-generated summary. Read the original for the full story.