---
description: Systematic root cause analysis with parallel agent investigation
argument-hint: <issue or symptom to diagnose>
allowed-tools: Task, Read, Write, Edit, Glob, Grep, Bash
---

Investigate the root cause of: $ARGUMENTS

## Instructions

Load the `root-cause-analyst` skill, then follow its protocol:

### What This Command Does

1. **Triage** - Categorize the symptom (error, performance, data, security, infra)
2. **Parallel investigation** - Launch 1-5 investigation threads with Task tool
3. **Synthesize** - Collect findings, identify corroboration and contradictions
4. **Propose root causes** - With confidence scores and evidence
5. **Solution spectrum** - Patch (quick), Fix (direct), Proper (architectural)

### Investigation Focus Areas

| Signal | Investigation Focus |
|--------|---------------------|
| Stack trace, panic, error | Code paths, error handling |
| Slow, timeout, latency | Bottlenecks, queries, I/O |
| Data missing, corrupt | Storage layer, data flow |
| Auth, permission denied | Auth middleware, token flow |
| Infra, deploy, env | Config, networking, resources |
| Test failures | Test setup, mocks, assertions |
| Race condition, deadlock | Concurrency, shared state |
| Security, injection | Input validation, sanitization |

### Expected Output

```markdown
## Issue Triage

**Symptom:** [What's happening]
**Category:** [error | performance | data | security | infra]
**Investigation Threads:** [List with rationale]

---

## Investigation Results

### Thread 1: [Focus Area]
[Summary of what was found]

### Thread 2: [Focus Area]
[Summary of what was found]

---

## Root Causes

### #1: [Name] (Confidence: X%)
**Evidence:** ...
**Mechanism:** ...

---

## Recommended: Root Cause #1

### Patch (Quick)
[Minimal change]

### Fix (Direct)
[Address root cause]

### Proper (Architectural)
[Prevent class of issues]
```

## Critical Rules

- NEVER propose root cause without citing investigation findings
- NEVER skip investigation (coordinate, don't guess)
- NEVER give 100% confidence (always leave room for unknowns)
- ALWAYS offer at least patch and proper solutions
- ALWAYS launch investigation threads in parallel when possible
