$npx -y skills add giuseppe-trisciuoglio/developer-kit --skill bug-fix-briefGenerates a structured Bug Fix Brief (BFB) to document issue corrections. Includes root cause analysis, repro steps, fix options, and fix checklist. Use when user asks to create a BFB, document a bug fix, or generate a bug correction document.
| 1 | # Bug Fix Brief (BFB) |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | This skill generates a Bug Fix Brief (BFB): a structured document in `docs/bfb/` that uniformly captures every bug fix with root cause, repro steps, fix options, and checklist. |
| 6 | |
| 7 | ## When to Use |
| 8 | |
| 9 | - User asks to create a BFB |
| 10 | - User wants to document a bug fix in a structured way |
| 11 | - After identifying the root cause of a bug and before implementing the fix |
| 12 | |
| 13 | **Trigger:** "create BFB", "document bug", "bug fix brief", "document fix" |
| 14 | |
| 15 | ## Instructions |
| 16 | |
| 17 | ### Phase 1: Gather Information |
| 18 | |
| 19 | Check existing numbering: |
| 20 | ```bash |
| 21 | ls docs/bfb/ 2>/dev/null || echo "Directory does not exist" |
| 22 | ``` |
| 23 | |
| 24 | Ask the user for: |
| 25 | - BFB number (or propose next sequential) |
| 26 | - Concise title (3-5 words, kebab-case) |
| 27 | - Issue link (e.g. #1287) |
| 28 | - Environment (Prod/Stg/Dev) + version |
| 29 | - Observed vs expected behavior |
| 30 | - File/function/line of the cause |
| 31 | |
| 32 | ### Phase 2: Generate Template |
| 33 | |
| 34 | Complete the full BFB template: |
| 35 | |
| 36 | ```markdown |
| 37 | ## BFB-XXX: [Title] |
| 38 | |
| 39 | **Reference:** [Issue link] |
| 40 | **Environment:** [Env] `vX.Y.Z` |
| 41 | **Date:** YYYY-MM-DD |
| 42 | |
| 43 | --- |
| 44 | |
| 45 | ### 1. Bug |
| 46 | - **Observed:** [wrong behavior] |
| 47 | - **Expected:** [correct behavior] |
| 48 | |
| 49 | ### 2. Repro |
| 50 | ``` |
| 51 | 1. ... |
| 52 | 2. ... |
| 53 | → [error/output] |
| 54 | ``` |
| 55 | |
| 56 | ### 3. Cause |
| 57 | `path/file.ext` — `function()` @ line N |
| 58 | [Why it happens, max 3 lines] |
| 59 | |
| 60 | ### 4. Decision |
| 61 | | Option | Fix | Choice | |
| 62 | |--------|-----|--------| |
| 63 | | A | [desc] | ✅/❌ | |
| 64 | | B | [desc] | ✅/❌ | |
| 65 | |
| 66 | **Rationale:** [why] |
| 67 | |
| 68 | ### 5. Fix |
| 69 | - [ ] [change 1] |
| 70 | - [ ] [test] |
| 71 | - [ ] [verify repro] |
| 72 | |
| 73 | ### 6. Notes |
| 74 | [recurring patterns, links, warnings] |
| 75 | ``` |
| 76 | |
| 77 | ### Phase 3: Ask Confirmation |
| 78 | |
| 79 | Show the generated BFB and ask with AskUserQuestion: |
| 80 | - "Create the BFB" |
| 81 | - "Edit before creating" |
| 82 | - "Cancel" |
| 83 | |
| 84 | ### Phase 4: Write to Disk |
| 85 | |
| 86 | Only after approval: |
| 87 | ```bash |
| 88 | mkdir -p docs/bfb |
| 89 | ``` |
| 90 | |
| 91 | Write to `docs/bfb/BFB-XXX-title.md` |
| 92 | |
| 93 | ## Examples |
| 94 | |
| 95 | **Input:** "create BFB for login email null crash" |
| 96 | |
| 97 | **Final output:** |
| 98 | ```markdown |
| 99 | ## BFB-042: Login crash with null email |
| 100 | |
| 101 | **Reference:** #1287 |
| 102 | **Environment:** Prod `v2.4.1` |
| 103 | **Date:** 2026-05-02 |
| 104 | |
| 105 | --- |
| 106 | |
| 107 | ### 1. Bug |
| 108 | - **Observed:** App crashes if email field is empty |
| 109 | - **Expected:** Error message "Email required" |
| 110 | |
| 111 | ### 2. Repro |
| 112 | ``` |
| 113 | 1. Open login screen |
| 114 | 2. Tap "Login" without entering email |
| 115 | → NullPointerException @ AuthManager.kt:34 |
| 116 | ``` |
| 117 | |
| 118 | ### 3. Cause |
| 119 | `AuthManager.kt` — `validateEmail()` @ line 34 |
| 120 | Missing null check on email.trim() |
| 121 | |
| 122 | ### 4. Decision |
| 123 | | Option | Fix | Choice | |
| 124 | |--------|-----|--------| |
| 125 | | A | Add safe call `?.` | ✅ | |
| 126 | | B | Refactor with Result type | ❌ | |
| 127 | |
| 128 | **Rationale:** Option A is minimal, zero impact. |
| 129 | |
| 130 | ### 5. Fix |
| 131 | - [ ] Add `email?.trim()?.isNotEmpty() == true` |
| 132 | - [ ] Test `validateEmail_null_returnsFalse()` |
| 133 | - [ ] Verify repro |
| 134 | |
| 135 | ### 6. Notes |
| 136 | - Check other forms for missing null checks |
| 137 | ``` |
| 138 | |
| 139 | ## Best Practices |
| 140 | |
| 141 | 1. **Sequential numbering**: BFB-001, BFB-002, no gaps |
| 142 | 2. **Concise title**: 3-5 words, kebab-case in filename |
| 143 | 3. **Root cause**: exact file, function, line |
| 144 | 4. **2+ fix options**: with pros/cons and rationale |
| 145 | 5. **Verifiable checklist**: each item must be testable |
| 146 | |
| 147 | ## Constraints and Warnings |
| 148 | |
| 149 | - **Confirmation required**: Always ask before writing |
| 150 | - **Max 3 lines for cause**: Stay concise |
| 151 | - **Directory `docs/bfb/`**: Create if it does not exist |