Adding a new content type to my blog-to-newsletter tool
Summary
Simon Willison details how he used a single, concise prompt with Claude Code to update his `blog-to-newsletter` tool, which generates content for his Substack newsletter. The update involved integrating a new content type called "beats" from his blog, specifically those with descriptions, mirroring how they appear in his blog's Atom feed. The prompt instructed the agent to clone a reference repository, modify `blog-to-newsletter.html`, and then validate the changes by running a local server and using browser automation to compare the generated newsletter content with his blog's homepage. This approach successfully led to a pull request that added a SQL `UNION` clause to filter relevant beats and mapped beat types to display names.
Key takeaway
For AI Engineers developing or modifying web-based content tools, you should structure your prompts to include explicit instructions for cloning reference repositories, specifying target files for modification, and providing clear validation steps. This approach, including local server setup and browser automation, significantly enhances the agent's ability to deliver precise and verified solutions, reducing iterative debugging and ensuring functional correctness.
Key insights
Coding agents excel with clear instructions, reference code, and self-validation mechanisms.
Principles
- Provide reference code for complex problems.
- Enable agents to self-validate their work.
- Specify desired output format or behavior.
Method
To update a web tool, instruct an agent to clone a reference repository, modify specific files, and then validate changes by running a local server and comparing output against a known good source using browser automation.
In practice
- Use `/tmp` for temporary reference code clones.
- Include `python -m http.server` for local testing.
- Employ `uvx rodney --help` for browser automation.
Topics
- blog-to-newsletter Tool
- Claude Code
- AI Coding Agents
- "Beats" Content Type
- Datasette
Code references
Best for: AI Engineer, Prompt Engineer, Software Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Simon Willison's Weblog.