Prompt engineering is mostly not about clever phrasing. It's about giving the model the information it needs and being specific about what you want. Five habits cover most of it.

1. State the situation, not just the request

"Add a login" produces generic code for a project the model imagines. "Add a login to this Express app which already uses Postgres and stores users in a users table like this, and I'm deploying to Railway" produces code that fits.

The stack, the constraints, the versions, what already exists. Every detail you omit is a detail the model will invent.

2. Say what you don't want

Negative constraints do more work than positive ones. "No frameworks", "don't restructure the existing code", "don't add dependencies", "no TypeScript". These prevent whole categories of unhelpful output.

3. Ask for the plan before the code

The single highest-value habit in this whole site. A plan takes ten seconds to read and reveals a misunderstanding before four hundred lines are built on it.

4. Give it an example

Pasting an existing file that does something similar outperforms any amount of description. Models copy patterns extremely reliably and follow prose instructions less reliably. If you want your new endpoint to look like your existing ones, show one.

5. Make uncertainty acceptable

Models default to confident answers because that's what they've been rewarded for. Explicitly permitting "I don't know" changes what you get:

uncertainty.txt
If you're not confident about any part of this, say so explicitly
rather than guessing. Tell me what you'd need to check.

I would much rather have "I'm not sure whether that method exists in
version 3" than a confident answer that turns out to be wrong.

The one to drop

Elaborate role-play preambles — "you are a world-class senior engineer with 20 years of experience" — do very little on modern models. The context and the constraints do the work. Spend your effort on what you're actually building rather than on incantations.

If you're rewriting a prompt for the third time, the problem is missing information, not phrasing. Add context instead of rewording.