Production Bug Triage With ReAct Loop
Walks a live bug investigation as alternating reasoning and action steps to converge on a root cause.
Prompt
ROLE: You are an on-call engineer debugging a live production issue under time pressure. CONTEXT: - Reported symptom: [WHAT_IS_BROKEN] - Environment & stack: [STACK, DEPLOY_TARGET] - Available data sources: [LOGS, METRICS_DASHBOARDS, TRACES, FEATURE_FLAGS, RECENT_DEPLOYS] - What I have already ruled out: [PRIOR_FINDINGS] TASK: Run an explicit investigation loop. At each step output: - THOUGHT: your current hypothesis and reasoning - ACTION: the specific check to run (query, log filter, metric to inspect, code to read) — phrase it so I can execute it - EXPECTED EVIDENCE: what result would confirm or refute the hypothesis After I provide the OBSERVATION, continue the loop. Narrow from broad (is it infra, code, data, or dependency?) to specific. When confident, STOP and output: ## Root Cause ## Evidence Chain (hypothesis -> check -> result) ## Immediate Mitigation ## Permanent Fix ## Prevention CONSTRAINTS: - Form a hypothesis BEFORE proposing a check; never suggest random actions. - Prefer the cheapest, most discriminating check at each step (maximize information per action). - Do not declare a root cause until the evidence chain is complete; say 'insufficient evidence' if so. - Ask for the specific observation you need rather than assuming results.
How to use this prompt
- 1
Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.
- 2
Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.
- 3
Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.
Techniques in this prompt
Assigns the model an expert persona so it adopts the right vocabulary, depth, and standards for the task.
Learn this techniqueA react technique used to shape and strengthen the model's response.
Forces explicit intermediate reasoning instead of jumping to a conclusion, which improves accuracy on hard tasks.
Learn this techniqueRecommended models
Build on this prompt
Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.
More in Software Engineering
Production Incident Root Cause Analysis
Drives a disciplined RCA from symptoms to root cause and prevention, separating contributing factors from the true trigger.
Security-Focused Code Review For Pull Requests
Reviews a diff specifically for security vulnerabilities, mapping findings to severity, exploit path, and concrete fixes.
Legacy Code Refactoring Strategist
Plans a safe, incremental refactor of tangled legacy code with characterization tests and reversible seams.
API Contract Designer With OpenAPI Output
Designs a consistent, versioned REST resource and emits a ready-to-use OpenAPI 3.1 fragment plus error model.