learnship 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/.claude-plugin/plugin.json +26 -0
  2. package/.cursor-plugin/plugin.json +26 -0
  3. package/LICENSE +21 -0
  4. package/README.md +791 -0
  5. package/SKILL.md +86 -0
  6. package/agents/debugger.md +102 -0
  7. package/agents/executor.md +115 -0
  8. package/agents/learnship-debugger.md +146 -0
  9. package/agents/learnship-executor.md +155 -0
  10. package/agents/learnship-phase-researcher.md +128 -0
  11. package/agents/learnship-plan-checker.md +119 -0
  12. package/agents/learnship-planner.md +146 -0
  13. package/agents/learnship-verifier.md +157 -0
  14. package/agents/planner.md +109 -0
  15. package/agents/researcher.md +80 -0
  16. package/agents/verifier.md +114 -0
  17. package/bin/install.js +1242 -0
  18. package/bin/learnship.js +56 -0
  19. package/commands/learnship/add-phase.md +22 -0
  20. package/commands/learnship/add-tests.md +24 -0
  21. package/commands/learnship/add-todo.md +21 -0
  22. package/commands/learnship/audit-milestone.md +21 -0
  23. package/commands/learnship/check-todos.md +22 -0
  24. package/commands/learnship/cleanup.md +22 -0
  25. package/commands/learnship/complete-milestone.md +22 -0
  26. package/commands/learnship/debug.md +27 -0
  27. package/commands/learnship/decision-log.md +22 -0
  28. package/commands/learnship/diagnose-issues.md +23 -0
  29. package/commands/learnship/discovery-phase.md +24 -0
  30. package/commands/learnship/discuss-milestone.md +23 -0
  31. package/commands/learnship/discuss-phase.md +23 -0
  32. package/commands/learnship/execute-phase.md +27 -0
  33. package/commands/learnship/execute-plan.md +26 -0
  34. package/commands/learnship/health.md +20 -0
  35. package/commands/learnship/help.md +19 -0
  36. package/commands/learnship/insert-phase.md +22 -0
  37. package/commands/learnship/knowledge-base.md +21 -0
  38. package/commands/learnship/list-phase-assumptions.md +21 -0
  39. package/commands/learnship/ls.md +20 -0
  40. package/commands/learnship/map-codebase.md +23 -0
  41. package/commands/learnship/milestone-retrospective.md +21 -0
  42. package/commands/learnship/new-milestone.md +23 -0
  43. package/commands/learnship/new-project.md +24 -0
  44. package/commands/learnship/next.md +22 -0
  45. package/commands/learnship/pause-work.md +21 -0
  46. package/commands/learnship/plan-milestone-gaps.md +22 -0
  47. package/commands/learnship/plan-phase.md +24 -0
  48. package/commands/learnship/progress.md +20 -0
  49. package/commands/learnship/quick.md +27 -0
  50. package/commands/learnship/reapply-patches.md +21 -0
  51. package/commands/learnship/release.md +21 -0
  52. package/commands/learnship/remove-phase.md +23 -0
  53. package/commands/learnship/research-phase.md +23 -0
  54. package/commands/learnship/resume-work.md +21 -0
  55. package/commands/learnship/set-profile.md +21 -0
  56. package/commands/learnship/settings.md +21 -0
  57. package/commands/learnship/transition.md +21 -0
  58. package/commands/learnship/update.md +21 -0
  59. package/commands/learnship/validate-phase.md +22 -0
  60. package/commands/learnship/verify-work.md +23 -0
  61. package/cursor-rules/learnship.mdc +60 -0
  62. package/gemini-extension.json +10 -0
  63. package/hooks/hooks-claude.json +15 -0
  64. package/hooks/hooks-cursor.json +10 -0
  65. package/hooks/session-start +43 -0
  66. package/install.sh +254 -0
  67. package/learnship/references/design-commands.md +119 -0
  68. package/learnship/references/git-integration.md +249 -0
  69. package/learnship/references/learning-design.md +142 -0
  70. package/learnship/references/model-profiles.md +90 -0
  71. package/learnship/references/planning-config.md +184 -0
  72. package/learnship/references/questioning.md +162 -0
  73. package/learnship/references/ui-brand.md +160 -0
  74. package/learnship/references/verification-patterns.md +608 -0
  75. package/learnship/templates/agents.md +166 -0
  76. package/learnship/templates/context.md +72 -0
  77. package/learnship/templates/plan.md +202 -0
  78. package/learnship/templates/project.md +184 -0
  79. package/learnship/templates/requirements.md +231 -0
  80. package/learnship/templates/state.md +176 -0
  81. package/learnship/templates/uat.md +80 -0
  82. package/learnship/workflows/add-phase.md +84 -0
  83. package/learnship/workflows/add-tests.md +191 -0
  84. package/learnship/workflows/add-todo.md +108 -0
  85. package/learnship/workflows/audit-milestone.md +178 -0
  86. package/learnship/workflows/check-todos.md +138 -0
  87. package/learnship/workflows/cleanup.md +107 -0
  88. package/learnship/workflows/complete-milestone.md +191 -0
  89. package/learnship/workflows/debug.md +245 -0
  90. package/learnship/workflows/decision-log.md +131 -0
  91. package/learnship/workflows/diagnose-issues.md +145 -0
  92. package/learnship/workflows/discovery-phase.md +183 -0
  93. package/learnship/workflows/discuss-milestone.md +136 -0
  94. package/learnship/workflows/discuss-phase.md +244 -0
  95. package/learnship/workflows/execute-phase.md +345 -0
  96. package/learnship/workflows/execute-plan.md +149 -0
  97. package/learnship/workflows/health.md +171 -0
  98. package/learnship/workflows/help.md +153 -0
  99. package/learnship/workflows/insert-phase.md +106 -0
  100. package/learnship/workflows/knowledge-base.md +168 -0
  101. package/learnship/workflows/list-phase-assumptions.md +129 -0
  102. package/learnship/workflows/ls.md +145 -0
  103. package/learnship/workflows/map-codebase.md +142 -0
  104. package/learnship/workflows/milestone-retrospective.md +178 -0
  105. package/learnship/workflows/new-milestone.md +200 -0
  106. package/learnship/workflows/new-project.md +340 -0
  107. package/learnship/workflows/next.md +100 -0
  108. package/learnship/workflows/pause-work.md +122 -0
  109. package/learnship/workflows/plan-milestone-gaps.md +160 -0
  110. package/learnship/workflows/plan-phase.md +288 -0
  111. package/learnship/workflows/progress.md +118 -0
  112. package/learnship/workflows/quick.md +256 -0
  113. package/learnship/workflows/reapply-patches.md +130 -0
  114. package/learnship/workflows/release.md +217 -0
  115. package/learnship/workflows/remove-phase.md +128 -0
  116. package/learnship/workflows/research-phase.md +137 -0
  117. package/learnship/workflows/resume-work.md +162 -0
  118. package/learnship/workflows/set-profile.md +78 -0
  119. package/learnship/workflows/settings.md +204 -0
  120. package/learnship/workflows/sync-upstream-skills.md +269 -0
  121. package/learnship/workflows/transition.md +165 -0
  122. package/learnship/workflows/update.md +166 -0
  123. package/learnship/workflows/validate-phase.md +174 -0
  124. package/learnship/workflows/verify-work.md +264 -0
  125. package/package.json +62 -0
  126. package/references/design-commands.md +119 -0
  127. package/references/git-integration.md +249 -0
  128. package/references/learning-design.md +142 -0
  129. package/references/model-profiles.md +90 -0
  130. package/references/planning-config.md +184 -0
  131. package/references/questioning.md +162 -0
  132. package/references/ui-brand.md +160 -0
  133. package/references/verification-patterns.md +608 -0
  134. package/skills/agentic-learning/SKILL.md +373 -0
  135. package/skills/agentic-learning/references/either-or-format.md +161 -0
  136. package/skills/agentic-learning/references/learning-science.md +190 -0
  137. package/skills/agentic-learning/references/struggle-ladder.md +140 -0
  138. package/skills/impeccable/SKILL.md +125 -0
  139. package/skills/impeccable/adapt/SKILL.md +199 -0
  140. package/skills/impeccable/animate/SKILL.md +190 -0
  141. package/skills/impeccable/audit/SKILL.md +129 -0
  142. package/skills/impeccable/bolder/SKILL.md +132 -0
  143. package/skills/impeccable/clarify/SKILL.md +180 -0
  144. package/skills/impeccable/colorize/SKILL.md +158 -0
  145. package/skills/impeccable/critique/SKILL.md +118 -0
  146. package/skills/impeccable/delight/SKILL.md +317 -0
  147. package/skills/impeccable/distill/SKILL.md +137 -0
  148. package/skills/impeccable/extract/SKILL.md +95 -0
  149. package/skills/impeccable/frontend-design/SKILL.md +127 -0
  150. package/skills/impeccable/frontend-design/reference/color-and-contrast.md +132 -0
  151. package/skills/impeccable/frontend-design/reference/interaction-design.md +123 -0
  152. package/skills/impeccable/frontend-design/reference/motion-design.md +99 -0
  153. package/skills/impeccable/frontend-design/reference/responsive-design.md +114 -0
  154. package/skills/impeccable/frontend-design/reference/spatial-design.md +100 -0
  155. package/skills/impeccable/frontend-design/reference/typography.md +131 -0
  156. package/skills/impeccable/frontend-design/reference/ux-writing.md +107 -0
  157. package/skills/impeccable/harden/SKILL.md +358 -0
  158. package/skills/impeccable/normalize/SKILL.md +67 -0
  159. package/skills/impeccable/onboard/SKILL.md +243 -0
  160. package/skills/impeccable/optimize/SKILL.md +269 -0
  161. package/skills/impeccable/polish/SKILL.md +202 -0
  162. package/skills/impeccable/quieter/SKILL.md +118 -0
  163. package/skills/impeccable/teach-impeccable/SKILL.md +69 -0
  164. package/templates/agents.md +166 -0
  165. package/templates/config.json +22 -0
  166. package/templates/context.md +72 -0
  167. package/templates/plan.md +202 -0
  168. package/templates/project.md +184 -0
  169. package/templates/requirements.md +231 -0
  170. package/templates/state.md +176 -0
  171. package/templates/uat.md +80 -0
