Skip to content AI News: GPT-6 Astra edited a small Qwen model's weights and cut its runaway loops →
PH-1105 · Code prompt

Tests That List Ambiguities First

Before writing tests, the model lists every place the spec or code is ambiguous, and for each expected value it says whether it came from the spec, the current code or a guess.

What you get

Before writing tests, the model lists every place the spec or code is ambiguous, and for each expected value it says whether it came from the spec, the current code or a guess.

What you need
  • 4 blanks to fill in: for example Python + pytest… one sentence paste code paste spec, or write "none"
Best inClaude CodeAlso works in any coding agent
203 words
Prompt · November 3, 2026
I want you to act as a test engineer who doesn't guess behaviour silently. I'll give you a function or module and whatever spec exists for it.

Language and test framework: [for example Python + pytest, TypeScript + Vitest]
What the code is for: [one sentence]

Before writing any test:
1. List every ambiguity you find: inputs the spec doesn't cover (empty, null, huge, duplicates, time zones, rounding), conflicts between the spec and the code, and errors with no defined behaviour. Number them.
2. For each, give your proposed expected behaviour and ask me to confirm or correct it. Wait for my answers.

Then write the tests:
- Next to every expected value, add a short comment saying where it came from: spec (quote it), current code (say which line), or my answer to ambiguity number N.
- Never mark a value as coming from the spec when it only came from reading the code. A test that only freezes current behaviour gets the comment "current code" so a reviewer can see it.
- Group the tests by behaviour, one assertion idea per test, with names that say what breaks.

The code:
[paste code]

The spec or ticket:
[paste spec, or write "none"]
Coding Claude Code

How to use it

  1. Fill the blanks under «Make it yours» — the prompt updates as you type.
  2. Copy the prompt and paste it into Claude Code.
  3. Not quite right? Reply with what to change — the model keeps the rest.

More Claude Code prompts

PH-0708Coding

Bug Reproduction Test

Writes a failing test first, explains the real cause, then makes the smallest fix and runs the whole suite.

You fill in describe the bug, how to…

Claude Code
PH-0922Data & Analytics

Sheets Formula Builder

Writes, explains and debugs Google Sheets formulas from a plain description of your tabs and columns.

You fill in Sheet1AB+1 more

Gemini
PH-0760Writing

Docs Draft Polisher

Line-edits any Google Doc you link, returning a tightened draft plus a change log while keeping your voice and required terms.

You fill in confirm figurerequired terminologywho will read this+3 more

Gemini
PH-0739Business

Contract Clause Reviewer

Paste any agreement into Claude and get a clause-by-clause risk review with exact quotes, plain-English explanations and suggested redlines…

You fill in the freelancercountrypayment terms and IP ownership

Claude
Weekly

New prompts in your inbox

One email a week: the best new prompts and one short guide. Confirm by email and get the free Prompt Cheat Sheet (PDF). Unsubscribe any time. Privacy policy