# Debugging Complex, Intermittent, or Distributed System Bugs
## Problem Context
In modern microservice architectures, a bug is rarely in one place. It involves tracing requests across multiple services, databases, and message queues, which is "hard-to-trace" and described as "the worst part of debugging".
## Solution Pattern: ai-debugging-partner
The "AI Debugging Partner": Performs Root Cause Analysis (RCA) by synthesizing stack traces, logs, and code snippets to suggest hypotheses and fixes.
## Multi-Step Workflow
This is a multi-step process. Follow each step in order:
### Step 1: Step 1: Provide all context
AI receives logs from multiple services, stack traces, and code snippets
**Prompt Template:**
[Customize this step based on your specific needs]
Instructions:
- Follow the step description: Step 1: Provide all context - AI receives logs from multiple services, stack traces, and code snippets
- Adapt the template to your context
- Provide clear, actionable output
### Step 2: Step 2: Root Cause Analysis
AI applies "5 Whys" technique and identifies recurring patterns
**Prompt Template:**
[Customize this step based on your specific needs]
Instructions:
- Follow the step description: Step 2: Root Cause Analysis - AI applies "5 Whys" technique and identifies recurring patterns
- Adapt the template to your context
- Provide clear, actionable output
### Step 3: Step 3: Suggest fix
AI proposes code fixes for the most likely root cause
**Prompt Template:**
[Customize this step based on your specific needs]
Instructions:
- Follow the step description: Step 3: Suggest fix - AI proposes code fixes for the most likely root cause
- Adapt the template to your context
- Provide clear, actionable output
---
*This prompt is part of the Engify.ai research-based prompt library. Customize it for your specific context and needs.*