CODE REVIEW / A WORKED STARTING POINT
Review a change for a concrete failure
Ask for a reproducible defect tied to the supplied contract, not a generic checklist or invented repository context.
Template reviewed
WHEN TO USE IT
You can give the reviewer a small change and the behaviour it must preserve.
Bring these inputs
- {{contract}}
- The relevant data assumptions and expected result.
- {{code}}
- A small code excerpt with a filename or other stable location.
01 / THE PROMPT
A template you can inspect.
Review the supplied code against its contract. Report concrete defects that can be demonstrated from this material.
For each finding, give the location, a minimal triggering input, expected behaviour, observed or statically derived behaviour, and the smallest relevant fix. Label a result as derived unless you actually ran it. Do not claim access to files, callers or tests that were not supplied. Skip speculative performance claims, style preferences and praise. If no concrete defect is established, say so and list any missing evidence.
Contract:
{{contract}}
Code:
{{code}}
Copying does not run the prompt. Workbench opens an editable draft with the example inputs. It does not save or send it.
02 / THE EXAMPLE TARGET
What a useful result should contain.
This is a target for the worked example, not a recorded model response. Equivalent wording can be valid where the task allows it.
orders.js uses || to default quantity, which also replaces zero. lineTotal({ price: 12, quantity: 0 }) should return 0 but returns 12. Use an explicit missing-value default, such as quantity ?? 1 under the supplied contract, and add the zero-quantity regression test.
03 / JUDGE THE RESULT
Check the answer, not the confidence.
- The finding names zero as the trigger and 12 versus 0 as the failure.
- It does not claim that unrelated callers or tests were inspected.
- The suggested change preserves valid zero values.
The worked example is a target to inspect, not a saved response from a model. Use the checks to judge an actual result.
This template was revised during the September prompt review. The earlier text remains in Git history.
Read the prompt collection review ↗