>_ BuildaPrompt
TEXT en

Test-First Bug Fixing Approach

Test-First Bug Fixing Approach — a ready-to-use text prompt with customizable fields (bug) for Roleplay & Personas. Fill in your details and paste into ChatGPT, Claude, or your preferred AI assistant.

How to use it

  1. Fill in bug below (or keep the suggested defaults).
  2. Copy the generated prompt.
  3. Paste it into ChatGPT, Claude, or your preferred AI assistant.

Pairs well with Character — try running them back to back.

Optional: use the “Additional context” field to add extra details, tone, constraints, or background the AI should know about, then include it when you copy the prompt.

Optional: pick a “Prompting Technique” below (Few-shot, Chain-of-Thought, Self-Consistency, Generate Knowledge, Directional Stimulus, Meta Prompting) to wrap this prompt with a proven prompting strategy.

The base 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.

Want it filled in and enhanced? Use the builder →

Related prompts