mother-brain 0.1.0 → 0.3.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.
package/dist/cli.js CHANGED
@@ -653,7 +653,7 @@ async function uninstall(options) {
653
653
  // src/cli.ts
654
654
  import { exec as exec3 } from "child_process";
655
655
  var program = new Command();
656
- var VERSION = "0.1.0";
656
+ var VERSION = "0.3.0";
657
657
  program.name("mother-brain").description("AI-powered project management framework for GitHub Copilot CLI").version(VERSION);
658
658
  program.command("init").description("Initialize Mother Brain in the current project").option("-f, --force", "Overwrite existing skills").action(init);
659
659
  program.command("update").description("Update Mother Brain skills to the latest version").action(update);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mother-brain",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "AI-powered project management framework for GitHub Copilot CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -34,16 +34,23 @@ allowed-tools: powershell view grep glob web_search ask_user create edit skill
34
34
  - ALWAYS present proposed changes with: Accept / Revise / Reject
35
35
  - NEVER apply changes without explicit user acceptance
36
36
 
37
- ### RULE 4: PAIRED LEARNING
38
- - Every feedback MUST propose BOTH a Project Brain entry AND a Mother Brain entry
39
- - Even if one is "no change needed" - show both levels were considered
37
+ ### RULE 4: FOUR-LAYER CONSIDERATION
38
+ - Every feedback MUST be analyzed across ALL FOUR layers:
39
+ 1. **Elder Brain**: Is this domain/tech knowledge?
40
+ 2. **Project Brain**: Is this project-specific?
41
+ 3. **Mother Brain**: Is this about thinking process?
42
+ 4. **Skills**: Is execution capability missing?
43
+ - Even if some are "no change needed" - show all layers were considered
44
+ - Display which layers received updates
40
45
 
41
46
  ### RULE 5: VISIBLE CONFIRMATION
42
- - After learning is recorded, ALWAYS display:
47
+ - After learning is recorded, ALWAYS display which layers were updated:
48
+ - `🧙 Elder Brain will remember this` (for domain/tech gotchas)
43
49
  - `📘 Project Brain will remember this` (for project learnings)
44
- - `🧠 Mother Brain will remember this` (for process learnings)
45
- - If user selects from menu options that reveal preferences, STILL note it:
46
- - `📘 Noted: [preference summary]`
50
+ - `🧠 Mother Brain will remember this` (for thinking process)
51
+ - `🛠️ [skill-name] created/updated` (for execution capability)
52
+ - Show "No changes" for layers that weren't updated
53
+ - If user selects from menu options that reveal preferences, STILL note it
47
54
 
48
55
  ---
49
56
 
@@ -51,18 +58,30 @@ Child Brain is the EXPERT at analyzing ALL user feedback - not just errors. It r
51
58
 
52
59
  ## Purpose
53
60
 
54
- Child Brain ensures learnings go to the right place:
55
- - **Project-specific learnings** → Project Brain (`.mother-brain/project-brain.md`)
56
- - Course corrections for this project's trajectory
57
- - Style/tone preferences discovered
58
- - Skill adjustments needed
59
- - Vision document updates
60
- - **Behavioral/process learnings** Mother Brain (`.github/skills/mother-brain/SKILL.md`)
61
- - How to better facilitate user vision
62
- - Process improvements for ALL projects
63
- - NEVER domain knowledge or project specifics
64
- - **Domain knowledge gaps** Skills (via skill-creator)
65
- - When expertise is missing, create a skill
61
+ Child Brain ensures learnings go to the right place across FOUR layers:
62
+
63
+ 1. **Elder Brain** (`experience-vault/`) **Domain Knowledge**
64
+ - Technology-specific gotchas (Firebase, React, Vercel)
65
+ - Platform patterns (Windows paths, auth flows)
66
+ - Cross-project wisdom that applies to ALL projects of a type
67
+ - Example: "Firebase Auth needs Console click-through"
68
+
69
+ 2. **Project Brain** (`.mother-brain/project-brain.md`) **Project-Specific**
70
+ - Style/tone/design preferences for THIS project
71
+ - Vision refinements discovered during execution
72
+ - Validation checks for this project's domain
73
+ - Example: "This game uses warm cozy Stardew Valley aesthetic"
74
+
75
+ 3. **Mother Brain** (`.github/skills/mother-brain/SKILL.md`) → **Meta-Behavioral**
76
+ - HOW to think, WHEN to research, WHAT to consider
77
+ - Process improvements for facilitating ALL projects
78
+ - Cognition and adaptation patterns
79
+ - Example: "When learning about outcome, research failure modes"
80
+
81
+ 4. **Skills** (via skill-creator) → **Execution Capability**
82
+ - Domain-specific execution knowledge
83
+ - Created when expertise gaps are detected
84
+ - Example: pixel-art-renderer skill with game art knowledge
66
85
 
67
86
  Child Brain NEVER stores knowledge itself. It analyzes, routes, and creates.
68
87
 
@@ -104,26 +123,42 @@ Child Brain is invoked by Mother Brain for ALL of these (not just errors):
104
123
  This ensures both levels are always considered and visible to user.
105
124
  - **APPROVAL GATE RULE**: Child Brain MUST present proposed changes and get user approval BEFORE applying any edits. Use three options: Accept / Revise / Reject. NEVER apply changes without explicit user acceptance.
106
125
 
107
- ## The Three Questions for Every Learning
108
-
109
- When analyzing feedback, Child Brain asks:
110
-
111
- 1. **Is this about THIS PROJECT specifically?**
112
- - Style preferences, design choices, domain conventions
113
- - Route to Project Brain for course correction
114
- - May trigger skill updates for this project
115
-
116
- 2. **Is this about HOW MOTHER BRAIN FACILITATED?**
117
- - Did it consider enough at vision phase?
118
- - Did it anticipate what would be needed later?
119
- - Did it make the right choices based on user's stated needs?
120
- - Route to Mother Brain as behavioral improvement
121
- - Must be completely project-agnostic
122
-
123
- 3. **Is this about MISSING EXPERTISE?**
124
- - Agent didn't know how to do something well
125
- - Create or update a skill via skill-creator
126
- - Skills hold the domain knowledge
126
+ ## The Four Questions for Every Learning
127
+
128
+ When analyzing feedback, Child Brain asks (IN THIS ORDER):
129
+
130
+ 1. **Is this DOMAIN KNOWLEDGE (technology/platform-specific)?**
131
+ - Mentions specific technology name? (Firebase, React, Vercel, Windows)
132
+ - Platform-specific gotcha or pattern?
133
+ - Cross-project wisdom for this tech stack?
134
+ - → Route to **Elder Brain** (experience-vault/)
135
+ - Example: "Firebase Auth needs Console click-through before use"
136
+
137
+ 2. **Is this about THIS PROJECT specifically?**
138
+ - Style preferences, aesthetic choices, design direction
139
+ - Vision refinements or missed requirements
140
+ - Project-specific validation needs
141
+ - → Route to **Project Brain** for course correction
142
+ - Example: "This game uses warm cozy Stardew Valley aesthetic"
143
+
144
+ 3. **Is this about HOW MOTHER BRAIN THINKS?**
145
+ - WHEN to research? WHAT to consider? HOW to anticipate?
146
+ - Information processing and adaptation patterns
147
+ - NOT about what to think, but how to approach thinking
148
+ - → Route to **Mother Brain** as cognitive improvement
149
+ - Example: "When user mentions outcome, research failure modes first"
150
+
151
+ 4. **Is this about MISSING EXECUTION CAPABILITY?**
152
+ - Agent didn't know how to execute something well
153
+ - Need specialized domain knowledge for execution
154
+ - → Create or update a **Skill** via skill-creator
155
+ - Example: Need pixel-art-renderer skill with game art knowledge
156
+
157
+ **The Test (CRITICAL):**
158
+ - Does it mention a technology name? → Elder Brain
159
+ - Is it about this project's style/preferences? → Project Brain
160
+ - Is it about WHEN/HOW to think? → Mother Brain
161
+ - Is it about execution capability? → Skill
127
162
 
128
163
  ## Friction Analysis Flow
129
164
 
@@ -172,38 +207,110 @@ Determine the **layer** where the issue originated:
172
207
  - **Missing Validation**: No check was in place to catch this before user saw it
173
208
  - **Process Gap**: Mother Brain's workflow skipped a necessary step
174
209
 
175
- ### Step 4: Split the Learning
210
+ ### Step 4: Split the Learning (Four-Way Analysis)
176
211
 
177
212
  Based on root cause, determine what goes where:
178
213
 
179
- **PROJECT-LEVEL Learning (→ Project Brain) - Course Correction:**
180
- - "This project uses [specific style/tone/approach]"
181
- - "For this project, always [specific check or validation]"
182
- - "This project's vision includes [specific requirement]"
183
- - References, examples, style guides specific to this project
184
- - Validation checks specific to this project's domain
185
- - **Course corrections for future tasks:**
186
- - "User prefers X over Y - update design skills accordingly"
187
- - "Vision document needs to reflect [preference]"
188
- - "Flag for Task [N] - incorporate this preference"
189
-
190
- **META-LEVEL Learning (→ Mother Brain) - Behavioral Only:**
191
- - Process improvements that help ALL projects
192
- - Did Mother Brain consider enough during vision discovery?
193
- - Did Mother Brain anticipate what would be needed later?
194
- - Did Mother Brain make the right choices based on user's stated needs?
195
- - When to create skills (patterns that warrant skill creation)
196
- - When to ask discovery questions (before implementing creative work)
197
- - When to research (domains that need external knowledge)
198
- - Validation gates (when to pause and check with user)
199
- - **NEVER domain specifics** - those go to skills
200
-
201
- **Skill Creation/Update Decision:**
202
- If root cause is "Missing Skill" or "Insufficient Skill":
203
- - Invoke skill-creator to create/enhance the skill
204
- - Skill gets the domain knowledge, NOT Mother Brain
214
+ **ELDER BRAIN (experience-vault/) - Technology/Platform Gotchas:**
215
+ - Check: Does this mention a specific technology or platform name?
216
+ - "Firebase Auth requires Console click-through"
217
+ - "Vercel needs .env.production for build-time vars"
218
+ - "Windows PowerShell needs -Force flag for directories"
219
+ - "React refs don't work with functional components"
220
+ - Cross-project patterns for specific tech stacks
221
+ - Platform-specific workarounds and requirements
222
+
223
+ **PROJECT BRAIN (.mother-brain/project-brain.md) - This Project's Identity:**
224
+ - "This project uses warm cozy Stardew Valley aesthetic"
225
+ - "This game has horses as central character, not just background"
226
+ - "User prefers Tailwind over CSS modules"
227
+ - Style/tone/design preferences specific to this project
228
+ - Vision refinements discovered during execution
229
+ - Validation checks for this project's domain
230
+ - **Course corrections for future tasks**
231
+
232
+ **MOTHER BRAIN (.github/skills/mother-brain/SKILL.md) - Thinking Process:**
233
+ - Check: Is this about WHEN/HOW/WHAT to consider? (not about specific content)
234
+ - "When user mentions outcome, research failure modes first"
235
+ - "Before creative work, ask user about style preferences"
236
+ - "When outcome involves data, consider exposure risks"
237
+ - Information processing patterns
238
+ - Research triggers and anticipation
239
+ - **NOT hardcoded rules for domains** - those go to Elder Brain
240
+
241
+ **SKILL CREATION/UPDATE:**
242
+ - If execution capability is missing
243
+ - If domain knowledge needs to be embedded in tooling
244
+ - Route research findings + user preferences to skill-creator
205
245
  - Log skill creation in Project Brain
206
246
 
247
+ **The Critical Test:**
248
+ 1. Does it mention Firebase/React/Vercel/Windows/etc.? → **Elder Brain**
249
+ 2. Is it about this project's aesthetic/style/preferences? → **Project Brain**
250
+ 3. Is it about WHEN to research or HOW to think? → **Mother Brain**
251
+ 4. Is it about execution tooling? → **Skill**
252
+
253
+ ### Step 4.5: Apply Elder Brain Learning (Domain Gotchas)
254
+
255
+ **When learning is domain/technology-specific:**
256
+
257
+ **Step 4.5.1: Identify Domain Category**
258
+ - Security (auth, data exposure, vulnerabilities)
259
+ - Deployment (platform-specific requirements, config)
260
+ - APIs (integration patterns, rate limiting)
261
+ - Databases (schema, ORMs, query patterns)
262
+ - UI (accessibility, responsive, design systems)
263
+ - Platforms (Windows, macOS, Linux, mobile, web)
264
+
265
+ **Step 4.5.2: Check if Knowledge Already Exists**
266
+ - Search `experience-vault/[category]/` for related files
267
+ - Use grep to check for technology mentions
268
+ - If exists → update existing file
269
+ - If new → create new file
270
+
271
+ **Step 4.5.3: Document the Gotcha**
272
+
273
+ Create/update `experience-vault/[category]/[tech-name].md`:
274
+
275
+ ```markdown
276
+ # [Technology Name] - [Brief Title]
277
+
278
+ ## Problem
279
+ [What goes wrong - the error/failure user experiences]
280
+
281
+ ## Gotcha
282
+ [The non-obvious thing - why it happens, what's unexpected]
283
+
284
+ ## Solution
285
+ [How to fix/prevent - code examples, config, steps]
286
+
287
+ **When to Consult**: [Which Mother Brain steps should reference this]
288
+
289
+ ## Related Gotchas
290
+ See also:
291
+ - [Link to related experience-vault files]
292
+
293
+ ## Sources
294
+ - [Link to official docs]
295
+ - [Link to community resources]
296
+ ```
297
+
298
+ **Step 4.5.4: Display Simple Confirmation**
299
+
300
+ Display to user:
301
+ ```
302
+ 🧙 Elder Brain will remember this
303
+ ```
304
+
305
+ **Step 4.5.5: Update Mother Brain Reference (If Needed)**
306
+
307
+ If this is a common gotcha that Mother Brain should ALWAYS check for:
308
+ - Add reference to appropriate Mother Brain step
309
+ - Example: "Before deploying, consult experience-vault/deployment/"
310
+ - Mother Brain doesn't store the gotcha - just knows WHERE to look
311
+
312
+ **Key Principle**: Elder Brain stores domain facts. Mother Brain learns to consult Elder Brain at the right times.
313
+
207
314
  ### Step 5: Apply Project-Level Learning (Course Correction) - ACTIVE
208
315
 
209
316
  **Project Brain is ACTIVE, not passive.** It doesn't just store learnings - it TAKES ACTION:
@@ -607,6 +607,7 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
607
607
  - Question: "What would you like to do?"
608
608
  - Choices (MUST be provided as array):
609
609
  - "Continue where I left off"
610
+ - "💡 I have a new idea"
610
611
  - "Review/update roadmap"
611
612
  - "Realign with vision"
612
613
  - "🧠 Improve Mother Brain"
@@ -614,6 +615,8 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
614
615
  - "Eject project (reset to framework + learnings)"
615
616
  - **CRITICAL**: Do NOT ask what to do as freeform text. ALWAYS use the `ask_user` tool.
616
617
  - Freeform automatically available for custom actions
618
+ - **If "I have a new idea"**: Jump to **Step 2F: Idea Capture & Prioritization**
619
+ - **If "Continue where I left off"**: Jump to **Step 2G: Task Resume Preview**
617
620
  - **If "Improve Mother Brain"**: Jump to **Step 2A: Improve Mother Brain Menu**
618
621
  - **If "Send improvement"**: Jump to **Step 2A: Send Improvement to Mother Brain**
619
622
 
@@ -668,9 +671,11 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
668
671
  - "Improve documentation"
669
672
  - "Refactor or clean up code"
670
673
  - "📥 Review community improvements"
674
+ - "💭 Brainstorm (thinking partner mode)"
671
675
  - "Continue previous meta-work"
672
676
 
673
677
  - **If "Review community improvements"**: Jump to **Step 2A.2: Review Community Improvements**
678
+ - **If "Brainstorm"**: Jump to **Step 2E: Brainstorm Mode** (framework-focused version)
674
679
 
675
680
  **Step 2.3.2: Track Meta-Work**
676
681
  - Update `.mother-brain/meta-mode.json` with focus:
@@ -1591,6 +1596,235 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
1591
1596
  - If "Not yet": Continue brainstorm conversation
1592
1597
  - If "Exit": Return to main menu (Step 2)
1593
1598
 
1599
+ ### 2F. **Idea Capture & Prioritization** (Quick Idea Logging)
1600
+ - When user selects "💡 I have a new idea" from ANY menu:
1601
+
1602
+ **Purpose**: Let users quickly capture ideas mid-project without derailing current work. Ideas are analyzed against the vision, prioritized, and inserted into the roadmap at the right position. The user never loses an idea, and the current plan stays intact unless the idea is truly urgent.
1603
+
1604
+ **Step 2F.1: Capture the Idea**
1605
+
1606
+ - Display:
1607
+ ```
1608
+ 💡 New Idea Capture
1609
+
1610
+ Tell me your idea — what is it and what would it achieve?
1611
+ Don't worry about where it fits yet, just get it down.
1612
+ ```
1613
+
1614
+ - Use `ask_user` with `allow_freeform: true` (no predefined choices — pure capture mode)
1615
+
1616
+ **Step 2F.2: Analyze & Score the Idea**
1617
+
1618
+ - Load `.mother-brain/docs/vision.md` (for alignment check)
1619
+ - Load `.mother-brain/docs/roadmap.md` (for context on existing tasks)
1620
+ - Load `.mother-brain/project-brain.md` (for project preferences, if exists)
1621
+
1622
+ - Analyze the idea across four dimensions:
1623
+ 1. **Vision Alignment**: How well does this idea serve the project's stated WHY and success criteria?
1624
+ 2. **User Impact**: How much does this benefit the target users defined in the vision?
1625
+ 3. **Effort Estimate**: Relative complexity — is this a single task or a multi-task effort?
1626
+ 4. **Dependency Check**: Does this idea depend on existing tasks, or do existing tasks depend on it?
1627
+
1628
+ - Determine priority level:
1629
+ - **🔴 Critical (insert into current phase)**: Directly blocks or significantly enhances the MVP. Aligns strongly with vision AND has high user impact.
1630
+ - **🟡 Important (next phase priority)**: Aligns well with vision but isn't needed for MVP. Should be tackled soon after current phase.
1631
+ - **🟢 Backlog (future enhancement)**: Nice-to-have that aligns with vision but can wait. Added to Future Enhancements.
1632
+
1633
+ **Step 2F.3: Present Analysis to User**
1634
+
1635
+ - Display:
1636
+ ```
1637
+ 💡 Idea Analysis
1638
+
1639
+ Your Idea: [1-2 sentence summary of what they described]
1640
+
1641
+ 📊 Assessment:
1642
+ - Vision Alignment: [High/Medium/Low] — [brief reason]
1643
+ - User Impact: [High/Medium/Low] — [brief reason]
1644
+ - Effort: [Small (1 task) / Medium (2-3 tasks) / Large (new phase)]
1645
+ - Dependencies: [None / Depends on Task X / Blocks Task Y]
1646
+
1647
+ 🎯 Recommended Priority: [🔴 Critical / 🟡 Important / 🟢 Backlog]
1648
+
1649
+ Reasoning: [2-3 sentences explaining why this priority level was chosen,
1650
+ referencing vision alignment and current roadmap state]
1651
+ ```
1652
+
1653
+ - Use `ask_user` with choices:
1654
+ - "Accept this priority — add to roadmap"
1655
+ - "I think it's more urgent than that"
1656
+ - "I think it's less urgent — backlog is fine"
1657
+ - "Let me refine the idea first"
1658
+ - "Discard — I changed my mind"
1659
+
1660
+ **Step 2F.4: Handle Priority Override**
1661
+
1662
+ - **If "Accept this priority"**: Proceed to Step 2F.5
1663
+
1664
+ - **If "I think it's more urgent"**:
1665
+ - Bump priority one level up (🟢→🟡 or 🟡→🔴)
1666
+ - If already 🔴: Acknowledge and proceed
1667
+ - Display: `📘 Project Brain will remember this — you prioritize [idea type] higher than expected`
1668
+ - Invoke Child Brain with preference context (user values this type of feature highly)
1669
+ - Proceed to Step 2F.5
1670
+
1671
+ - **If "I think it's less urgent"**:
1672
+ - Bump priority one level down (🔴→🟡 or 🟡→🟢)
1673
+ - If already 🟢: Keep at backlog
1674
+ - Display: `📘 Project Brain will remember this — you prefer to defer [idea type]`
1675
+ - Proceed to Step 2F.5
1676
+
1677
+ - **If "Let me refine the idea"**:
1678
+ - Return to Step 2F.1 with previous input as context
1679
+
1680
+ - **If "Discard"**:
1681
+ - Display: "💭 No problem — idea discarded. Nothing was changed."
1682
+ - Return to the menu the user came from (Step 2 or Step 11)
1683
+
1684
+ **Step 2F.5: Insert into Roadmap**
1685
+
1686
+ - Based on final priority level:
1687
+
1688
+ - **🔴 Critical (current phase insertion)**:
1689
+ 1. Load roadmap and identify current phase tasks
1690
+ 2. Determine optimal insertion point:
1691
+ - After dependencies are met
1692
+ - Before tasks that would benefit from this idea
1693
+ - If no dependencies: insert as next uncompleted task
1694
+ 3. Create task number (next sequential number)
1695
+ 4. Create task document in `.mother-brain/docs/tasks/[number]-[name].md`
1696
+ 5. Insert task into `roadmap.md` at determined position
1697
+ 6. **Renumber subsequent tasks if needed** to maintain order
1698
+ 7. Display:
1699
+ ```
1700
+ ✅ Idea Added to Current Phase!
1701
+
1702
+ 📋 Task [Number]: [Task Name]
1703
+ - Priority: 🔴 Critical
1704
+ - Inserted: Phase [X], position [Y] of [Z]
1705
+ - Status: 🟡 Ready
1706
+
1707
+ ⚠️ Current plan adjusted:
1708
+ - [Brief description of what moved to accommodate this]
1709
+
1710
+ Your current task is still: [Current task name]
1711
+ This will be picked up [when in sequence].
1712
+ ```
1713
+
1714
+ - **🟡 Important (next phase priority)**:
1715
+ 1. Identify the next phase in roadmap (or create Phase N+1 if needed)
1716
+ 2. Create task number
1717
+ 3. Create task document
1718
+ 4. Insert at the TOP of the next phase (high priority within that phase)
1719
+ 5. Display:
1720
+ ```
1721
+ ✅ Idea Added to Next Phase!
1722
+
1723
+ 📋 Task [Number]: [Task Name]
1724
+ - Priority: 🟡 Important
1725
+ - Placed: Phase [X], position 1 (top priority)
1726
+ - Status: ⬜ Planned
1727
+
1728
+ Current plan unchanged — this is queued for after [current phase name].
1729
+ ```
1730
+
1731
+ - **🟢 Backlog (future enhancement)**:
1732
+ 1. Add to "Future Enhancements" section of roadmap
1733
+ 2. Create a lightweight task entry (no full task doc yet — created when promoted)
1734
+ 3. Display:
1735
+ ```
1736
+ ✅ Idea Added to Backlog!
1737
+
1738
+ 📋 [Idea Name]
1739
+ - Priority: 🟢 Backlog
1740
+ - Section: Future Enhancements
1741
+ - Status: 💭 Captured
1742
+
1743
+ Current plan unchanged. This will be reviewed during phase transitions.
1744
+ ```
1745
+
1746
+ **Step 2F.6: Update Session State & Return**
1747
+
1748
+ - Update `session-state.json` to reflect roadmap changes (new task count, etc.)
1749
+ - If task was added to current phase: Update `totalTasks` count
1750
+
1751
+ - Display:
1752
+ ```
1753
+ 💡 Idea captured! Back to where you were.
1754
+ ```
1755
+
1756
+ - **Return to the menu the user came from**:
1757
+ - If came from Step 2 (main menu): Return to Step 2
1758
+ - If came from Step 11 (post-task menu): Return to Step 11
1759
+ - If came from mid-task: Resume task execution
1760
+
1761
+ **Key Principles**:
1762
+ - **Speed over ceremony**: Get the idea down fast, analyze quickly, don't interrupt flow
1763
+ - **Vision is the compass**: Priority is always relative to the stated vision
1764
+ - **Current work is protected**: Only 🔴 Critical ideas touch the current phase
1765
+ - **Nothing is lost**: Even discarded ideas could be re-suggested if patterns emerge
1766
+ - **User has final say**: Mother Brain recommends priority, user can override
1767
+
1768
+ ### 2G. **Task Resume Preview** (Continue Where You Left Off)
1769
+ - When user selects "Continue where I left off" from the main project menu:
1770
+
1771
+ **Purpose**: Show the user exactly what task they're about to resume, where it sits in the plan, and give them the option to proceed, switch tasks, or review context before diving in. Never jump straight into execution.
1772
+
1773
+ **Step 2G.1: Load Current Task Context**
1774
+
1775
+ - Load `session-state.json` to get `lastTask` and `lastTaskStatus`
1776
+ - Load `roadmap.md` to get phase context and task position
1777
+ - Load the current task document from `.mother-brain/docs/tasks/[task].md`
1778
+ - Determine:
1779
+ - Is the last task complete or in-progress?
1780
+ - If complete: the "current task" is the NEXT uncompleted task in the roadmap
1781
+ - If in-progress: the "current task" is the last task
1782
+
1783
+ **Step 2G.2: Display Task Preview**
1784
+
1785
+ - Display:
1786
+ ```
1787
+ 🎯 Current Task
1788
+
1789
+ 📋 Task [Number]: [Task Name]
1790
+ - Phase: [Phase Name] ([X] of [Y] tasks completed in this phase)
1791
+ - Status: [🟡 In Progress / ⬜ Ready to Start]
1792
+ - Type: [Logic / UI / Animation / Integration / etc.]
1793
+
1794
+ 📝 Objective:
1795
+ [Task objective from task document]
1796
+
1797
+ ✅ Success Criteria:
1798
+ - [Criterion 1]
1799
+ - [Criterion 2]
1800
+
1801
+ 🛠️ Skills Available:
1802
+ - [Relevant skills for this task]
1803
+
1804
+ 📍 Roadmap Context:
1805
+ - Previous: Task [N-1] - [Name] (✅ Complete)
1806
+ - **Current: Task [N] - [Name]** ← You are here
1807
+ - Next: Task [N+1] - [Name] (⬜ Planned)
1808
+ ```
1809
+
1810
+ **Step 2G.3: Ask User How to Proceed**
1811
+
1812
+ - Use `ask_user` with choices:
1813
+ - "Start this task now"
1814
+ - "Skip to a different task"
1815
+ - "Review the full roadmap first"
1816
+ - "💡 I have a new idea"
1817
+ - "Back to main menu"
1818
+
1819
+ - **If "Start this task now"**: Proceed to Step 9 (Task Execution) with this task
1820
+ - **If "Skip to a different task"**:
1821
+ - Load roadmap and list all uncompleted tasks in current phase
1822
+ - Use `ask_user` with task names as choices
1823
+ - Load selected task and proceed to Step 9
1824
+ - **If "Review the full roadmap"**: Display roadmap, then return to Step 2G.3
1825
+ - **If "I have a new idea"**: Jump to Step 2F
1826
+ - **If "Back to main menu"**: Return to Step 2
1827
+
1594
1828
  ### 2C. **Archive Project** (Save & Reset)
1595
1829
  - When user selects "Archive project (save & reset for new project)":
1596
1830
 
@@ -2189,19 +2423,33 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2189
2423
 
2190
2424
  **Step 5.4.1: Technology Pitfalls & Gotchas Research (MANDATORY)**
2191
2425
  - For EACH technology/platform/tool identified in vision or research:
2426
+
2427
+ **First, check Elder Brain (experience-vault/) for existing knowledge:**
2428
+ - Use grep to search: `grep -r "[technology]" experience-vault/`
2429
+ - If gotchas exist in Elder Brain:
2430
+ - Load the relevant .md files
2431
+ - Use this knowledge to inform skill creation
2432
+ - No need to re-research what's already known
2433
+
2434
+ **If NOT in Elder Brain, research and contribute:**
2192
2435
  - Use `web_search` to research:
2193
- 1. "common [technology] mistakes and pitfalls"
2436
+ 1. "common [technology] mistakes and pitfalls [current year]"
2194
2437
  2. "[technology] gotchas first-time users encounter"
2195
2438
  3. "[technology] troubleshooting guide"
2196
2439
  4. "[technology] deployment issues and solutions" (if applicable)
2197
- - Save findings to `.mother-brain/docs/research/[technology]-gotchas.md`
2440
+ - Save findings to BOTH:
2441
+ 1. `.mother-brain/docs/research/[technology]-gotchas.md` (project-specific)
2442
+ 2. `experience-vault/[category]/[technology].md` (for all future projects)
2198
2443
  - Document:
2199
2444
  - **Common Mistakes**: What do beginners get wrong?
2200
2445
  - **Setup Traps**: First-time setup issues (permissions, configuration, prerequisites)
2201
2446
  - **Known Failures**: Transient errors vs real failures
2202
2447
  - **Workarounds**: Standard solutions to known problems
2448
+
2449
+ **Result:**
2203
2450
  - This research gets embedded in skills created for this technology
2204
2451
  - Skills become defensive, anticipating known issues instead of only happy-path
2452
+ - Future projects benefit immediately from Elder Brain knowledge
2205
2453
 
2206
2454
  **Step 5.5: Extract Technical Insights from Research**
2207
2455
  - Parse research results to identify:
@@ -2417,13 +2665,46 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2417
2665
  - **Create Initial 3 Skills** (Upfront - minimum viable skill set):
2418
2666
  - Display: "🔨 Creating initial 3 skills for project..."
2419
2667
  - Select 3 most critical skills from essential list (based on immediate MVP needs)
2668
+
2669
+ - **CHECKPOINT: Consult Elder Brain for Each Skill**
2670
+ - Before invoking skill-creator for each skill:
2671
+ 1. Identify domains/technologies this skill will work with
2672
+ - Example: "firebase-deployer" → Firebase, deployment
2673
+ 2. Check Elder Brain for related knowledge:
2674
+ ```powershell
2675
+ grep -r "Firebase" experience-vault/
2676
+ grep -r "deployment" experience-vault/
2677
+ ```
2678
+ 3. If gotcha files found:
2679
+ - Load content from experience-vault/
2680
+ - Prepare Elder Brain context for skill-creator
2681
+ 4. If no gotchas found:
2682
+ - Note this for later research during task execution
2683
+
2420
2684
  - For each of the 3 initial skills:
2421
2685
  - Show progress: "Creating [skill-name]..."
2422
- - Invoke skill-creator with context from research findings:
2423
- - Role/pattern/need from Step 5 analysis
2424
- - Relevant gotchas research from Step 5.4.1 (if skill involves specific technology)
2425
- - Example: "firebase-deployer skill should include gotchas about permission propagation, environment config, console prerequisites"
2426
- - Let skill-creator run its wizard with gotchas knowledge
2686
+ - Invoke skill-creator with THREE knowledge sources:
2687
+ 1. **Research findings** from Step 5 analysis (role/pattern/need)
2688
+ 2. **Gotchas research** from Step 5.4.1 (project-specific research)
2689
+ 3. **Elder Brain knowledge** (cross-project domain wisdom)
2690
+ - Example context for skill-creator:
2691
+ ```
2692
+ Skill: firebase-deployer
2693
+
2694
+ From Research (Step 5):
2695
+ - Role: DevOps automation
2696
+ - Pattern: Deployment with retry logic
2697
+
2698
+ From Gotchas Research (Step 5.4.1):
2699
+ - Firebase CLI auth expires after 7 days
2700
+ - Large deployments may timeout
2701
+
2702
+ From Elder Brain (experience-vault/):
2703
+ - Firebase Auth needs Console click-through first
2704
+ - Environment variables need both dashboard + .env.production
2705
+ - Authorized domains must be configured for production
2706
+ ```
2707
+ - Let skill-creator run its wizard with all three knowledge sources
2427
2708
  - **Store created skills in `.github/skills/`** (CLI-discoverable location)
2428
2709
  - **Track in session-state.json**: Add skill name to `skillsCreated` array
2429
2710
  - **VALIDATE SKILL** (CRITICAL - prevents task execution failures):
@@ -2633,6 +2914,52 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2633
2914
  **Estimated Timeline**: [From vision document]
2634
2915
  ```
2635
2916
 
2917
+ **Step 7.3.5: CHECKPOINT - Review Roadmap Against Elder Brain**
2918
+ - **Purpose**: Surface known pitfalls for the tech stack BEFORE task execution begins
2919
+
2920
+ - For EACH technology/platform identified in roadmap tasks:
2921
+ 1. Extract tech mentions from task descriptions
2922
+ - Example: "Set up Firebase Auth" → Firebase, Authentication
2923
+ - Example: "Deploy to Vercel" → Vercel, Deployment
2924
+ - Example: "Create React components" → React, UI
2925
+
2926
+ 2. Check Elder Brain for relevant gotchas:
2927
+ ```powershell
2928
+ grep -ri "Firebase" experience-vault/
2929
+ grep -ri "Vercel" experience-vault/
2930
+ grep -ri "React" experience-vault/
2931
+ ```
2932
+
2933
+ 3. For EACH gotcha file found:
2934
+ - Load content from experience-vault/
2935
+ - Identify which roadmap tasks are affected
2936
+ - Add defensive note to those task descriptions
2937
+
2938
+ 4. Example transformation:
2939
+ ```markdown
2940
+ # BEFORE Elder Brain check:
2941
+ - [ ] Task 003: Set up Firebase Authentication
2942
+
2943
+ # AFTER Elder Brain check:
2944
+ - [ ] Task 003: Set up Firebase Authentication
2945
+ ⚠️ Prerequisites: Enable Auth in Firebase Console first
2946
+ 📚 See: experience-vault/platforms/firebase-auth.md
2947
+ ```
2948
+
2949
+ 5. If NO Elder Brain knowledge exists for a technology:
2950
+ - Note this in Project Brain for future contribution
2951
+ - Expect to research during task execution
2952
+
2953
+ - Display:
2954
+ ```
2955
+ 🧙 Elder Brain consulted
2956
+ - [X] technologies checked
2957
+ - [Y] known gotchas surfaced in roadmap
2958
+ ```
2959
+
2960
+ - Update roadmap.md with Elder Brain references
2961
+ - This makes pitfalls visible BEFORE tasks start, not during failures
2962
+
2636
2963
  **Step 7.4: Display Roadmap Summary** (No Approval Required)
2637
2964
  - Show roadmap structure to user (for transparency, not approval)
2638
2965
  - Display:
@@ -2856,6 +3183,43 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2856
3183
  - What creative/visual/narrative elements does this task involve?
2857
3184
  - What domain knowledge is required?
2858
3185
  - What style/tone preferences apply?
3186
+ - **What technologies/platforms does this task use?** (for Elder Brain check)
3187
+
3188
+ 2.5. **CHECKPOINT: Consult Elder Brain for This Task**
3189
+ - Extract technology/platform mentions from task:
3190
+ - Task title: "Set up Firebase Auth" → Firebase, Authentication
3191
+ - Task description: "Deploy React app to Vercel" → React, Vercel, Deployment
3192
+ - Task deliverables: "PostgreSQL schema" → PostgreSQL, Database
3193
+
3194
+ - For EACH technology identified:
3195
+ ```powershell
3196
+ grep -ri "[technology]" experience-vault/
3197
+ ```
3198
+
3199
+ - If gotcha files found:
3200
+ 1. Load content from experience-vault/
3201
+ 2. Display relevant gotchas to Mother Brain (for awareness)
3202
+ 3. Apply defensive patterns automatically during execution
3203
+
3204
+ Example:
3205
+ ```
3206
+ 🧙 Elder Brain: Firebase Auth
3207
+
3208
+ Known gotchas for this task:
3209
+ - Firebase Auth requires Console click-through before API works
3210
+ - Environment variables need both dashboard + .env.production
3211
+ - Authorized domains required for production
3212
+
3213
+ Applying defensive patterns:
3214
+ ✓ Will verify Console setup before implementing
3215
+ ✓ Will check for .env.production file
3216
+ ✓ Will add domain authorization to task checklist
3217
+ ```
3218
+
3219
+ - If NO gotchas found:
3220
+ - Note: "No Elder Brain knowledge for [technology]"
3221
+ - Expect to research during execution if issues arise
3222
+ - Plan to contribute back to Elder Brain after task
2859
3223
 
2860
3224
  3. **Skill Sufficiency Check** (CRITICAL):
2861
3225
  - List existing skills in `.github/skills/`
@@ -3010,7 +3374,40 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
3010
3374
  ### 9A. **Error Detection & Self-Healing**
3011
3375
  - When errors occur during task execution:
3012
3376
 
3013
- - **Document the Issue**:
3377
+ - **FIRST: Check Elder Brain for Known Solution**:
3378
+ 1. Extract technology/error context from error message:
3379
+ - "Firebase permission denied" → Firebase, permissions
3380
+ - "Vercel build failed: env var undefined" → Vercel, environment variables
3381
+ - "PowerShell directory exists error" → PowerShell, Windows
3382
+
3383
+ 2. Search Elder Brain for this pattern:
3384
+ ```powershell
3385
+ grep -ri "[technology]" experience-vault/
3386
+ grep -ri "[error keyword]" experience-vault/
3387
+ ```
3388
+
3389
+ 3. If matching gotcha found:
3390
+ ```
3391
+ 🧙 Elder Brain: Known Issue Found
3392
+
3393
+ Pattern: [gotcha title]
3394
+ Location: experience-vault/[category]/[file].md
3395
+
3396
+ Known Solution:
3397
+ [Solution from Elder Brain]
3398
+
3399
+ Applying fix...
3400
+ ```
3401
+ - Apply the documented solution immediately
3402
+ - Skip root cause analysis (already known)
3403
+ - Resume task execution
3404
+ - DONE - no further steps needed
3405
+
3406
+ 4. If NO Elder Brain knowledge:
3407
+ - Continue to root cause analysis below
3408
+ - Plan to contribute solution to Elder Brain after fixing
3409
+
3410
+ - **Document the Issue** (if NOT in Elder Brain):
3014
3411
  - What broke (error message, unexpected behavior)
3015
3412
  - What was being attempted
3016
3413
  - What the expected outcome was
@@ -3020,6 +3417,7 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
3020
3417
  - Was it a task definition issue? (unclear instructions)
3021
3418
  - Was it a Mother Brain issue? (missing step, wrong assumption)
3022
3419
  - Was it an environment issue? (dependencies, configuration)
3420
+ - **Was it a known domain gotcha?** (technology-specific pattern)
3023
3421
 
3024
3422
  - **Log & Learn**:
3025
3423
  - Add entry to `docs/learning-log.md`:
@@ -3030,15 +3428,22 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
3030
3428
  **Root Cause**: [Why it happened]
3031
3429
  **Fix Applied**: [How it was resolved]
3032
3430
  **Prevention**: [What to update to prevent recurrence]
3431
+ **Elder Brain Contribution**: [If domain gotcha, note for contribution]
3033
3432
  ```
3034
3433
 
3035
3434
  - **Self-Correction**:
3036
3435
  - Use `ask_user` with choices:
3436
+ - "Contribute to Elder Brain (domain gotcha)"
3037
3437
  - "Update [affected skill] to prevent this"
3038
3438
  - "Update Mother Brain process"
3039
3439
  - "Update task definition"
3040
3440
  - "Just fix it this time (one-off issue)"
3041
3441
 
3442
+ - If "Contribute to Elder Brain":
3443
+ - Invoke Child Brain to route the learning
3444
+ - Child Brain will create Elder Brain entry
3445
+ - Display: `🧙 Elder Brain will remember this`
3446
+
3042
3447
  - If updating skill/Mother Brain:
3043
3448
  - Jump to **Step 2A: Update Mother Brain** (if Mother Brain issue)
3044
3449
  - Or invoke skill-creator with "heal" mode (if skill issue)
@@ -3395,10 +3800,12 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
3395
3800
  - After task completion, use `ask_user` with choices:
3396
3801
  - After task completion, use `ask_user` with choices:
3397
3802
  - "Start next task automatically"
3803
+ - "💡 I have a new idea"
3398
3804
  - "Review roadmap and choose task"
3399
3805
  - "Take a break (save progress)"
3400
3806
  - "Update/refine the roadmap"
3401
3807
  - Freeform available for custom actions
3808
+ - **If "I have a new idea"**: Jump to **Step 2F: Idea Capture & Prioritization**
3402
3809
 
3403
3810
  - Save session state to `docs/session-state.json`:
3404
3811
  ```json