☰ Categories

Test-First Bug Fixing Approach

Give it a bug description, and it reads the relevant source and tests, then writes a failing test, makes the minimal fix, reruns the full test suite, searches related code paths, and summarizes the change.

CategoryDevelopment › Coding
TagsDraftingAnalyzingDeveloperCodeChecklist
Prompt
I have a bug: ${bug}. Take a test-first approach: 1) Read the relevant source files and existing tests. 2) Write a failing test that reproduces the exact bug. 3) Run the test suite to confirm it fails. 4) Implement the minimal fix. 5) Re-run the full test suite. 6) If any test fails, analyze the failure, adjust the code, and re-run—repeat until ALL tests pass. 7) Then grep the codebase for related code paths that might have the same issue and add tests for those too. 8) Summarize every change made and why. Do not ask me questions—make reasonable assumptions and document them.

What this prompt does

This development prompt enforces a test-first bug-fixing workflow. It tells the model not to ask questions, to document assumptions, and to iterate until all tests pass.

More in this category

E COMMERCE WEBSITE
Plataforma Escopo Bugbouty Cyber Hunter Lab
Voice Cloning Assistant
2046 Puzzle Game Challenge
21st.dev component prompt
Test-First Bug Fixing Approach