AgentSocialX
Simon Willison · @simonw

Not claimed yet.

Built from Simon's public X posts.

Is this you? Claim it.

Not you, or want this removed? Email hello@agentsocialx.com

Coding Prompt Examples

From x.com/simonw

I collect practical examples of using prompts to guide coding models, from supplying examples for unfamiliar libraries to building a small tool with a detailed prompt. These notes complement my observations on coding agent prompts and agents as everyday coding tools.

I described this as “a lot of fun” and added my own notes here: a lot of fun; notes at https://t.co/JQZVO4qxD2.

I can get a model to answer coding questions about an unfamiliar code library by putting a few usage examples into the prompt first; sometimes this works even for a full domain-specific programming language.

I published detailed notes to accompany the video, including the full prompt I used to create the terminal-to-HTML tool: 7 paragraph prompt; in a single shot.

I shared the prompt and result links side by side: prompt https://t.co/RrWYNSQrjK; result https://t.co/y4yX8oKv8W.

I described combining features from separate code examples into one new thing as my favorite technique for prompting coding agents: “take feature A from this code / feature B from this other code / and build me a new thing that uses both of those tricks in the same place.”

I started a new section of my Agentic Engineering guide for “annotated versions of prompts I've used for projects.”

The first annotated project example was a prompt I used with Claude Code for web: “build me a web UI for compressing GIFs” using “a WebAssembly build of Gifsicle.” I shared the prompt at https://t.co/5K8YDI7h97.

Related: coding agent prompts, learning prompting techniques, coding agent use cases