Skip to content
Founder Workflows
BrowseSaved
Browse by stage

Write AI test specifications before implementation, or hide the function body from a fresh test-writing chat

A small-SaaS developer reports a double-refund bug despite passing AI-generated tests. Their revised Claude Code routine separates test specifications from implementation and uses a fresh chat for diff review.

ClaimedProduct creationSmall SaaSAI-assisted manual work

Evidence: The author reports this. We have not checked it beyond reading the source.

The business problem

Tests generated alongside AI-written code can repeat its mistaken assumptions.

What was tried

The commenter now either writes the test specification first or opens a fresh chat with only the function signature and docstring, withholding the implementation body. For code review, they open another chat on the diff without the original session's context. They also reduced CLAUDE.md from roughly 400 lines to 80, keeping rules and project gotchas.

What was reported (mixed)

u/FarExperience1359 says an earlier AI-written refund flow passed tests but refunded one order twice. They provide no measured defect rate after changing the routine.

Limitations

One developer's account; no code, tests or incident report. Independent context is a review technique, not proof of correctness. No exact prompt supplied.

What you need

A function signature/docstring or test specification and a code diff.

Sources

Source published: unknown. Last reviewed here: October 26, 2026. Spot a mistake? Tell us.

Tools in this workflow

Get new workflows like this by email

A short selection of the most useful new workflows, including the ones that did not work. Free, and you can unsubscribe at any time.

Your email address

Related workflows