VprompOpen Vpromp

Vpromp / AI prompts for debugging that lead to a testable fix

AI prompts for debugging that lead to a testable fix

A useful debugging prompt describes a failure someone else could reproduce. Give the AI the expected behavior, actual behavior, relevant code, and constraints. Then ask it to separate evidence from hypotheses and explain how to verify the proposed fix. Start with one failing behavior instead of asking it to repair an entire application.

Collect a small reproduction before asking for a fix

Record the exact sequence that triggers the problem. Include whether it happens every time, only after a refresh, or only with a particular input. A screenshot can show a visual symptom, but a text error and a short code excerpt often provide more useful debugging context.

Share the environment details that could change the diagnosis: framework, relevant version, browser, and whether this is a local or production build. Use information you can confirm. Remove tokens, cookies, customer details, and unrelated source files from the material you send.

Worked example: a form sends the same request twice

Imagine a contact form that submits twice when its button is clicked quickly. The goal is to prevent accidental duplicate submissions while preserving retry behavior after failure. The prompt should not decide the cause before the code has been inspected.

Task: Investigate duplicate submissions in this contact form.
Expected: one request while a submission is pending; after a failed request the user can retry.
Actual: two rapid clicks produce two requests in the browser network panel.
Reproduction: enter valid values, click Send twice quickly, inspect the requests.
Context: [framework and relevant version], [component and submit handler], [redacted request details].
Constraints: preserve field validation and error messages; do not change the API contract.
Output: identify evidence for the likely cause, propose a minimal patch, and explain how to check success, failure, and retry behavior. If the supplied code is insufficient, ask for the missing section.

Ask for evidence before accepting the explanation

Several causes could produce similar symptoms: repeated event handlers, an unintended form submission, a retry mechanism, or missing pending-state handling. Ask the assistant to point to the code or observation supporting its diagnosis. A confident explanation is still a hypothesis until checked.

If the assistant can run tools, require it to report the exact checks it ran and their results. If it cannot access the project, ask for commands or manual steps you can run yourself. Do not treat suggested tests as completed tests.

Define what passing means

For the example, check that a normal submission succeeds, rapid repeated clicks do not create multiple pending requests, invalid fields still block submission, and a server error leaves a usable retry path. Also check keyboard submission; disabling mouse clicks alone may miss another route through the form.

Client-side prevention may improve the interface without protecting against every duplicate request. If duplicate processing has consequences, ask a separate backend question about the existing handling of retries and duplicate requests. Keep that decision explicit instead of silently expanding a small interface fix.

Follow-up: The first request now succeeds, but after a server error the button stays disabled. Review the pending-state reset on both success and failure. Keep the duplicate-click protection and add a check that retries remain possible.

Turn the investigation into a reusable prompt

Use Vpromp to organize the goal, context, constraints, and expected output before sharing the request with your chosen coding assistant. Update the prompt when new evidence changes the diagnosis. A clearer request helps focus the investigation; it does not replace reviewing the patch or running appropriate checks.

Try Vpromp