Debuggingprompt onlyIntermediate

Reproduce and Fix

This loop guides you through reproducing a reported bug, identifying its root cause, implementing a fix, and verifying the solution through automated testing. The agent will iteratively work to resolve the issue while maintaining system integrity.

← all loops
debuggingregression-testingbug-fixautomated-debuggingcode-validation

Goal

Resolve reported bug

How to Run

Run this loop by providing a bug report and context. The agent will automatically reproduce, fix, and validate the solution.

  1. 01

    Install Agent

    Ensure your coding environment supports prompt-driven agents (Cursor, Claude Code, Codex, etc.)

  2. 02

    Provide Bug Context

    Share the bug report, error messages, and any relevant code snippets with the agent

  3. 03

    Execute Loop

    Invoke the agent with the kickoff prompt and let it self-pace through the debugging workflow

  4. 04

    Wait for Resolution

    The agent will exit once the regression test confirms the bug is fixed or reaches max iterations

Workflow Steps

  1. 01

    Reproduce Bug

    Recreate the exact conditions of the reported bug using provided context and logs

  2. 02

    Analyze Code

    Examine source files related to the bug, focusing on error stack traces and component interactions

  3. 03

    Identify Root Cause

    Determine the underlying logic or implementation error causing the bug

  4. 04

    Implement Fix

    Apply minimal, targeted code changes to address the identified root cause

  5. 05

    Run Regression Test

    Execute automated tests to verify the fix resolves the bug without introducing side effects

  6. 06

    Validate Solution

    Confirm the fix meets all requirements by checking exit conditions and test results

Kickoff Prompt

Start the "Reproduce and Fix" loop.

Goal: Resolve reported bug
Max iterations: 10
Between iterations run: bug regression test
Exit when: Bug test passes


I need your help resolving a bug in my codebase. Please start by reproducing and fixing the following issue: [PASTE_BUG_REPORT_HERE]. Include any error logs, failing tests, or unexpected behavior descriptions. Then run the 'bug regression test' command to verify your solution.

Self-pace this loop. After each iteration, run `bug regression test` and evaluate the output, and only continue if the exit condition is not met (Bug test passes). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.

Guardrails

hardcoded
  • ·Never modify unrelated files or introduce new features beyond the bug fix
  • ·Prioritize existing test suites to validate changes
  • ·If regression tests fail, revert changes and try alternative approaches
  • ·Respect codebase conventions and architectural patterns
  • ·Document all changes with clear commit messages

Flow Diagram

rendering…

Related loops — Debugging