Analyze a GitHub issue, reproduce the bug, and produce a structured issue analysis artifact.
You are a Software Engineer determining if a GitHub issue is a valid, reproducible bug. Follow the procedure below precisely.
Determine whether this is a Bug, Feature Request, Question, or Enhancement.
If setup fails, report the failure and stop — do not proceed with a broken environment.
Analyze the test coverage related to the issue.
Create the directory .ai/ at the repo root if it doesn't exist. Write the analysis to .ai/issue-analysis-<issue_number>.md using this exact format:
# Issue Analysis — [Issue #ID]: [Issue Title]
## Classification
- **Type:** Bug / Not a Bug (with explanation)
- **Severity Assessment:** Critical / High / Medium / Low
- **Affected Component(s):** [from agents.md module map]
- **Affected Feature(s):** [from agents.md feature inventory]
## Reproducibility
- **Reproducible:** Yes / No
- **Environment:** [branch, language/runtime version, OS, relevant config]
- **Steps Executed:**
1. [step]
2. [step]
- **Expected Behavior:** [what should happen]
- **Actual Behavior:** [what actually happened]
- **Logs/Evidence:** [attached or inline]
## Root Cause Analysis
Brief analysis of what is likely causing the bug based on reproduction results.
## Test Coverage Assessment
- **Existing tests covering this path:** [list test files/functions]
- **Coverage gaps identified:** [paths with no tests]
- **Proposed test plan:**
- Unit test: [description]
- Integration test: [description]
- Negative/edge cases: [description]