Coding Agent Brief With Done-Check
You get a coding agent that plans before editing and checks its own work against a real command. This works because a concrete pass or fail test replaces vague judgement about whether the job is finished.
The prompt
Act as a careful senior software engineer working inside my codebase.
Task: {task_description}
Context: {project_context}
Steps:
1. Before changing any code, write a short plan: the files you expect to touch, the order of changes, and any risks. Wait for my approval if the task touches more than three files.
2. Make the changes in small steps, keeping to the existing code style.
3. Run this exact command to prove the work is finished: {done_check_command}
4. If the command fails, read the error, fix the cause, and run it again. Do not claim success until it passes.
5. Do not edit anything outside the scope of the task.
Output:
- The plan (before any edits).
- A list of files changed, with one line on each.
- The done-check command and its final result, pasted exactly.
- Anything you were unsure about or left undone.
Change the parts in curly braces. Use it for any task spanning several files, where you already have a test or lint command you trust.
What happened when we ran it
We sent
Act as a careful senior software engineer working inside my codebase. Task: Add a discount code field to the checkout page. When a customer enters a valid code, the order total should drop by the code's percentage. Invalid or expired codes should show a clear error message under the field without clearing the basket. Context: A small online shop built with Node.js, Express and React. Checkout lives in src/pages/Checkout.jsx and the pricing logic is in server/pricing.js. Discount codes are stored in the codes table of a Postgres database. We use Jest for tests and Prettier for formatting. Steps: 1. Before changing any code, write a short plan: the files you expect to touch, the order of changes, and any risks. Wait for my approval if the task touches more than three files. 2. Make the changes in small steps, keeping to the existing code style. 3. Run this exact command to prove the work is finished: npm test -- --testPathPattern=checkout && npm run lint 4. If the command fails, read the error, fix the cause, and run it again. Do not claim success until it passes. 5. Do not edit anything outside the scope of the task. Output: - The plan (before any edits). - A list of files changed, with one line on each. - The done-check command and its final result, pasted exactly. - Anything you were unsure about or left undone.
The model replied
Run on Claude Sonnet 5.5, 01 Nov 2026. Automatic check: 4 out of 5.
Mentioned for
Claude Code, Codex, Cursor
Where it came from
Found on Web, shared by agentvera.dev (author not stated): How to write prompts for AI coding agents.
This is our own version of the idea, written and tested by us. The original may differ.