Basic: one task, one prompt
Works in any chat box: Grok, ChatGPT and Codex, Claude, Gemini.
GOAL: [one sentence: what should be true when you're done]
CONTEXT: [only the files, links, errors or data that matter. Name them exactly.]
CONSTRAINTS: [must and must not: stack, style, budget, what not to touch]
DONE WHEN: [a check that passes or fails: a test passes, a page loads, a list has 10 items with links]
OUTPUT: [format and length, e.g. "a bullet list, max 10 lines, each with a link"]For anything bigger than one file, add two lines:
BEFORE YOU START: read the relevant files and tell me your plan in 3-5 bullets. Wait for my OK.
WHEN YOU FINISH: list every file you changed and the exact command you ran to check it.Why each line is there
- Goal. All four vendors put a clear, specific request first. xAI: “state the task, constraints, and output format directly.”
Sources OpenAI Codex: Best practices undatedAnthropic: Prompting best practices undatedGoogle: Prompt design strategies (Gemini API) undatedxAI: Best practices Oct 20, 2026
- Context. Name the files and paste the real error. Claude Code’s guide: “If you name the file, describe the symptom, and say what ‘fixed’ looks like up front, you usually save yourself a round of corrections later.”
Sources Claude Code: Best practices undatedOpenAI Codex: Best practices undatedGoogle: Prompt design strategies (Gemini API) undated
- Constraints. Say what to do and what not to do. Google: “You can tell the model what to do and not to do.”
Sources Google: Prompt design strategies (Gemini API) undatedOpenAI Codex: Best practices undated
- Done when. OpenAI names this line “Done when.” Anthropic: “Give Claude something it can run that comes back pass or fail.”
Sources OpenAI Codex: Best practices undatedClaude Code: Best practices undated
- Output. Ask for the format you want, so you don’t have to reformat the answer.
Source xAI: Best practices Oct 20, 2026
- Plan first. Reading before editing catches wrong guesses early. Anthropic’s guide includes the line “Never speculate about code you have not opened.” One exception: OpenAI’s Codex prompting guide, written for teams building their own agent tools, says not to force upfront plans inside automated runs, because the model can stop early. Use the plan-first line in chat, not in automated runs.
Sources Anthropic: Prompting best practices undatedOpenAI Cookbook: Codex prompting guide Feb 25, 2026
Filled in
GOAL: Fix the bug where [what happens] when [steps to reproduce]. Expected: [what should happen].
CONTEXT: Error message: [paste the exact error or log]. It probably lives in [file or area, if known].
CONSTRAINTS: Smallest possible fix. Don't refactor or rename anything else.
DONE WHEN: You can explain the root cause in one paragraph, and [repro steps] now give the expected result. If tests exist, they still pass.GOAL: Compare the monthly price and usage limits of [tool A] and [tool B] for one developer.
CONTEXT: Use only the vendors' own pricing and help pages. I code about [hours] a week.
CONSTRAINTS: No reviews or blog posts. If a number isn't on an official page, write "Not confirmed".
DONE WHEN: Every number has a link and the date you checked it.
OUTPUT: A table with one row per plan, then 3 bullets on which plan fits me.