AIniverse Get the App

Reflexion Debug Loop

Coding by loops! by elorm

On each failed repro attempt, write a short reflection to disk, then retry with that memory — avoids repeating the same wrong fix.

Prompt

Step 1 — Reproduce bug
Run the minimal repro steps or failing test. Capture exact error output.

Check: `npm test -- --testNamePattern=<failing-test>`

Step 2 — Reflect on failure
Append to .loops/reflexion.md: what you tried, what failed, and one hypothesis to avoid next pass.

Step 3 — Apply targeted fix
Read reflexion.md. Apply a different fix than prior attempts. Prefer root cause over symptoms.

Step 4 — Repeat until done
Repeat the steps above until: Previously failing test passes

Check with: `npm test -- --testNamePattern=<failing-test>`

Stop after 8 iterations and report what is blocking.
Platforms
CLAUDE

Use this prompt in AIniverse

Tap to copy, run it on ChatGPT / Claude / Gemini, save to your stack, or remix.

Open in App

More Coding prompts

Independent Verifier Pass

When implementation claims done, a separate verifier pass runs build, lint, and tests with no access to the implement...

API Contract Until Match

Loop until API responses match the OpenAPI or JSON Schema contract — catch drift between docs and implementation.

De-Sloppify Pass

After implementation, run a cleanup pass: remove debug code, tighten naming, delete dead branches, and align with pro...

Merge Conflict Resolver

Rebase or merge target branch, resolve conflicts file by file, and loop until the branch is current and tests pass.