By the end of this lesson you will know exactly why a prompt came back wrong, and which of the four gaps to fill first.
You need: a coding agent (Codex, Claude Code, Cursor, Antigravity or any other) · Time: 7 minutes
Four voices talk to the agent at the same time. From strongest to weakest:
- Your message in this chat. Nothing beats it.
- The closest rules file in the folder tree. A file next to your code wins over one at the top of the project.
- The tool's own system prompt. It decides the default behaviour, tone and tool use.
- Its training. The patterns it picked up from reading millions of projects.
The AGENTS.md standard states the rule in one line: the closest file to the edited file wins, and explicit chat prompts override everything.
Why?This is why "the AI ignored my rule" almost always means the rule was written in a weaker voice than the thing that contradicted it. Your rule was in a file at the top; the code it contradicted was described in your chat message.
So when you write a prompt you are not talking to a blank brain. You are arguing with a very confident default. Every strong prompt is written to beat that default.
A prompt is a brief. When a brief has a hole in it, the agent does not stop and ask. It fills the hole with the most common thing it has seen: the average of the internet.
The four gaps, and the guess each one turns into. Notice what each guess costs you. A wrong goal costs a whole rebuild. A missing stop rule costs an hour undoing edits you never asked for. The most expensive gaps are not the ones people worry about.
Put in order Put the four guesses in the order the agent makes them
Tap the steps in the order you would do them. Tap a placed step to remove it.
- 1
Why?The fill happens silently. You do not get an alert that says "I guessed three things". You get code that looks confident and is wrong in three places at once.
You cannot fix gaps you cannot see. Take the last prompt you sent to an agent and read it line by line, looking only for these four things:
Gap The question to ask Healthy answer looks like Goal Does one sentence say what "finished" is? "A page listing today's tasks with a tick box" Context Who is it for, what exists, which files? "Beginner, empty folder, phone-first, see app.js"Finish line What will I run or click to check it? "Reload the page and the tick is still there" Stop rules What must it not change, and when must it ask? "Do not touch the billing screen. Ask before installing" Most beginners find two or three gaps in a prompt they were sure was clear. That is normal, and it is the whole skill.
TipCopy the four questions into your prompt file as a checklist. Reading them takes 20 seconds and saves the rebuild.
The brief is yours. The defaults are not. Codex, Claude Code, Cursor and Antigravity each bring their own system prompt, tools and rules discovery, so the same brief can land three different ways:
What differs What it changes for you Which files it reads without being asked Your rules file may be read, ignored, or read only in one folder Which tools it has One tool can open a browser and check the screen; another can only edit files How it asks for approval One stops before every command; another runs and reports after How it edits One shows a diff you accept line by line; another writes the file directly NoteThis is not a bug to work around. It is the reason a prompt that works in Cursor is not automatically a prompt that works in Claude Code. Write the brief tool-neutral, then add one line for the tool's quirks.
Match them Match each slot with the guess it removes
Tap an item on the left, then its meaning on the right.
Do not rewrite everything. Add one line, then watch what changes. The order that pays off fastest:
- Stop rules first. One line prevents the damage that takes longest to undo.
- Finish line second. It turns "trust me" into something you can check.
- Context third. One sentence about who you are and which files matter.
- Goal last, because usually your goal was fine and the other three were missing.
Prompt · copy it into your AI agentBefore you change anything, answer these four lines and nothing else. Do not write code yet. Goal: [what finished looks like, in one sentence] Context: [who I am, what exists, which files matter] Finish line: [the exact check I will run to accept the work] Stop rules: [files or screens you must not touch, and when you must ask me first] After each line, tell me which one is empty or vague, and ask me one question to fill it.
Why?Asking the agent to audit your brief is cheaper than asking it to build. You get the gaps for the price of a few hundred tokens instead of a broken build.
- Four voices reach the agent: your message, the closest rules file, the tool's system prompt, and its training. Your message is the strongest.
- A prompt is a brief. Every empty slot gets filled by the average of the internet, silently.
- The four gaps are goal, context, finish line and stop rules.
- Fill stop rules and the finish line first; they prevent the expensive damage.
- Ask the agent to audit your brief before it builds. Next: the 7-slot brief that fills all four gaps at once.
Create a free account to save your progress and open every lesson. Create free account