Short Prompt Adds Beats to Newsletter via Agent Cloning

Instruct coding agents to clone reference repos into /tmp, imitate existing Atom feed logic in specific files, and test via local server + uvx rodney browser automation—delivering exact SQL UNION for annotated beats in one shot.

Clone Reference Repos to Bootstrap Complex Logic

Direct agents to clone relevant GitHub repos into /tmp to inspect schema and code without polluting the working repo. For adding "beats" (external content like OSS releases or museum visits from niche-museums.com) to the blog-to-newsletter tool, clone simonw/simonwillisonblog. This repo holds the Django blog's beat models, including beat_type, note (for commentary), is_draft, and url fields. Agents derive mappings like beat_type to formal names directly from ORM definitions (e.g., blog/models.py lines 545-551), avoiding verbose descriptions. Result: agent adds precise SQL UNION clause filtering non-draft beats with non-empty notes:

union all select id, 'beat' as type, title, created, slug, 'No HTML' as html, json_object('created', date(created), 'beat_type', beat_type, 'title', title, 'url', url, 'commentary', commentary, 'note', note) as json, url as external_url from blog_beat where coalesce(note, '') != '' and is_draft = 0 union all...

This pattern cuts prompt length while ensuring accuracy for features mimicking production logic, like prioritizing annotated beats over uninteresting dot-releases.

Imitate Existing Features to Skip Reinvention

Name the target file (blog-to-newsletter.html in simonw/tools repo) and direct imitation of proven logic, such as the blog's Atom everything feed which already filters descriptive beats. This leverages the tool's Datasette-powered SQL fetches from simonwillison.net, extending the UNION for stories/tags to include beats. No need to detail filters—agent infers from cloned repo that notes mark "interesting" content for newsletters. Outcome: seamless integration into the HTML/JS app, generating rich text HTML for Substack pasting, matching homepage displays.

Embed Self-Testing for Confident Changes

Always include runnable validation: python -m http.server for localhost serving (avoids file:// fetch issues), then uvx rodney --help for browser automation testing. Rodney's help output teaches agents usage; compare generated newsletter output against https://simonwillison.net homepage beats. This red/green loop verifies live data pulls, ensuring PR #268 in simonw/tools exactly matches requirements without regressions. Full Claude Code session transcript shows tool calls confirming success, proving agents excel with concrete, executable checks over vague instructions.

Summarized by x-ai/grok-4.1-fast via openrouter

5798 input / 1925 output tokens in 13521ms

© 2026 Edge