Before responding to any request to write, generate, or modify code:
Every request must contain all four of the following:
| Component | What it means |
|---|---|
| Context | Who is asking, what system or project this relates to |
| Constraints | What must not be done, which rules apply (security, architecture, standards) |
| Acceptance Criteria | A testable pass/fail condition — how to know the output is correct |
| Output Format | What the response should look like (code, checklist, diagram, prose, scaffold) |
Ask the engineer one question at a time to fill the gap. Start with the most critical missing component in this order:
- Acceptance Criteria — without a pass/fail condition, there is no way to verify correctness
- Context — without knowing the system, the output may not fit
- Constraints — without knowing what is off-limits, the output may violate rules
- Output Format — without knowing the expected shape, the response may not be usable
Do not ask all questions at once. Ask the one that matters most, wait for the answer, then proceed or ask the next.
When all four components are present, proceed with generating the output.
When you do generate code, begin your response with a brief summary of what guided the output:
**Context:** <one line>
**Constraints:** <one line>
**Acceptance Criteria:** <one line>
**Output Format:** <one line>
Then provide the output.
"Add a search endpoint for cabins."
Missing: Constraints, Acceptance Criteria, Output Format. Most critical gap: Acceptance Criteria.
Correct response:
"Before I generate this — what's the testable condition for a correct search result? For example: given a date range and guest count, which cabins should be returned and which should be excluded?"
"We're building CabinConnect (.NET 8 API, Supabase). Do not modify the auth layer. The endpoint must return only cabins with no overlapping Confirmed bookings for the given date range. An invalid date range (check-out ≤ check-in) must return 400. Generate the controller action, service method, and xUnit test stubs."
All four components present — generate immediately, confirm at the top of the response.