23votes
2answers
2.8kviews

System prompt to give a chatbot a consistent personality without it getting cutesy

Giving a bot "personality" usually means it starts every message with a quip and an emoji and becomes exhausting by the third turn. I wanted a distinct, dry voice that stays out of the way. The approa
8votes
1answers
2.0kviews

Gemini prompt for an animated gradient hero background that doesn't jank on scroll

I wanted a slow, living gradient behind a hero, the kind that feels expensive. My first attempts animated background-position on a huge gradient and it hitched badly on scroll and cooked laptop fans,
9votes
1answers
2.0kviews

Generative CSS gradient-mesh background that stays subtle behind text

For a poster-style hero I wanted a soft animated gradient mesh, but the usual prompt gives you a seizure-inducing rainbow that makes overlaid text unreadable. The animation also pinned the CPU because
46votes
0answers
3.9kviews

Prompt for a React render-performance audit that names the actual wasted re-renders

Performance is a feature on my team, and "make it faster" prompts just sprinkled useMemo everywhere, including on primitives, which made the code worse and slower to read for zero gain. I reframed it
35votes
1answers
3.4kviews

Context-engineering prompt for compacting an agent's long history without losing the thread

Long-running agents blow the context window. Naive truncation drops the early decisions that explain why the code looks the way it does, so the agent re-litigates settled choices. Summarizing the whol
8votes
1answers
1.9kviews

System prompt for a WebAudio chiptune sound engine I can reuse across games

I kept re-generating one-off beep functions for every game jam and they all sounded thin and clicky. I wanted one reusable sound engine module I could drop into any canvas game with named SFX and a li
19votes
1answers
2.7kviews

Getting the model to write actually safe bash instead of a footgun with set -e

I kept getting shell scripts that looked fine and then nuked a directory because an unset variable expanded to empty and rm -rf "$DIR/" became rm -rf /. Adding set -e alone is a trap: it silently does
20votes
2answers
3.1kviews

Prompt that turns a messy codebase into a README people actually finish reading

Our README was the usual wall: a paragraph of marketing, then npm install, then nothing. New hires bounced off it constantly. What finally worked was forcing the model to write for one specific reader
10votes
1answers
1.9kviews

Prompt for a dark-mode pricing table that reads as premium, not a spreadsheet

I build a lot of dark-mode products and pricing tables are where AI output falls apart. The default is three equal cards, a wall of checkmarks, and one card with a garish "Most Popular" badge slapped
11votes
1answers
2.0kviews

A reusable three.js ShaderMaterial boilerplate prompt: time, resolution, and mouse uniforms done right

I kept rewriting the same plumbing for every shader toy: pass uTime, uResolution, uMouse, handle DPR, update on resize. And I kept getting subtle bugs, like resolution not accounting for pixel ratio s
12votes
2answers
2.0kviews

Breakout prompt where the bricks shatter and the ball leaves a trail

I've built Breakout a hundred times and it's always the same flat rectangles blinking out of existence. This time I wanted the destruction to feel physical: bricks that crack, shatter into shards, and
24votes
2answers
2.8kviews

Output contract that makes the model write code future-me won't hate

My gripe isn't that AI code is wrong, it's that it is unmaintainable: 80-line functions, clever one-liners, no seams for testing, magic numbers everywhere. It passes review by looking confident. I sto
16votes
1answers
1.7kviews

Prompt for a CSV-to-chart tool that picks the chart type instead of me

I wanted an internal tool where an analyst pastes any CSV and gets a defensible chart without choosing a type. My first attempt just always drew a bar chart, which is nonsense for two numeric columns.
22votes
0answers
2.3kviews

Planning-loop prompt that makes an agent decompose before it touches any tools

Our agents were too eager. Given a task they'd immediately start editing files, then discover halfway through that the approach was wrong and thrash. Latency and token cost ballooned from all the back
19votes
1answers
2.9kviews

How I get GPT to scaffold a whole repo (folder tree contract) instead of a single file dump

0-to-1 is my whole thing, so I want the model to lay down a real repo I can take the wheel on, not one 600-line file I have to explode by hand. What finally worked was treating the folder tree as a si