← BACK TO HOME — Simon Willison — 入门
工具链 · ANALYSIS · IMPACT 7/10

Adding a new content type to my blog-to-newsletter tool

Simon Willison demonstrates an efficient prompt that enabled an AI coding assistant to complete a complex feature extension in one shot, revealing the core Agentic engineering pattern of 'explaining requirements with code'.

KEY POINTS
  • A short prompt accomplished a significant amount of work
  • Core technique: Having the AI clone a reference codebase for context
  • Avoiding complex descriptions by referencing existing logic (Atom feed)
  • Demonstrates the efficient pattern of 'using code as a language for communication' in Agentic engineering
ANALYSIS

The Context: A Common Yet Tricky Requirement Simon Willison faced a challenge familiar to many content creators: he needed to integrate his blog's new "beats" (a content type aggregating external updates) into his weekly newsletter. This wasn't a simple "add a field" task. It involved understanding the new feature's logic, its filtering rules (only beats with descriptions), and integrating it with his existing blog-to-newsletter tool. For a developer, this would typically mean reading the new code, understanding the data flow, and then modifying the tool—a series of tedious steps. Breakdown: Where's the Magic in the Prompt? Yet, Simon accomplished everything in a single interaction with Claude Code using a three-sentence prompt. The brilliance of this prompt perfectly illustrates the core idea of Agentic Engineering: Instead of describing what you want in natural language, you guide the AI by using code and operational instructions to understand context and execute.

  1. Clone simonw/simonwillisonblog from github to /tmp for reference: This is the most crucial first step. He didn't try to verbally explain what "beats" are or their data structure. Instead, he had the AI clone the repository containing the feature's source code. This is like handing the AI the "requirement specification" directly. Specifying /tmp as the clone location also cleverly avoids cluttering the final commit. This reveals an efficient paradigm for collaborating with coding agents: Letting the AI read the code to understand requirements is often more accurate and comprehensive than trying to describe it yourself.
  2. Update blog-to-newsletter.html to include beats that have descriptions - similar to how the Atom everything feed on the blog works: This sentence handles task assignment and logic definition. First, it precisely identifies the file to modify (blog-to-newsletter.html) within a repo of 200+ files. Second, for the core business logic of "which beats to include," he didn't define it himself but referenced the existing Atom feed logic on his blog (similar to how... works). This is another masterstroke: Reusing proven, existing logic within the system avoids reinventing the wheel and potential misunderstandings. The AI just needs to read the Atom feed generation code to perfectly replicate the filtering rule.
  3. Run it with python -m http.server and use uvx rodney --help to test it...: The final part provides validation instructions. He not only asks the AI to modify the code but also gives specific commands for local running and testing, and specifies a comparison baseline (matching the homepage content). This forms a complete "develop-test" loop, ensuring the quality of the deliverable. Trend Insight: Agentic Engineering is Redefining Developer Workflows This case study is more than just a clever prompting trick. It symbolizes a rising Agentic Engineering pattern. In this model, the developer-AI relationship shifts from "programmer and code generator" to "architect and an intern capable of reading and executing code."
  • Shift in Communication Language: The most efficient communication is no longer natural language, but code itself. By having the AI clone the repo and reference specific files and existing logic, developers use the codebase as the most precise "requirements document." * Shift in Work Focus: The developer's core work moves forward from "writing implementation code" to "designing tasks, providing context, and verifying results." Simon spent his time thinking about "how to describe the problem to the AI," not "how to implement this feature in JavaScript." * "One-shot" Delivery Becomes Possible: When context is provided precisely enough (full codebase + clear reference logic), complex, cross-file feature changes can indeed be accomplished in a single prompt. This dramatically boosts development efficiency, compressing what might have been hours or days of "understand-code-debug" cycles into minutes. Practical Value and a Counter-Intuitive Insight For readers, the practical value of this case lies in providing a reusable methodology:
  • When you need AI to modify or extend an existing project, the first step is always to give it the full code context (e.g., clone the repo). * Whenever possible, reference existing patterns or logic within the project as examples for your new requirement. This is far more reliable than re-describing it yourself. * Provide clear verification steps for the AI so it can check its own work. A potentially counter-intuitive point is: The most powerful prompt is often not the longest or most detailed one, but the one that provides the most accurate context. Simon's prompt is short, but it injects extremely precise context into the AI through two key actions (cloning code, referencing existing logic), thereby unlocking the AI's powerful code understanding and generation capabilities. This suggests that in the Agentic era, "how to set the stage for the AI" is more important than "how to micromanage the AI."

Analysis by BitByAI · Read original

Originally from Simon Willison · Analyzed by BitByAI