Stop tweaking your user prompts. (Do this instead)

Stop tweaking your user prompts. (Do this instead)

Why is finding a good article cover so hard?

I spent way too much time manually creating banners for my blog posts. Every. Single. Time.

So, I built Article Banner to do it for me in seconds. No complex design tools, no "generic" stock photos—just clean, professional covers that make people actually want to click your technical articles.

It’s live on Product Hunt today and I’d love your feedback (and support!):

Check it out

Most devs treat the system prompt as an afterthought. One vague sentence, maybe two. Then they spend hours tweaking the user message wondering why the output is inconsistent. The system prompt is your contract with the model. Get it right once and every response gets better – across Claude, GPT, Gemini, Mistral, all of them.

The anatomy of a good system prompt

Four things. Role, context, output format, constraints. In that order. Nothing else is required.

bash
const system = `
You are a senior frontend engineer reviewing pull requests.

Context: the codebase is a React 19 app using TypeScript strict mode.
The team values readability over cleverness.

Output format:
- Start with a one-line verdict: APPROVE, REQUEST CHANGES, or DISCUSS
- List specific issues with file and line references
- End with one concrete suggestion for improvement

Constraints:
- Never rewrite the entire diff, only comment on what matters
- Skip praise, be direct
- Max 200 words
`;

That system prompt will produce consistent, structured, useful reviews every single time. Swap in any model. The output shape stays the same.

The one technique that changes everything

Tell the model what not to do. Models are trained to be helpful and verbose. Negative constraints cut the noise faster than positive instructions:

bash
// weak - leaves room for fluff
"Be concise and helpful."

// strong - closes the escape hatches
"Do not add preamble. Do not summarize what you are about to do.
Do not end with 'let me know if you need anything.'
Start your response with the answer."

Use XML tags to separate concerns. Every major model (Claude, GPT-4o, Gemini) is trained to respect XML-style delimiters in prompts. Wrap context, examples, and instructions in tags so the model knows exactly what role each block plays. <context>, <examples>, <rules> – the model treats tagged blocks as distinct inputs, not one big string.

Why this beats prompt tweaking

  • One fix, every response. A better system prompt improves every single call without touching the user-facing code.
  • Provider-agnostic. The same system prompt structure works on Claude, OpenAI, Gemini, Mistral, and local models via Ollama. No migration cost when you switch.
  • Testable. Treat your system prompt like source code. Version it, diff it, test it against a set of inputs before shipping changes.

The fastest way to improve an AI feature is almost never a better model. It is a better system prompt. Upgrade the prompt first, reach for a bigger model only if it still falls short.

Happy coding!
Marko