$npx -y skills add tranhieutt/software_development_department --skill bug-reportCreates 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.
| 1 | When invoked with a description: |
| 2 | |
| 3 | 1. **Parse the description** for key information. |
| 4 | |
| 5 | 2. **Search the codebase** for related files using Grep/Glob to add context. |
| 6 | |
| 7 | 3. **Generate the bug report**: |
| 8 | |
| 9 | ```markdown |
| 10 | # Bug Report |
| 11 | |
| 12 | ## Summary |
| 13 | **Title**: [Concise, descriptive title] |
| 14 | **ID**: BUG-[NNNN] |
| 15 | **Severity**: [S1-Critical / S2-Major / S3-Minor / S4-Trivial] |
| 16 | **Priority**: [P1-Immediate / P2-Next Sprint / P3-Backlog / P4-Wishlist] |
| 17 | **Status**: Open |
| 18 | **Reported**: [Date] |
| 19 | **Reporter**: [Name] |
| 20 | |
| 21 | ## Classification |
| 22 | - **Category**: [Business / UI / Audio / Visual / Performance / Crash / Network] |
| 23 | - **System**: [Which product system is affected] |
| 24 | - **Frequency**: [Always / Often (>50%) / Sometimes (10-50%) / Rare (<10%)] |
| 25 | - **Regression**: [Yes/No/Unknown -- was this working before?] |
| 26 | |
| 27 | ## Environment |
| 28 | - **Build**: [Version or commit hash] |
| 29 | - **Platform**: [OS, hardware if relevant] |
| 30 | - **Scene/Level**: [Where in the product] |
| 31 | - **Product State**: [Relevant state -- inventory, quest progress, etc.] |
| 32 | |
| 33 | ## Reproduction Steps |
| 34 | **Preconditions**: [Required state before starting] |
| 35 | |
| 36 | 1. [Exact step 1] |
| 37 | 2. [Exact step 2] |
| 38 | 3. [Exact step 3] |
| 39 | |
| 40 | **Expected Result**: [What should happen] |
| 41 | **Actual Result**: [What actually happens] |
| 42 | |
| 43 | ## Technical Context |
| 44 | - **Likely affected files**: [List of files based on codebase search] |
| 45 | - **Related systems**: [What other systems might be involved] |
| 46 | - **Possible root cause**: [If identifiable from the description] |
| 47 | |
| 48 | ## Evidence |
| 49 | - **Logs**: [Relevant log output if available] |
| 50 | - **Visual**: [Description of visual evidence] |
| 51 | |
| 52 | ## Related Issues |
| 53 | - [Links to related bugs or design documents] |
| 54 | |
| 55 | ## Notes |
| 56 | [Any additional context or observations] |
| 57 | ``` |
| 58 | |
| 59 | When invoked with `analyze`: |
| 60 | |
| 61 | 1. **Read the target file(s)**. |
| 62 | 2. **Identify potential bugs**: null references, off-by-one errors, race |
| 63 | conditions, unhandled edge cases, resource leaks, incorrect state |
| 64 | transitions. |
| 65 | 3. **For each potential bug**, generate a bug report with the likely trigger |
| 66 | scenario and recommended fix. |
| 67 | |
| 68 | ## Protocol |
| 69 | |
| 70 | - **Question**: Parses description argument; asks for clarification if reproduction steps or severity are missing |
| 71 | - **Options**: Skip — single report format (or `analyze` mode for static code scan) |
| 72 | - **Decision**: Skip |
| 73 | - **Draft**: Structured report shown in conversation before saving |
| 74 | - **Approval**: "May I write BUG-[NNN] to `[filepath]`?" |
| 75 | |
| 76 | ## Output |
| 77 | |
| 78 | Deliver exactly: |
| 79 | |
| 80 | - **Bug report** with: title, severity (Critical/High/Medium/Low), reproduction steps, expected vs actual behavior, environment, and suggested fix |
| 81 | - **`/bug-report analyze` mode**: list of potential bugs found with file:line, trigger scenario, and recommended fix per issue |