Bug Investigation Prompt
Systematically investigate and fix bugs with AI assistance by providing structured context.
Overview
This template helps you structure bug investigations by providing comprehensive context to AI. It guides you through documenting symptoms, expected behavior, and relevant code to get targeted debugging assistance.
When to Use
Use this when you encounter a bug that is not immediately obvious. It is especially helpful for intermittent issues, complex bugs involving multiple systems, or when you need a fresh perspective on a problem.
Instructions
- 1.Include the actual error messages, not paraphrased versions
- 2.Provide the minimal code needed to understand the issue
- 3.List what you have already tried to avoid duplicate suggestions
- 4.Include any relevant environment details (OS, browser, versions)
Customize Template
Technologies involved in the bug
Clear description of what is going wrong
What should happen normally
What is actually happening
Step-by-step instructions to trigger the bug
Programming language for syntax highlighting
The code where the bug occurs or is likely located
Any error messages, console logs, or stack traces
Solutions you have already attempted
Examples
React form not submitting correctly
Input values:
- tech_stack:
- React 18, React Hook Form, TypeScript
- bug_description:
- The checkout form submission fails silently when the user has items in their cart from multiple vendors.
- expected_behavior:
- Form should validate, submit to the API, and redirect to order confirmation
- actual_behavior:
- Form validation passes, submit button shows loading state, but the API is never called
- reproduction_steps:
- 1. Add items from vendor A to cart 2. Add items from vendor B to cart 3. Go to checkout 4. Fill in valid payment details 5. Click Submit Order
- code_language:
- typescript
- relevant_code:
- const onSubmit = async (data: CheckoutForm) => { setLoading(true); const response = await api.submitOrder(data); // ... }
- error_logs:
- No console errors. Network tab shows no request made.
- attempted_solutions:
- - Verified form validation is passing - Added console.log at start of onSubmit (not logging) - Checked that button type="submit"