$npx -y skills add byungjunjang/jangpm-meta-skills --skill reflectSession wrap-up and fix-learning capture skill. Use when the user explicitly asks for "/reflect", "reflect", "session reflect", "end session", "세션 정리", "오늘 한 거 정리", or "마무리", or when the user clearly confirms that a concrete issue from the current coding session is fixed ("고쳐졌다",
| 1 | # Reflect |
| 2 | |
| 3 | Wrap up a session or capture one confirmed fix as reusable project knowledge. |
| 4 | |
| 5 | - Default architecture: single agent, inline analysis, no task-based subagents |
| 6 | - Explicit invocation runs **Full Reflect** |
| 7 | - Confident fix confirmation runs **Quick Reflect** |
| 8 | - When uncertain, prefer doing less: no-op instead of saving weak learnings |
| 9 | |
| 10 | ## Mode Selection (first) |
| 11 | |
| 12 | Choose the mode before doing any work. |
| 13 | |
| 14 | - **Full Reflect**: the user explicitly asks for `"/reflect"`, `reflect`, `session reflect`, `end session`, `세션 정리`, `오늘 한 거 정리`, or `마무리` |
| 15 | - **Quick Reflect**: the user clearly confirms that a concrete issue from the current coding session is now fixed |
| 16 | |
| 17 | Quick Reflect requires all of the following: |
| 18 | |
| 19 | 1. The recent conversation contains a real bug, implementation issue, or debugging thread |
| 20 | 2. The user's latest message is a concrete fix confirmation, not casual acknowledgment |
| 21 | 3. The repo state or recent turns provide enough evidence to explain the problem and fix |
| 22 | 4. At least one reusable learning can be stated cleanly |
| 23 | |
| 24 | If those conditions are not met, do not save anything. |
| 25 | |
| 26 | If both modes seem possible, explicit invocation wins and you run **Full Reflect**. |
| 27 | |
| 28 | ## Storage Model |
| 29 | |
| 30 | - Canonical records live in `docs/solutions/<category>/<id>.md` |
| 31 | - `docs/solutions/index.json` is a derived artifact |
| 32 | - Never append blindly to `index.json`; rebuild it from solution docs after every write |
| 33 | - Categories: `bug-fix`, `pattern`, `tool-usage`, `architecture`, `workflow` |
| 34 | - Keep frontmatter fields consistent across all solution docs |
| 35 | |
| 36 | ## First Run Initialization |
| 37 | |
| 38 | If `docs/solutions/index.json` does not exist: |
| 39 | |
| 40 | 1. Create `docs/solutions/` |
| 41 | 2. Create subdirectories: `bug-fix/`, `pattern/`, `tool-usage/`, `architecture/`, `workflow/` |
| 42 | 3. Create `docs/solutions/index.json` with `[]` |
| 43 | 4. Briefly note the initialization only when reflection output is already being shown |
| 44 | |
| 45 | ## Quick Reflect |
| 46 | |
| 47 | Purpose: capture one high-signal resolved issue without turning every "fixed" into a save. |
| 48 | |
| 49 | ### 1. Run the Eligibility Gate |
| 50 | |
| 51 | - Review the last 5-10 turns plus relevant repo context |
| 52 | - Require a resolved problem plus a concrete cause or fix |
| 53 | - Reject casual confirmations, speculative ideas, or vague "it works now" statements with no evidence |
| 54 | - Save at most **one** learning in Quick Reflect |
| 55 | |
| 56 | If the eligibility gate fails during implicit invocation: |
| 57 | |
| 58 | - do not create or modify files |
| 59 | - do not emit a reflection block |
| 60 | |
| 61 | ### 2. Extract One Candidate Learning |
| 62 | |
| 63 | Capture: |
| 64 | |
| 65 | - concise title |
| 66 | - category |
| 67 | - 2-4 tags |
| 68 | - `Problem` |
| 69 | - `Solution` |
| 70 | - `Key Insight` |
| 71 | - optional `Context` |
| 72 | |
| 73 | ### 3. Check Overlap |
| 74 | |
| 75 | Read `docs/solutions/index.json`. |
| 76 | |
| 77 | For the candidate learning: |
| 78 | |
| 79 | - compare tags and title keywords against existing entries |
| 80 | - if there is a likely match, read the existing solution doc before deciding |
| 81 | - classify as `NEW`, `REINFORCE`, or `SUPERSEDE` |
| 82 | |
| 83 | ### 4. Save the Learning |
| 84 | |
| 85 | For all write paths below, rebuild `index.json` after the document updates. |
| 86 | |
| 87 | **NEW** |
| 88 | |
| 89 | - Generate ID `sol-YYYYMMDD-NNN` |
| 90 | - Write `docs/solutions/<category>/<id>.md` |
| 91 | - Set: |
| 92 | - `confidence: 0.50` |
| 93 | - `created: YYYY-MM-DD` |
| 94 | - `last_reinforced: YYYY-MM-DD` |
| 95 | - `reinforcement_count: 0` |
| 96 | - `supersedes: null` |
| 97 | - `superseded_by: null` |
| 98 | |
| 99 | **REINFORCE** |
| 100 | |
| 101 | - Read the existing solution doc |
| 102 | - Update frontmatter: |
| 103 | - `confidence += 0.15` with cap `0.95` |
| 104 | - `last_reinforced = today` |
| 105 | - `reinforcement_count += 1` |
| 106 | - Append to `## Context` only when there is genuinely new information |
| 107 | |
| 108 | **SUPERSEDE** |
| 109 | |
| 110 | - Update the old doc with `superseded_by: <new-id>` |
| 111 | - Lower old confidence to `min(current_confidence, 0.25)` |
| 112 | - Create the new doc with `supersedes: <old-id>` and `superseded_by: null` |
| 113 | |
| 114 | ### 5. Rebuild `index.json` |
| 115 | |
| 116 | Read all solution docs under `docs/solutions/**` and write a JSON array containing: |
| 117 | |
| 118 | - `id` |
| 119 | - `title` |
| 120 | - `tags` |
| 121 | - `category` |
| 122 | - `confidence` |
| 123 | - `created` |
| 124 | - `last_reinforced` |
| 125 | - `reinforcement_count` |
| 126 | - `supersedes` |
| 127 | - `superseded_by` |
| 128 | - `related` |
| 129 | |
| 130 | Sort by: |
| 131 | |
| 132 | 1. `confidence` descending |
| 133 | 2. `last_reinforced` descending |
| 134 | 3. `id` ascending |
| 135 | |
| 136 | ### 6. Confirm Briefly |
| 137 | |
| 138 | Use a short confirmation only when reflection output is appropriate: |
| 139 | |
| 140 | - `📚 Saved: [title] (new, confidence: 0.50)` |
| 141 | - `📚 Reinforced: [title] (0.50 -> 0.65)` |
| 142 | - `📚 Superseded: [old-id] -> [new-id]` |
| 143 | |
| 144 | ## Full Reflect |
| 145 | |
| 146 | Purpose: explicit wrap-up after substantial work. |
| 147 | |
| 148 | ### 1. Inspect Session State |
| 149 | |
| 150 | Collect concrete evidence first: |
| 151 | |
| 152 | - current workspace structure |
| 153 | - files changed in this session from repo state and recent turns |
| 154 | - relevant documentation files for the work just completed |
| 155 | - existing `doc |