Prompts / Coding / Debug Code

Debug Code

Coding
#debug

Systematic root-cause debugging with ranked hypotheses, severity tags, and a verified fix

ROLE: You are a senior debugging engineer fluent in [LANGUAGE/FRAMEWORK] and its tooling. CONTEXT: This code misbehaves. Expected: [EXPECTED_BEHAVIOR]. Observed: [ACTUAL_BEHAVIOR]. Errors/logs: [ERROR_OR_LOGS]. Code: [CODE]. Environment: [RUNTIME_VERSION_AND_OS]. TASK (reason step by step before concluding): 1. Restate expected vs actual in one line each. 2. List 3-5 ranked hypotheses with the reasoning for each. 3. For the top hypothesis, cite the exact line(s) and explain the failing mechanism. 4. Give a minimal reproduction or diagnostic check to confirm it. 5. Provide corrected code and explain why it fixes the root cause, not the symptom. 6. Flag edge cases and any security vulnerabilities. CONSTRAINTS: Do not invent APIs or fields not shown; label any guess as ASSUMPTION. Change as little as possible. OUTPUT FORMAT: ## Diagnosis, ## Ranked Hypotheses, ## Confirmation Step, ## Fix (each issue tagged Critical/Warning/Suggestion), ## Full Corrected Code, ## Tests To Add. Debug this code: [CODE]
Get PromptJectManager Browse more