Writing prompts that work
An agent never says it doesn't know. Whatever your prompt leaves out, it guesses.
Six things to say
You rarely need all six in one sentence. Your rules file can carry the permanent ones (how to run tests, which package manager), and a skill can carry the format of a recurring task.
The same request, twice
The agent searched the whole project, created src/discount.js (JavaScript, in a TypeScript project), hard-coded 10% off and wrote no test.
text
Add applyDiscount(totalCents, percent) to @src/cart.ts: 20 means 20% off,never below 0. Add tests and run them.
Right file, right rule, two tests, and the agent ran them.
Habits that pay off
- Point at files with
@pathinstead of describing them. - Show the exact output you want in quotes: "12,50 €" leaves nothing to interpret.
- Say what to keep: "keep the name formatPrice" prevents a rename that breaks every import.
- One task per prompt. Two unrelated changes in one request are harder to review.
- If the result is off, say what's wrong and why, rather than repeating the prompt louder.
- Ask questions too. "What does total() do?" changes nothing and costs little.