12votes
1answers
2.3kviews

One-shot prompt for a Rust + wasm image filter module wired into a web app cleanly

I wanted a real Rust-to-WASM module doing per-pixel work off the main thread, not a toy that ships 4MB of glue and blocks the UI on load. Most prompts gave me code that assumed a specific bundler and
21votes
1answers
2.8kviews

Accessible hover and focus states in one prompt, with a banned-patterns list

The recurring failure: models give me pretty hover effects that vanish for keyboard users, remove the focus outline "because it's ugly", or convey state with color alone. I got tired of fixing the sam
21votes
1answers
3.4kviews

GPT prompt to scaffold a Next.js marketing site with sane structure, not one 800-line page.tsx

When I ask for a "Next.js landing page" I get everything crammed into one giant app/page.tsx with inline styles and no separation. Fine for a demo, painful the moment you want to edit the pricing sect
22votes
1answers
2.2kviews

Debugging an intermittent asyncio race the model kept papering over

Had a flaky test that failed maybe 1 in 30 runs. Every model I tried "fixed" it by adding an await asyncio.sleep(0.1) somewhere, which is not a fix, it is a bribe. The real bug was two coroutines muta
35votes
1answers
3.4kviews

Prompt that generates an API reference from OpenAPI with realistic examples, not {string}

Generated API docs always have example values like "string", 0, true. Useless. Developers copy them and immediately hit validation errors. I feed the model the OpenAPI schema and force it to invent do
13votes
1answers
1.5kviews

SQL rollup prompt that returns chart-ready buckets with zero-filled gaps

My time-series charts had holes: any hour with no events simply didn't exist in the query result, so the line chart connected across gaps and hid outages. The naive "group by hour" prompt never genera
24votes
2answers
3.4kviews

Low-poly procedural terrain in three.js that regenerates from a seed with a flat-shaded look

I was chasing that faceted low-poly island aesthetic. My first attempts used a smooth normal PlaneGeometry so it looked like melted plastic, not crisp facets. Also the terrain wasn't reproducible so I
17votes
1answers
2.4kviews

Safely refactoring a 600-line god-function CLI without changing its behavior

Inherited a single def run() that was 600 lines: arg parsing, file IO, business logic, and printing all tangled together. Management wanted features added but touching it was Russian roulette. Asking
10votes
1answers
1.7kviews

Staggered list entrance where items cascade in without a JS timeline library

I wanted a list where items rise and fade in one after another, the classic stagger. My first prompts hardcoded animation-delay per child, which breaks the moment the list length changes, and used a l
14votes
1answers
2.8kviews

PR-review agent that outputs findings bucketed by severity with a fix-first ordering

Reviewers on my team were drowning in unordered agent output: a security bug buried under six style suggestions. Even good findings got missed because there was no triage. I restructured the review ag
11votes
2answers
3.2kviews

One-shot prompt for Next.js route handlers with input validation and consistent error shapes

Scaffolding the API layer, I kept getting route handlers that parsed await req.json() with zero validation, returned bare strings on error, and used a different error shape in every file, so the front
25votes
1answers
3.6kviews

Prompt for an agent that reviews PRs and actually finds real bugs, not style nits

I run this as the system prompt for a code-review agent hooked to our CI. Before this, 90% of its comments were style nitpicks nobody wanted. The reframing that fixed it: make the agent predict runtim
26votes
1answers
2.2kviews

Prompt for a pandas cleaning script that validates the schema before it trusts the CSV

I get monthly CSV exports from a vendor and the columns silently drift: a header gets renamed, a numeric column arrives with stray $ and commas, dates flip between MM/DD and DD/MM. My old script assum
21votes
2answers
2.7kviews

Animated SVG flow-field lines that stay crisp at any zoom, seeded and hand-tuned

I love flow fields but canvas ones get blurry when someone zooms the page or exports to print. I wanted the same look as pure SVG paths so it stays vector-crisp forever. My naive prompt drew thousands
10votes
2answers
2.2kviews

Prompt that adds characterization tests before it touches legacy code

I inherited a 12-year-old billing module with zero tests and a maze of nested conditionals. Every time I asked Claude to "refactor this to be cleaner" it happily rewrote the control flow and silently