Code is unforgiving
A slightly vague blog post is still readable. Slightly vague code doesn't run. Code prompts need more precision than any other kind, and the output always needs testing.
If you don't write code, read this for the principles (precision, real input, and verification apply everywhere) and skip the Try it.
Writing a code request
Include:
- Language and version: "Python 3.12", "TypeScript with React 19"
- Environment: framework, libraries you already use, where it runs
- Inputs and outputs: with an example of each
- Edge cases: empty input, bad data, very large input
- Constraints: "no new dependencies", "match this existing function's style"
Write a TypeScript function that takes an array of order objects ({id: string, total: number, createdAt: string ISO date}) and returns the total revenue per calendar month as {"2026-01": 1234.5, ...}.
Handle an empty array and invalid dates (skip them and count how many were skipped).
No external libraries. Include three example calls with expected results.
Debugging
Give the model what a colleague would need:
- The exact error message, copied, not paraphrased
- The code around it, not just the line that failed
- What you expected and what happened instead
- What you've already tried
Then ask for a diagnosis before a fix: "List the likely causes, most likely first, and how to check each one. Then suggest a fix for the most likely." That's chain-of-thought for debugging.
Review everything
- Run it. Generated code can look right and still fail.
- Ask for tests: "Write unit tests for the edge cases you handled."
- Ask for assumptions: "List anything you assumed about my setup." Wrong assumptions are the most common cause of broken output.
- Watch for invented functions. Models sometimes call library functions that don't exist.
Specialists in Ace
In Ask Ace, @Mentor (Pair Programmer Mentor) explains as it goes, @QA focuses on tests, and @Sentinel reviews for security problems.
Try it
If you write code, take a real small task or bug and write the prompt using the checklist above. Send it to @Mentor in Ask Ace, then ask @QA for tests of the result.