AI Debugging Chain-of-Thought Assistant
Apply systematic chain-of-thought reasoning to diagnose and fix complex bugs, with step-by-step analysis, hypothesis testing, and a clear fix with explanation.
Content
I need help debugging the following issue using chain-of-thought reasoning: **Language/Framework:** {{language_framework}} **Bug Description:** {{bug_description}} **Expected Behavior:** {{expected_behavior}} **Actual Behavior:** {{actual_behavior}} **Error Message (if any):** ``` {{error_message}} ``` **Relevant Code:** ``` {{code_snippet}} ``` **What I Already Tried:** {{tried_so_far}} Please diagnose this using chain-of-thought reasoning: ## Step 1: Understand the System Explain what the code is supposed to do, and identify the key components involved. ## Step 2: Identify Suspects List all possible root causes, ranked by likelihood. For each: - Why it could be the cause - Evidence for / against ## Step 3: Trace the Execution Path Walk through exactly what happens at runtime, step by step, pinpointing where the behavior diverges from expectation. ## Step 4: Hypothesis Testing For the top 2 hypotheses, describe a minimal test to confirm or eliminate them. ## Step 5: The Fix - Provide the corrected code - Explain WHY this fixes it (not just what changed) - Note any side effects or edge cases to watch ## Step 6: Prevention How to prevent this class of bug in future code.
Related Prompts
API Documentation Writer (Developer-Friendly)
Generates comprehensive, developer-friendly API documentation from endpoint specs, including descriptions, request/response examples, error codes, and SDK snippets.
Parallel Agent Task Decomposer
Breaks a complex software project or task into parallelisable sub-tasks suitable for running multiple AI coding agents simultaneously in isolated git branches.
Parallel Coding Task Brief Generator
Break a complex software feature into parallel, independent coding tasks that multiple AI agents or developers can work on simultaneously without conflicts.
Agentic AI App Architecture Planner
Designs the technical architecture for AI agent-powered applications, including agent types, tool definitions, memory systems, and orchestration patterns for 2026-era AI development.