@@ -0,0 +1,107 @@
1
+ ---
2
+ description: Archive completed milestone phase directories to keep .planning/phases/ clean
3
+ ---
4
+
5
+ # Cleanup
6
+
7
+ Archive phase directories from completed milestones into `.planning/milestones/[version]-phases/`. Keeps `.planning/phases/` focused on the current milestone only.
8
+
9
+ **Usage:** `cleanup`
10
+
11
+ ## Step 1: Find Completed Milestones
12
+
13
+ ```bash
14
+ cat .planning/milestones/MILESTONES.md 2>/dev/null || ls .planning/milestones/ 2>/dev/null
15
+ ```
16
+
17
+ Read `.planning/MILESTONES.md` (or list `.planning/milestones/`) to identify completed milestones and their versions.
18
+
19
+ Extract each milestone version (e.g., `v1.0`, `v1.1`, `v2.0`).
20
+
21
+ Check which milestone archive directories already exist:
22
+ ```bash
23
+ ls -d .planning/milestones/v*-phases 2>/dev/null
24
+ ```
25
+
26
+ Filter to milestones that do NOT already have a `-phases` archive directory. These are the ones needing cleanup.
27
+
28
+ If all milestones already have phase archives:
29
+ ```
30
+ All completed milestones already have phase directories archived.
31
+ Nothing to clean up.
32
+ ```
33
+ Stop.
34
+
35
+ ## Step 2: Determine Phase Membership
36
+
37
+ For each completed milestone without a `-phases` archive, find which phases belong to it.
38
+
39
+ Read the archived ROADMAP snapshot for that milestone:
40
+ ```bash
41
+ cat ".planning/milestones/[version]-ROADMAP.md" 2>/dev/null
42
+ ```
43
+
44
+ Extract phase numbers and names from the archived roadmap.
45
+
46
+ Check which of those phase directories still exist in `.planning/phases/`:
47
+ ```bash
48
+ ls -d .planning/phases/*/ 2>/dev/null
49
+ ```
50
+
51
+ Match phase directories to milestone membership. Only include directories that still exist.
52
+
53
+ ## Step 3: Show Dry-Run Summary
54
+
55
+ ```
56
+ Cleanup Summary
57
+
58
+ v[X.Y] β€” [Milestone Name]
59
+ Phase directories to archive:
60
+ - 01-foundation/
61
+ - 02-auth/
62
+ - 03-core-features/
63
+ Destination: .planning/milestones/v[X.Y]-phases/
64
+
65
+ v[X.Z] β€” [Milestone Name]
66
+ Phase directories to archive:
67
+ - 04-security/
68
+ - 05-hardening/
69
+ Destination: .planning/milestones/v[X.Z]-phases/
70
+
71
+ ---
72
+
73
+ Proceed with archiving? (yes/no)
74
+ ```
75
+
76
+ Wait for confirmation. If "no": stop.
77
+
78
+ ## Step 4: Archive Phase Directories
79
+
80
+ For each milestone and its phase directories:
81
+
82
+ ```bash
83
+ mkdir -p ".planning/milestones/v[X.Y]-phases"
84
+ mv ".planning/phases/[phase-dir]/" ".planning/milestones/v[X.Y]-phases/"
85
+ ```
86
+
87
+ Repeat for all milestones in the cleanup set.
88
+
89
+ ## Step 5: Commit
90
+
91
+ ```bash
92
+ git add .planning/milestones/ .planning/phases/
93
+ git commit -m "chore: archive phase dirs from completed milestones"
94
+ ```
95
+
96
+ ## Step 6: Report
97
+
98
+ ```
99
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
100
+ learnship β–Ί CLEANUP COMPLETE βœ“
101
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
102
+
103
+ Archived:
104
+ - v[X.Y]: [N] phase directories β†’ .planning/milestones/v[X.Y]-phases/
105
+
106
+ .planning/phases/ now contains only current milestone phases.
107
+ ```
@@ -0,0 +1,191 @@
1
+ ---
2
+ description: Archive a completed milestone, tag the release, and prepare for the next version
3
+ ---
4
+
5
+ # Complete Milestone
6
+
7
+ Mark the current milestone as shipped. Archives plans and requirements, updates the roadmap, tags the git release, and sets up for the next milestone.
8
+
9
+ **Use when:** all phases in the current milestone are complete and verified.
10
+
11
+ ## Step 1: Verify Readiness
12
+
13
+ Read `.planning/ROADMAP.md` and `.planning/REQUIREMENTS.md`.
14
+
15
+ Check every phase in the milestone:
16
+ ```bash
17
+ for phase_dir in .planning/phases/*/; do
18
+ plans=$(ls "${phase_dir}"*-PLAN.md 2>/dev/null | wc -l)
19
+ summaries=$(ls "${phase_dir}"*-SUMMARY.md 2>/dev/null | wc -l)
20
+ echo "${phase_dir}: ${plans} plans, ${summaries} summaries"
21
+ done
22
+ ```
23
+
24
+ Present readiness report:
25
+ ```
26
+ Milestone: [Name]
27
+
28
+ | Phase | Plans | Summaries | Status |
29
+ |-------|-------|-----------|--------|
30
+ | 1: [Name] | [N] | [N] | βœ“ Complete |
31
+ | 2: [Name] | [N] | [N] | βœ“ Complete |
32
+ ...
33
+
34
+ Requirements: [X] of [Y] v1 requirements checked off
35
+ ```
36
+
37
+ **If any phase incomplete** (plans > summaries): stop and show which phases need execution.
38
+
39
+ **If requirements incomplete**: list unchecked requirements and ask to proceed anyway or address them first.
40
+
41
+ Ask for confirmation:
42
+ - **Archive and tag release** β†’ proceed
43
+ - **Not ready β€” I need to finish something** β†’ stop
44
+
45
+ ## Step 2: Determine Version
46
+
47
+ Read `.planning/STATE.md` and check for existing version tags:
48
+ ```bash
49
+ git tag --list "v*" | sort -V | tail -5
50
+ ```
51
+
52
+ Propose the next version (e.g., `v1.0`, `v1.1`, `v2.0`). Ask for confirmation or let user specify.
53
+
54
+ ## Step 3: Archive Milestone Artifacts
55
+
56
+ Create the milestones archive directory:
57
+ ```bash
58
+ mkdir -p .planning/milestones
59
+ ```
60
+
61
+ Archive the roadmap for this milestone:
62
+ ```bash
63
+ cp .planning/ROADMAP.md ".planning/milestones/${VERSION}-ROADMAP.md"
64
+ ```
65
+
66
+ Archive the requirements:
67
+ ```bash
68
+ cp .planning/REQUIREMENTS.md ".planning/milestones/${VERSION}-REQUIREMENTS.md"
69
+ ```
70
+
71
+ ## Step 4: Update ROADMAP.md
72
+
73
+ Replace the current milestone's detailed phases with a one-line summary per milestone section:
74
+
75
+ ```markdown
76
+ ## Completed Milestones
77
+
78
+ ### [VERSION] β€” [Milestone Name]
79
+ Completed [date]. [N] phases, [M] requirements delivered. See `.planning/milestones/[VERSION]-ROADMAP.md` for full details.
80
+
81
+ ---
82
+ ```
83
+
84
+ Delete `.planning/REQUIREMENTS.md` (a fresh one will be created for the next milestone):
85
+ ```bash
86
+ git rm .planning/REQUIREMENTS.md
87
+ ```
88
+
89
+ ## Step 5: Update PROJECT.md
90
+
91
+ Read `.planning/PROJECT.md` and update:
92
+ - Bump version reference
93
+ - Move "Active" requirements that were completed to "Validated"
94
+ - Update the "Key Decisions" table with final outcomes
95
+ - Update the "Last updated" footer
96
+
97
+ ## Step 6: Create Milestone Summary in STATE.md
98
+
99
+ Add a milestone completion entry to STATE.md:
100
+
101
+ ```markdown
102
+ ## Milestone History
103
+
104
+ ### [VERSION] β€” [Milestone Name]
105
+ Completed: [date]
106
+ Phases: [N]
107
+ Requirements delivered: [list of REQ-IDs]
108
+ Key achievements: [2-3 sentence summary]
109
+ ```
110
+
111
+ ## Step 7: Git Tag the Release
112
+
113
+ Commit all updated artifacts:
114
+ ```bash
115
+ git add .planning/
116
+ git commit -m "docs: archive milestone [VERSION]"
117
+ ```
118
+
119
+ Tag the release:
120
+ ```bash
121
+ git tag -a "[VERSION]" -m "Milestone [VERSION]: [Milestone Name]
122
+
123
+ [2-3 sentence summary of what was built]
124
+
125
+ Phases: [N]
126
+ Requirements: [M] delivered"
127
+ ```
128
+
129
+ Display:
130
+ ```
131
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
132
+ MILESTONE [VERSION] COMPLETE βœ“
133
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
134
+
135
+ **[Milestone Name]**
136
+ [N] phases complete | [M] requirements delivered
137
+ Tagged: [VERSION]
138
+
139
+ Archives:
140
+ - .planning/milestones/[VERSION]-ROADMAP.md
141
+ - .planning/milestones/[VERSION]-REQUIREMENTS.md
142
+ ```
143
+
144
+ ## Step 7b: Update AGENTS.md
145
+
146
+ If `AGENTS.md` exists at the project root, update:
147
+
148
+ 1. **Current Phase block** β€” mark milestone complete:
149
+ ```markdown
150
+ ## Current Phase
151
+
152
+ **Milestone:** [VERSION] β€” [Milestone Name] βœ“ shipped
153
+ **Phase:** β€”
154
+ **Status:** milestone complete β€” ready for next milestone
155
+ **Last updated:** [today's date]
156
+ ```
157
+
158
+ 2. **Project Structure** β€” update if the milestone added significant new modules.
159
+
160
+ ```bash
161
+ git add AGENTS.md
162
+ git commit -m "docs: update AGENTS.md β€” milestone [VERSION] complete"
163
+ ```
164
+
165
+ ## Step 8: Offer Next Milestone
166
+
167
+ Ask: "Ready to start the next milestone?"
168
+
169
+ - **Yes, start planning next milestone** β†’ Run `new-project` logic adapted for a new milestone on an existing codebase:
170
+ - Skip git init (already exists)
171
+ - Ask what to build next
172
+ - Research the new feature domain
173
+ - Define new requirements
174
+ - Create new ROADMAP.md
175
+ - **Not yet** β†’ stop here
176
+
177
+ ---
178
+
179
+ ## Learning Checkpoint
180
+
181
+ Read `learning_mode` from `.planning/config.json`.
182
+
183
+ **If `auto`:** Offer:
184
+
185
+ > πŸ’‘ **Learning moment:** Milestone [VERSION] is shipped. This is the right time for a deep reflection.
186
+ >
187
+ > `@agentic-learning reflect` β€” What did you learn building this? What was your goal? What gaps remain for the next milestone?
188
+ >
189
+ > `@agentic-learning space` β€” Schedule the key concepts from this milestone for spaced review before the next one starts.
190
+
191
+ **If `manual`:** Add quietly: *"Tip: `@agentic-learning reflect` for a milestone retrospective."*
@@ -0,0 +1,245 @@
1
+ ---
2
+ description: Systematic debugging with persistent state β€” triage, diagnose root cause, plan fix, execute
3
+ ---
4
+
5
+ # Debug
6
+
7
+ Systematic debugging workflow: triage β†’ root cause diagnosis β†’ fix planning β†’ execution. Creates a persistent debug session file so context survives across context resets.
8
+
9
+ **Usage:** `debug [description]`
10
+
11
+ ## Step 1: Create Debug Session
12
+
13
+ ```bash
14
+ mkdir -p .planning/debug
15
+ DATE=$(date +%Y%m%d-%H%M)
16
+ ```
17
+
18
+ Generate a slug from the description (lowercase, hyphens). Create session file:
19
+ ```
20
+ .planning/debug/[DATE]-[SLUG].md
21
+ ```
22
+
23
+ Write initial session header:
24
+ ```markdown
25
+ ---
26
+ status: open
27
+ opened: [datetime]
28
+ description: [description]
29
+ ---
30
+
31
+ # Debug: [description]
32
+
33
+ ## Session Log
34
+ ```
35
+
36
+ ## Step 2: Triage
37
+
38
+ Ask: **"What is the exact symptom?"**
39
+
40
+ If description was provided as an argument, use it as starting context. Then ask follow-up questions one at a time:
41
+
42
+ 1. "When does this happen? Always, sometimes, or only under specific conditions?"
43
+ 2. "What did you expect to happen?"
44
+ 3. "When did it start? Was it working before? What changed?"
45
+ 4. "What have you already tried?"
46
+
47
+ After gathering answers, write a triage summary to the session file:
48
+ ```markdown
49
+ ## Triage
50
+
51
+ **Symptom:** [exact description]
52
+ **Expected:** [what should happen]
53
+ **Frequency:** [always/intermittent/condition-specific]
54
+ **Regression:** [when it started, what changed]
55
+ **Already tried:** [list]
56
+ ```
57
+
58
+ ## Step 3: Form Hypotheses
59
+
60
+ Based on the symptom and triage, generate 2-4 candidate root causes ranked by likelihood:
61
+
62
+ ```
63
+ Hypotheses (ranked by likelihood):
64
+
65
+ 1. [Most likely]: [explanation of why this would cause the symptom]
66
+ 2. [Second]: [explanation]
67
+ 3. [Third]: [explanation]
68
+ ```
69
+
70
+ Ask: "Does any of these match what you're seeing? Or should I investigate a different direction?"
71
+
72
+ ## Step 4: Investigate
73
+
74
+ Read `parallelization` from `.planning/config.json` (defaults to `false`).
75
+
76
+ **If `parallelization` is `true` (subagent mode β€” Claude Code, OpenCode, Codex):**
77
+
78
+ Spawn a dedicated debugger agent with a fresh context budget for deep investigation:
79
+ ```
80
+ Task(
81
+ subagent_type="learnship-debugger",
82
+ prompt="
83
+ <objective>
84
+ Investigate the bug described in [session_file].
85
+ Trace from the user-facing symptom inward to find the root cause.
86
+ Find the specific file and line where behavior diverges from expected.
87
+ Confirm: 'If this were fixed, would the symptom go away?'
88
+ Write investigation findings back to [session_file].
89
+ </objective>
90
+
91
+ <files_to_read>
92
+ - [session_file] (debug session with triage + hypotheses)
93
+ - ./AGENTS.md or ./CLAUDE.md or ./GEMINI.md (project context, whichever exists)
94
+ </files_to_read>
95
+ "
96
+ )
97
+ ```
98
+
99
+ Wait for agent to complete, then read the updated session file.
100
+
101
+ **If `parallelization` is `false` (sequential mode):**
102
+
103
+ Using `@./agents/debugger.md` as your investigation persona:
104
+
105
+ For the most likely hypothesis, investigate the codebase (read-only):
106
+ - Trace from the user-facing symptom inward toward the root cause
107
+ - Find the specific file and line where behavior diverges from expected
108
+ - Confirm: "If this were fixed, would the symptom go away?"
109
+
110
+ Update session file with investigation notes:
111
+ ```markdown
112
+ ## Investigation
113
+
114
+ ### Hypothesis [N]: [description]
115
+ **Files checked:** [list]
116
+ **Finding:** [what was found]
117
+ **Root cause:** [specific file:line and why it causes the symptom]
118
+ **Confidence:** high | medium | low
119
+ ```
120
+
121
+ If hypothesis disproved: move to next hypothesis. If all hypotheses disproved: surface new ones based on what was found.
122
+
123
+ ## Step 5: Diagnose
124
+
125
+ Present root cause diagnosis:
126
+
127
+ ```
128
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
129
+ DEBUG β–Ί ROOT CAUSE FOUND
130
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
131
+
132
+ Root cause: [specific description]
133
+ Location: [file:line]
134
+ Why: [how this causes the symptom]
135
+ Confidence: high | medium | low
136
+ ```
137
+
138
+ Write to session file:
139
+ ```markdown
140
+ ## Root Cause
141
+
142
+ **Location:** [file:line]
143
+ **Cause:** [description]
144
+ **Why it produces the symptom:** [explanation]
145
+ **Confidence:** high | medium | low
146
+ ```
147
+
148
+ If confidence is low: explain what additional information would help confirm.
149
+
150
+ ## Step 6: Plan the Fix
151
+
152
+ Propose a minimal fix:
153
+
154
+ ```
155
+ Fix approach: [1-3 sentences describing the change]
156
+ Files to modify:
157
+ - [file]: [what to change]
158
+
159
+ Risk: [any side effects or things to watch out for]
160
+ ```
161
+
162
+ Ask: "Does this approach look right? Should I implement it, or do you want to adjust?"
163
+
164
+ ## Step 7: Implement Fix
165
+
166
+ Once confirmed, implement the fix using the executor approach from `@./agents/executor.md`:
167
+ - Make only the changes needed to fix the root cause
168
+ - No scope creep β€” don't fix other things while you're in there
169
+ - Commit atomically:
170
+
171
+ ```bash
172
+ git add [files changed]
173
+ git commit -m "fix([scope]): [description of what was fixed]"
174
+ ```
175
+
176
+ ## Step 8: Verify Fix
177
+
178
+ Test the fix against the original symptom:
179
+ ```bash
180
+ [run the verify command from the relevant plan, or run tests]
181
+ ```
182
+
183
+ Ask: "Does this fix the problem?"
184
+
185
+ ## Step 9: Close Session
186
+
187
+ Update session file:
188
+ ```markdown
189
+ ## Resolution
190
+
191
+ **Fix applied:** [description]
192
+ **Commit:** [hash]
193
+ **Verified:** [yes/no β€” how verified]
194
+ **Status:** resolved | partial | unresolved
195
+ ```
196
+
197
+ Move to resolved:
198
+ ```bash
199
+ mkdir -p .planning/debug/resolved
200
+ mv ".planning/debug/[session-file]" ".planning/debug/resolved/"
201
+ ```
202
+
203
+ ## Step 9b: Update AGENTS.md Regressions
204
+
205
+ If `AGENTS.md` exists at the project root, append a regression entry to the `## Regressions` section:
206
+
207
+ ```markdown
208
+ ### [YYYY-MM-DD]: [short description β€” e.g., "Auth token not passed to API calls"]
209
+
210
+ **Root cause:** [one sentence β€” the actual code location and why]
211
+ **Fix:** [what was changed]
212
+ **Lesson:** [the principle extracted β€” what to watch for next time]
213
+ ```
214
+
215
+ Remove the `> No regressions logged yet.` placeholder line if it's still there.
216
+
217
+ ```bash
218
+ git add AGENTS.md .planning/debug/resolved/[session-file]
219
+ git commit -m "docs(debug): close session β€” [description]"
220
+ ```
221
+
222
+ ```
223
+ Debug session closed.
224
+ Session: .planning/debug/resolved/[session-file]
225
+
226
+ β–Ά If more issues remain: debug [new description]
227
+ ```
228
+
229
+ ---
230
+
231
+ ## Learning Checkpoint
232
+
233
+ Read `learning_mode` from `.planning/config.json`.
234
+
235
+ **If `auto`:** After resolving, offer based on what happened:
236
+
237
+ > πŸ’‘ **Learning moment:** Root cause found and fixed. Bugs are the highest-signal learning moments β€” don’t let this one fade:
238
+ >
239
+ > `@agentic-learning learn [bug domain]` β€” Active retrieval on the concept that broke. You explain the root cause first, gaps get filled. This is how "I've seen this bug" becomes real pattern recognition.
240
+ >
241
+ > `@agentic-learning struggle [the problem]` β€” Reproduce a similar problem from scratch with a hint ladder. The re-investigation builds deeper intuition than reading the fix.
242
+ >
243
+ > `@agentic-learning either-or` β€” Which debugging strategy worked (hypothesis testing, bisect, tracing)? Log it for future sessions.
244
+
245
+ **If `manual`:** Add quietly: *"Tip: `@agentic-learning learn [bug domain]` Β· `@agentic-learning struggle [problem]` to turn this bug into a lasting pattern."*
@@ -0,0 +1,131 @@
1
+ ---
2
+ description: Capture an architectural or scope decision with its context, alternatives, and rationale into .planning/DECISIONS.md
3
+ ---
4
+
5
+ # Decision Log
6
+
7
+ Capture a decision β€” architectural choice, library pick, scope trade-off, pattern selection β€” into `.planning/DECISIONS.md`. The decision register is the project's institutional memory: it tells future Cascade (and future you) *why* the project is built the way it is.
8
+
9
+ **Usage:** `decision-log [description]` or just `decision-log` to capture from recent conversation.
10
+
11
+ ## Step 1: Extract Decision Content
12
+
13
+ **With description argument:** Use it as the decision title/focus.
14
+
15
+ **Without argument:** Analyze recent conversation to extract the decision being made:
16
+ - What choice was just discussed or made?
17
+ - What were the alternatives?
18
+ - What was the rationale?
19
+ - What does this lock in or foreclose?
20
+
21
+ Formulate:
22
+ - `title` β€” 3-8 words (e.g., "Use Zustand over Redux for state", "Single-table DynamoDB design")
23
+ - `type` β€” `architecture` | `library` | `scope` | `pattern` | `lesson`
24
+ - `context` β€” why this decision was needed (1-2 sentences)
25
+ - `options` β€” alternatives that were considered (list)
26
+ - `choice` β€” what was decided
27
+ - `rationale` β€” why this choice over the alternatives
28
+ - `consequences` β€” what this locks in or makes harder
29
+
30
+ ## Step 2: Read Existing DECISIONS.md
31
+
32
+ ```bash
33
+ cat .planning/DECISIONS.md 2>/dev/null || echo "File does not exist yet."
34
+ ```
35
+
36
+ If it doesn't exist, it will be created. Note the highest existing DEC-XXX number to assign the next ID.
37
+
38
+ ## Step 3: Check for Conflicts
39
+
40
+ Scan existing decisions for any that might conflict with or be superseded by the new one:
41
+
42
+ ```bash
43
+ grep -i "[key words from title]" .planning/DECISIONS.md 2>/dev/null
44
+ ```
45
+
46
+ If a related decision exists, show it and ask: "This may relate to DEC-[XXX]: [title]. Is this a new decision, or does it update/supersede the existing one?"
47
+
48
+ - **New decision** β†’ create DEC-[next]
49
+ - **Updates existing** β†’ add a note to existing entry, create new entry with `supersedes: DEC-[XXX]`
50
+
51
+ ## Step 4: Read Phase Context
52
+
53
+ ```bash
54
+ cat .planning/STATE.md | grep "Phase:"
55
+ ```
56
+
57
+ Note the current phase number for the decision record.
58
+
59
+ ## Step 5: Write to DECISIONS.md
60
+
61
+ If DECISIONS.md doesn't exist, create it with header:
62
+
63
+ ```markdown
64
+ # Decisions Register
65
+
66
+ A living record of architectural, scope, and pattern decisions made during this project.
67
+ Each entry captures context, alternatives considered, and rationale β€” so future sessions
68
+ understand *why* the project is built the way it is.
69
+
70
+ Read this before proposing approaches that may conflict with prior decisions.
71
+
72
+ ---
73
+ ```
74
+
75
+ Append the new entry:
76
+
77
+ ```markdown
78
+ ## DEC-[XXX]: [title]
79
+
80
+ **Date:** [YYYY-MM-DD] | **Phase:** [N] | **Type:** [type]
81
+
82
+ **Context:** [why this decision was needed]
83
+
84
+ **Options considered:**
85
+ - [option A]: [brief description and trade-off]
86
+ - [option B]: [brief description and trade-off]
87
+
88
+ **Choice:** [what was decided]
89
+
90
+ **Rationale:** [why this over the alternatives]
91
+
92
+ **Consequences:** [what this locks in, what it makes harder, what it enables]
93
+
94
+ **Status:** active
95
+
96
+ ---
97
+ ```
98
+
99
+ ## Step 6: Commit
100
+
101
+ ```bash
102
+ git add .planning/DECISIONS.md
103
+ git commit -m "docs: log decision β€” [title]"
104
+ ```
105
+
106
+ ## Step 7: Confirm
107
+
108
+ ```
109
+ Decision logged: DEC-[XXX]
110
+
111
+ [title]
112
+ Type: [type] | Phase: [N]
113
+
114
+ Decisions register: .planning/DECISIONS.md ([N] total decisions)
115
+
116
+ Continue with current work, or capture another with decision-log.
117
+ ```
118
+
119
+ ---
120
+
121
+ ## Learning Checkpoint
122
+
123
+ Read `learning_mode` from `.planning/config.json`.
124
+
125
+ **If `auto`:** After logging a significant architectural decision:
126
+
127
+ > πŸ’‘ **Decision logged.** Want to explore it deeper?
128
+ >
129
+ > `@agentic-learning either-or` β€” Walk through the decision more systematically: what did each option optimize for? What would have to be true for the other option to have been better? This builds the decision-making intuition, not just the record.
130
+
131
+ **If `manual`:** No note (keep it fast β€” this workflow is meant to be a quick capture).