---
name: Initialize Debug Investigation
description: Gather context, reproduce the bug, and perform initial analysis
next_step: step-01-analyze
---

## Step 00: Initialize Debug Investigation

### Objective
Gather all necessary context about the bug, reproduce it in a controlled manner, and establish the foundation for deep analysis.

### Actions

#### 1. Parse Input and Gather Context

- Extract the provided log/error message carefully
- Extract key error patterns, stack traces, and symptoms
- Identify error types: runtime, compile-time, logic, performance
- **CRITICAL**: Document exact error context and reproduction steps

#### 2. Classify Bug Scope

Determine investigation scope using the Decision Matrix:

| Condition | Action |
|-----------|--------|
| Simple error, obvious from stack trace | NO team — investigate inline |
| Error involves code + data | Team: `code-investigator` + `data-inspector` |
| Error involves unknown library | Team: `code-investigator` + `doc-researcher` |
| Complex bug, multiple suspects | Full team: all 3 agents |
| Performance issue (no error) | `code-investigator` only (profiling inline) |

#### 3. Decision: Inline or Team Investigation?

**If team NOT needed** → Proceed directly to step-01-analyze with inline investigation.

**If team needed** → Create team and spawn teammates in step-01-analyze.

### Initial Analysis Checklist

- [ ] Error message parsed and documented
- [ ] Stack trace (if available) extracted and categorized
- [ ] Reproduction steps identified or attempted
- [ ] Error context documented (environment, user actions, etc.)
- [ ] Error type classified (runtime/compile/logic/performance)
- [ ] Investigation scope determined (inline vs. team)

### Success Metrics

- All available context about the error is documented
- Error classification is clear and justified
- Investigation approach (inline vs. team) is decided
- Ready to proceed to deep root cause analysis

### Next Step

Proceed to **step-01-analyze** for deep root cause analysis.
