
Give a coding agent six prompts to take a loose request from the first brief to a test you can rerun. In the November 30, 2026 example below, Hypothesis caught a small failure with a clear cause. An interval merger took two ranges covering 0 and 2 and added the point in between.

Use a function you can run locally. The fixture works with closed integer intervals and Hypothesis 6.170.24. Substitute your own task for the bracketed details in each prompt.
1. Name the result and set a baseline
A large target can push the agent to consider a different design. You might ask for a 100x speedup, half the code without lost functionality, a property test for each past bug, or a proof or counterexample for an implicit invariant. These are candidate goals. Before approving a patch, measure what the current code does and name the behavior each option must preserve.
Aim for [measurable result] from [current baseline and how it was measured]. Give me two ways to get there. For each, name what changes, what must still work, and the evidence that would show an improvement. If there are prior bugs, flag the ones a shared property might catch. Bring me the options before editing.
2. Have the agent read the brief back to you
Ask for a restatement in everyday words. In the example, “merge adjacent ranges” means [0, 0] and [1, 1] can join. It also means [0, 0] and [2, 2] leave a gap. A short readback is enough to expose a different interpretation before it reaches the code. Claude Code best practices
Restate the goal, the problem I am trying to solve, the workflow you expect to follow, and what will count as done. List any assumptions separately. Wait for me to confirm before changing files.
3. Invite one question at a time
After the readback, clear up the questions that can change the implementation. Can endpoints arrive in reverse order? Will all callers use integers? Put one borderline input on the table and decide what the output should look like. Anthropic gives a similar interview pattern for an incomplete spec. Claude Code interview example
Interview me about the decisions, inputs, checks, and escalation rules I have left out. Ask one question at a time and start with the one most likely to change the implementation. Walk me through a normal case and a boundary case. Get my feedback before automating the workflow.
4. Follow one requirement down to evidence
The interval example needs an oracle for covered points. For a small input, expand each interval into integers and put those integers in a set. Compare the set before and after the merge. That gives Hypothesis a property to check across generated input, including inputs nobody thought to list in the brief. Hypothesis quickstart
Keep the scope fixed. Before you rewrite my task, answer four questions:
1. What would an expert check here that I did not ask about?
2. Which primary source, specification, or record should we start from?
3. What method and tools would we use?
4. What evidence could someone else rerun to confirm or falsify the result?
Rewrite the task with those answers and keep the original permissions and scope.
5. Define the words that change the test
An interval merge preserves coverage when its output contains exactly the same integers as its input. Two disjoint closed integer intervals are adjacent when no integer falls between them. If a term still feels fuzzy, have the agent show you where different definitions would produce different outputs. The public pstack skills include prompts for finding vocabulary and sharpening an existing task. Cursor pstack reframe skill · sharpen skill
I am missing the vocabulary for [desired behavior]. Suggest 8 to 12 terms or related approaches and define each in plain language. Pick the terms that affect acceptance. Give me a matching and a nonmatching example for each. Confirm what I mean before rewriting the requirement.
6. Keep the check that catches the repeat failure
Run a short brief against a small fixture and save the first failing input. Save instructions you want to reuse as a skill. If the same mistake turns up again, turn the relevant rule into an executable check. An AGENTS.md file can tell Codex which command to run. The test can also run in CI, where a failing check can block a merge. OpenAI AGENTS.md guide
Reproduce the bug with the smallest failing input you can find. Record the expected and actual result. Add the rule to the existing test suite, show that it fails on the buggy version, then rerun it with the fix. Include the exact command and output in the handoff.

Save the fixture as intervals.py. The bounds keep the test oracle small. Each endpoint is between -10 and 10, and a generated list has at most eight intervals.
from hypothesis import given, settings, strategies as st
def merge(intervals):
merged = []
for start, end in sorted(intervals):
if merged and start <= merged[-1][1] + 1:
previous_start, previous_end = merged[-1]
merged[-1] = (previous_start, max(previous_end, end))
else:
merged.append((start, end))
return merged
def covered_points(intervals):
return {point for start, end in intervals for point in range(start, end + 1)}
interval = st.tuples(st.integers(-10, 10), st.integers(-10, 10)).map(
lambda bounds: tuple(sorted(bounds))
)
@settings(max_examples=100, derandomize=True, database=None)
@given(st.lists(interval, max_size=8))
def test_merge_preserves_points(intervals):
assert covered_points(merge(intervals)) == covered_points(intervals)
if __name__ == "__main__":
test_merge_preserves_points()
print("PASS: merge preserves covered points")
With uv installed, run this from the directory containing the file:
uv run --no-project --with hypothesis==6.170.24 python intervals.py
The fixture prints PASS: merge preserves covered points. To see the regression, change + 1 to + 2 in the merge condition and rerun the command. Hypothesis reports [(0, 0), (2, 2)]. The faulty merge returns [(0, 2)], which includes 1. Restore + 1 and keep the property in your suite. The next person can check the same rule with the same command.
FAQ
How does a property test differ from an example-based test?
A property test checks a general rule on generated inputs. An example-based test saves a case you already know, such as [(0, 0), (2, 2)]. Keep both if the concrete case helps explain how the bug occurred.
What does a passing Hypothesis run prove here?
The run checks coverage equality for the generated inputs under the stated bounds. It gives you evidence about that property. If callers also require sorted output, nonoverlapping ranges, or performance on large inputs, add checks for those requirements.
Sources
About the author
Crafting seamless user experiences with a passion for headless CMS, Vercel deployments, and Cloudflare optimization. I'm a Full Stack Developer with expertise in building modern web applications that are blazing fast, secure, and scalable. Let's connect and discuss how I can help you elevate your next project!
Comments
Join the discussionNo comments yet. Be the first to comment.





