Identify the Bug and Context
Select a specific bug, usually from a bug report or a GitHub issue. This document should clearly describe the failure and provide enough detail for the AI to understand the problem.
Leverage an AI coding assistant like Claude Code to implement a Test-Driven Development (TDD) process. This workflow allows you to reproduce, fix, and verify bug fixes with incredible speed and accuracy.


Source episode · 36:26
How Gusto Built a New Product Line in 10 Weeks with Claude Code, No Jira, and No Docswith Claire Vo
From 36:26 to 39:38, Eddie Kim demonstrates fixing a payroll bug in Claude Code by first creating an evaluation that reproduces the failure, then changing the code until it passes. Clip range: 36:26 to 39:38.
A pull request containing a failing regression test, the implemented fix, and passing test results.
Claude for coding tasks
Step by step
Follow the sequence once, then adapt the prompts, checks, and handoffs to your own setup.
6 steps
Select a specific bug, usually from a bug report or a GitHub issue. This document should clearly describe the failure and provide enough detail for the AI to understand the problem.
In your AI coding assistant, provide a prompt that points to the GitHub issue. Instruct the AI to follow a test-driven development (TDD) process: first, write a test that reproduces the bug and fails; second, propose a fix; and third, prove the fix works by showing the test now passes.
There's a customer issue that is outlined in this GitHub issue... Can you please read this issue and come up with a fix for the problem that's outlined here? I'd love for you to first write an eval that fails to show that you can reproduce this issue, then come up with a solution, and then prove that the solution works by showing that the eval now passes.
The AI reads the issue and generates a test case, or evaluation, designed to fail. This failing test serves as confirmation that the AI can successfully reproduce the bug as described.
The AI then proposes a solution, which could be a code change or a modified prompt. It runs the same evaluation again, this time expecting it to pass. The passing test is the proof that the proposed fix works.
Review the AI's proposed code change and the test case. Use your judgment to verify that the fix is correct, high quality, and does not introduce any unintended side effects.
Once you approve the solution, instruct the AI to open a pull request. This prepares the change for team review and merging into the main codebase.
This looks correct. Please open a pull request with the title "[PR Title]" and the following description: [Describe the fix and link to the original issue].
Turn an idea into a PRD, user stories, and a plan.
After the steps
How to recover when the loop fails and where human judgment helps.
Recover
Keep building

Automate and accelerate executive-level tasks by using AI agents integrated with your business tools. Learn how to use prompts to redesign Figma slides, analyze sales calls for insights, and generate lead lists from your email.

Go beyond simple automation by creating a system that measures its own performance and improves itself. Learn to track metrics, score AI agent runs to find failures, and use observer agents to automatically fix your factory's code.

Learn how to automate your software development lifecycle, turning a simple Slack request into a fully implemented, tested, and QA-verified pull request in GitHub, reflecting a true software factory model.
Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.