Guide
How to write prompts that coding agents understand
Agents follow constraints better than vibes. Ask for one change, name the files, and say what must not happen.
Answer
A prompt an agent can follow names the outcome, the files it may touch, and the things it must not add. Short prompts beat a paragraph of taste. The copyable ones on this page are starters, not magic.
Beginner path
The shape of a prompt
Use four lines, in this order:
- What should exist when you are done.
- Which files or pages it may change.
- What it must not add.
- How you will check.
Update the homepage headline to "Tip the band".
Only edit the homepage file.
Do not add a new font, a new package, or a login form.
I will check by reloading the page."Make it pop" is not a check. "The headline reads Tip the band" is a check.
When it did the wrong thing
Quote the wrong behavior. Do not insult the model, and do not paste secrets into the apology.
The homepage still shows the old headline.
Look at the homepage file only.
Set the visible heading to "Tip the band".
Tell me the file you changed.More starters live in the prompt library, grouped by task.
Advanced path
Constraints that belong in a file
If you repeat a rule every session, move it. AGENTS.md is the open format several agents already look for, including Cursor and the Windsurf lineage now called Devin Desktop. The agents.md site describes it as a README for agents: build commands, test commands, and conventions.
A strong rule is executable: "run pnpm test before you finish." A weak rule is "write clean code."
Also name the model when the vendor's plan changes what you can call. Cursor Plus is Grok-only. Copilot Free is auto model selection. Those are plan facts, and they matter more than a prompt adjective like "think harder."
Next step
Questions
Should I paste my whole codebase into the chat?
No. Point the agent at the repo, or paste the one error and the one file. A giant paste burns the context window and still misses files.
Why did it ignore my style note?
Style notes at the end of a long prompt get lost. Put constraints first, or put them in AGENTS.md so every session sees them.