Skip to content

Instantly share code, notes, and snippets.

@BadAsstronaut
Created November 12, 2025 07:11
Show Gist options
  • Select an option

  • Save BadAsstronaut/a410306358b0eb698a1fce9fa4520a6d to your computer and use it in GitHub Desktop.

Select an option

Save BadAsstronaut/a410306358b0eb698a1fce9fa4520a6d to your computer and use it in GitHub Desktop.
# Generic Debugging Prompt Template
## Bug Report Structure
**Issue:** [Feature X] is not working as expected in some cases.
**Observed Behavior:** [Specific error message or unexpected behavior observed]
**Expected Behavior:** [What should happen under normal circumstances]
**Desired Outcome:** [Clear definition of success criteria]
---
## Debugging Objective
**Goal:** IDENTIFY the entire chain of execution for [Feature X] without initially looking for errors or issues. The objective is to discover the end-to-end functionality of this part of the system.
Instead of reading whole code files and cluttering context, use targeted search to find only the explicit relationships in the dependency graph. This approach keeps you focused on the business logic of the interactions rather than getting lost in each code file/module.
**Key Constraint:** Don't read whole files. Use find, grep, and similar tools to do laser-focused detective work.
**Deliverable:** Create a `[feature_name]_process.md` document reflecting the results of your findings. Use code file/line references and specific names, but do not include code snippets in the result. The result should be a semantic description of all possible paths for [Feature X] functionality from [starting point] to [end point].
---
## Investigation Approach
You must stay focused and be targeted and conservative with your discovery process. You are highly skeptical and you understand that the code represents "ground truth," therefore you don't think about or look at anything except the code.
To diagnose a problem, we must understand the end-to-end behavior. To do that, we must stay focused on this specific piece of application functionality.
---
## Instructions Summary
1. Map the complete execution flow without hunting for bugs initially
2. Use targeted searches (grep, find, etc.) rather than reading entire files
3. Focus on tracing the dependency graph and business logic
4. Document the flow with file/line references but without code snippets
5. Stay skeptical and let the code be your only source of truth
6. Maintain narrow focus on the specific feature in question
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment