---
name: bug-report
type: workflow
description: "Creates a structured bug report with reproduction steps, expected vs actual behavior, environment details, and severity assessment. Use when a bug or defect is found and needs to be formally documented."
argument-hint: "[description]
/bug-report analyze [path-to-file]"
user-invocable: true
allowed-tools: Read, Glob, Grep, Write
effort: 1
when_to_use: "When reporting a bug, creating a structured bug report, or analyzing code to identify potential defects"
When invoked with a description:
Parse the description for key information.
Search the codebase for related files using Grep/Glob to add context.
Generate the bug report:
# Bug Report
## Summary
**Title**: [Concise, descriptive title]
**ID**: BUG-[NNNN]
**Severity**: [S1-Critical / S2-Major / S3-Minor / S4-Trivial]
**Priority**: [P1-Immediate / P2-Next Sprint / P3-Backlog / P4-Wishlist]
**Status**: Open
**Reported**: [Date]
**Reporter**: [Name]
## Classification
- **Category**: [Business / UI / Audio / Visual / Performance / Crash / Network]
- **System**: [Which product system is affected]
- **Frequency**: [Always / Often (>50%) / Sometimes (10-50%) / Rare (<10%)]
- **Regression**: [Yes/No/Unknown -- was this working before?]
## Environment
- **Build**: [Version or commit hash]
- **Platform**: [OS, hardware if relevant]
- **Scene/Level**: [Where in the product]
- **Product State**: [Relevant state -- inventory, quest progress, etc.]
## Reproduction Steps
**Preconditions**: [Required state before starting]
1. [Exact step 1]
2. [Exact step 2]
3. [Exact step 3]
**Expected Result**: [What should happen]
**Actual Result**: [What actually happens]
## Technical Context
- **Likely affected files**: [List of files based on codebase search]
- **Related systems**: [What other systems might be involved]
- **Possible root cause**: [If identifiable from the description]
## Evidence
- **Logs**: [Relevant log output if available]
- **Visual**: [Description of visual evidence]
## Related Issues
- [Links to related bugs or design documents]
## Notes
[Any additional context or observations]
When invoked with analyze:
- Read the target file(s).
- Identify potential bugs: null references, off-by-one errors, race
conditions, unhandled edge cases, resource leaks, incorrect state
transitions.
- For each potential bug, generate a bug report with the likely trigger
scenario and recommended fix.
Protocol
- Question: Parses description argument; asks for clarification if reproduction steps or severity are missing
- Options: Skip — single report format (or
analyze mode for static code scan)
- Decision: Skip
- Draft: Structured report shown in conversation before saving
- Approval: "May I write BUG-[NNN] to
[filepath]?"
Output
Deliver exactly:
- Bug report with: title, severity (Critical/High/Medium/Low), reproduction steps, expected vs actual behavior, environment, and suggested fix
/bug-report analyze mode: list of potential bugs found with file:line, trigger scenario, and recommended fix per issue
1---2name: bug-report3description: ---4---5---6name: bug-report7type: workflow8description: "Creates a structured bug report with reproduction steps, expected vs actual behavior, environment details, and severity assessment. Use when a bug or defect is found and needs to be formally documented."9argument-hint: "[description]10/bug-report analyze [path-to-file]"11user-invocable: true12allowed-tools: Read, Glob, Grep, Write13effort: 114when_to_use: "When reporting a bug, creating a structured bug report, or analyzing code to identify potential defects"15---1617When invoked with a description:18191. **Parse the description** for key information.20212. **Search the codebase** for related files using Grep/Glob to add context.22233. **Generate the bug report**:2425```markdown26# Bug Report2728## Summary29**Title**: [Concise, descriptive title]30**ID**: BUG-[NNNN]31**Severity**: [S1-Critical / S2-Major / S3-Minor / S4-Trivial]32**Priority**: [P1-Immediate / P2-Next Sprint / P3-Backlog / P4-Wishlist]33**Status**: Open34**Reported**: [Date]35**Reporter**: [Name]3637## Classification38- **Category**: [Business / UI / Audio / Visual / Performance / Crash / Network]39- **System**: [Which product system is affected]40- **Frequency**: [Always / Often (>50%) / Sometimes (10-50%) / Rare (<10%)]41- **Regression**: [Yes/No/Unknown -- was this working before?]4243## Environment44- **Build**: [Version or commit hash]45- **Platform**: [OS, hardware if relevant]46- **Scene/Level**: [Where in the product]47- **Product State**: [Relevant state -- inventory, quest progress, etc.]4849## Reproduction Steps50**Preconditions**: [Required state before starting]51521. [Exact step 1]532. [Exact step 2]543. [Exact step 3]5556**Expected Result**: [What should happen]57**Actual Result**: [What actually happens]5859## Technical Context60- **Likely affected files**: [List of files based on codebase search]61- **Related systems**: [What other systems might be involved]62- **Possible root cause**: [If identifiable from the description]6364## Evidence65- **Logs**: [Relevant log output if available]66- **Visual**: [Description of visual evidence]6768## Related Issues69- [Links to related bugs or design documents]7071## Notes72[Any additional context or observations]73```7475When invoked with `analyze`:76771. **Read the target file(s)**.782. **Identify potential bugs**: null references, off-by-one errors, race79 conditions, unhandled edge cases, resource leaks, incorrect state80 transitions.813. **For each potential bug**, generate a bug report with the likely trigger82 scenario and recommended fix.8384## Protocol8586- **Question**: Parses description argument; asks for clarification if reproduction steps or severity are missing87- **Options**: Skip — single report format (or `analyze` mode for static code scan)88- **Decision**: Skip89- **Draft**: Structured report shown in conversation before saving90- **Approval**: "May I write BUG-[NNN] to `[filepath]`?"9192## Output9394Deliver exactly:9596- **Bug report** with: title, severity (Critical/High/Medium/Low), reproduction steps, expected vs actual behavior, environment, and suggested fix97- **`/bug-report analyze` mode**: list of potential bugs found with file:line, trigger scenario, and recommended fix per issue