mother-brain 0.1.0 β†’ 0.2.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.2.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.2.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:
@@ -668,9 +668,11 @@ This pattern ensures NO workflow ever traps the userβ€”there's always an escape
668
668
  - "Improve documentation"
669
669
  - "Refactor or clean up code"
670
670
  - "πŸ“₯ Review community improvements"
671
+ - "πŸ’­ Brainstorm (thinking partner mode)"
671
672
  - "Continue previous meta-work"
672
673
 
673
674
  - **If "Review community improvements"**: Jump to **Step 2A.2: Review Community Improvements**
675
+ - **If "Brainstorm"**: Jump to **Step 2E: Brainstorm Mode** (framework-focused version)
674
676
 
675
677
  **Step 2.3.2: Track Meta-Work**
676
678
  - Update `.mother-brain/meta-mode.json` with focus:
@@ -2189,19 +2191,33 @@ This pattern ensures NO workflow ever traps the userβ€”there's always an escape
2189
2191
 
2190
2192
  **Step 5.4.1: Technology Pitfalls & Gotchas Research (MANDATORY)**
2191
2193
  - For EACH technology/platform/tool identified in vision or research:
2194
+
2195
+ **First, check Elder Brain (experience-vault/) for existing knowledge:**
2196
+ - Use grep to search: `grep -r "[technology]" experience-vault/`
2197
+ - If gotchas exist in Elder Brain:
2198
+ - Load the relevant .md files
2199
+ - Use this knowledge to inform skill creation
2200
+ - No need to re-research what's already known
2201
+
2202
+ **If NOT in Elder Brain, research and contribute:**
2192
2203
  - Use `web_search` to research:
2193
- 1. "common [technology] mistakes and pitfalls"
2204
+ 1. "common [technology] mistakes and pitfalls [current year]"
2194
2205
  2. "[technology] gotchas first-time users encounter"
2195
2206
  3. "[technology] troubleshooting guide"
2196
2207
  4. "[technology] deployment issues and solutions" (if applicable)
2197
- - Save findings to `.mother-brain/docs/research/[technology]-gotchas.md`
2208
+ - Save findings to BOTH:
2209
+ 1. `.mother-brain/docs/research/[technology]-gotchas.md` (project-specific)
2210
+ 2. `experience-vault/[category]/[technology].md` (for all future projects)
2198
2211
  - Document:
2199
2212
  - **Common Mistakes**: What do beginners get wrong?
2200
2213
  - **Setup Traps**: First-time setup issues (permissions, configuration, prerequisites)
2201
2214
  - **Known Failures**: Transient errors vs real failures
2202
2215
  - **Workarounds**: Standard solutions to known problems
2216
+
2217
+ **Result:**
2203
2218
  - This research gets embedded in skills created for this technology
2204
2219
  - Skills become defensive, anticipating known issues instead of only happy-path
2220
+ - Future projects benefit immediately from Elder Brain knowledge
2205
2221
 
2206
2222
  **Step 5.5: Extract Technical Insights from Research**
2207
2223
  - Parse research results to identify:
@@ -2417,13 +2433,46 @@ This pattern ensures NO workflow ever traps the userβ€”there's always an escape
2417
2433
  - **Create Initial 3 Skills** (Upfront - minimum viable skill set):
2418
2434
  - Display: "πŸ”¨ Creating initial 3 skills for project..."
2419
2435
  - Select 3 most critical skills from essential list (based on immediate MVP needs)
2436
+
2437
+ - **CHECKPOINT: Consult Elder Brain for Each Skill**
2438
+ - Before invoking skill-creator for each skill:
2439
+ 1. Identify domains/technologies this skill will work with
2440
+ - Example: "firebase-deployer" β†’ Firebase, deployment
2441
+ 2. Check Elder Brain for related knowledge:
2442
+ ```powershell
2443
+ grep -r "Firebase" experience-vault/
2444
+ grep -r "deployment" experience-vault/
2445
+ ```
2446
+ 3. If gotcha files found:
2447
+ - Load content from experience-vault/
2448
+ - Prepare Elder Brain context for skill-creator
2449
+ 4. If no gotchas found:
2450
+ - Note this for later research during task execution
2451
+
2420
2452
  - For each of the 3 initial skills:
2421
2453
  - 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
2454
+ - Invoke skill-creator with THREE knowledge sources:
2455
+ 1. **Research findings** from Step 5 analysis (role/pattern/need)
2456
+ 2. **Gotchas research** from Step 5.4.1 (project-specific research)
2457
+ 3. **Elder Brain knowledge** (cross-project domain wisdom)
2458
+ - Example context for skill-creator:
2459
+ ```
2460
+ Skill: firebase-deployer
2461
+
2462
+ From Research (Step 5):
2463
+ - Role: DevOps automation
2464
+ - Pattern: Deployment with retry logic
2465
+
2466
+ From Gotchas Research (Step 5.4.1):
2467
+ - Firebase CLI auth expires after 7 days
2468
+ - Large deployments may timeout
2469
+
2470
+ From Elder Brain (experience-vault/):
2471
+ - Firebase Auth needs Console click-through first
2472
+ - Environment variables need both dashboard + .env.production
2473
+ - Authorized domains must be configured for production
2474
+ ```
2475
+ - Let skill-creator run its wizard with all three knowledge sources
2427
2476
  - **Store created skills in `.github/skills/`** (CLI-discoverable location)
2428
2477
  - **Track in session-state.json**: Add skill name to `skillsCreated` array
2429
2478
  - **VALIDATE SKILL** (CRITICAL - prevents task execution failures):
@@ -2633,6 +2682,52 @@ This pattern ensures NO workflow ever traps the userβ€”there's always an escape
2633
2682
  **Estimated Timeline**: [From vision document]
2634
2683
  ```
2635
2684
 
2685
+ **Step 7.3.5: CHECKPOINT - Review Roadmap Against Elder Brain**
2686
+ - **Purpose**: Surface known pitfalls for the tech stack BEFORE task execution begins
2687
+
2688
+ - For EACH technology/platform identified in roadmap tasks:
2689
+ 1. Extract tech mentions from task descriptions
2690
+ - Example: "Set up Firebase Auth" β†’ Firebase, Authentication
2691
+ - Example: "Deploy to Vercel" β†’ Vercel, Deployment
2692
+ - Example: "Create React components" β†’ React, UI
2693
+
2694
+ 2. Check Elder Brain for relevant gotchas:
2695
+ ```powershell
2696
+ grep -ri "Firebase" experience-vault/
2697
+ grep -ri "Vercel" experience-vault/
2698
+ grep -ri "React" experience-vault/
2699
+ ```
2700
+
2701
+ 3. For EACH gotcha file found:
2702
+ - Load content from experience-vault/
2703
+ - Identify which roadmap tasks are affected
2704
+ - Add defensive note to those task descriptions
2705
+
2706
+ 4. Example transformation:
2707
+ ```markdown
2708
+ # BEFORE Elder Brain check:
2709
+ - [ ] Task 003: Set up Firebase Authentication
2710
+
2711
+ # AFTER Elder Brain check:
2712
+ - [ ] Task 003: Set up Firebase Authentication
2713
+ ⚠️ Prerequisites: Enable Auth in Firebase Console first
2714
+ πŸ“š See: experience-vault/platforms/firebase-auth.md
2715
+ ```
2716
+
2717
+ 5. If NO Elder Brain knowledge exists for a technology:
2718
+ - Note this in Project Brain for future contribution
2719
+ - Expect to research during task execution
2720
+
2721
+ - Display:
2722
+ ```
2723
+ πŸ§™ Elder Brain consulted
2724
+ - [X] technologies checked
2725
+ - [Y] known gotchas surfaced in roadmap
2726
+ ```
2727
+
2728
+ - Update roadmap.md with Elder Brain references
2729
+ - This makes pitfalls visible BEFORE tasks start, not during failures
2730
+
2636
2731
  **Step 7.4: Display Roadmap Summary** (No Approval Required)
2637
2732
  - Show roadmap structure to user (for transparency, not approval)
2638
2733
  - Display:
@@ -2856,6 +2951,43 @@ This pattern ensures NO workflow ever traps the userβ€”there's always an escape
2856
2951
  - What creative/visual/narrative elements does this task involve?
2857
2952
  - What domain knowledge is required?
2858
2953
  - What style/tone preferences apply?
2954
+ - **What technologies/platforms does this task use?** (for Elder Brain check)
2955
+
2956
+ 2.5. **CHECKPOINT: Consult Elder Brain for This Task**
2957
+ - Extract technology/platform mentions from task:
2958
+ - Task title: "Set up Firebase Auth" β†’ Firebase, Authentication
2959
+ - Task description: "Deploy React app to Vercel" β†’ React, Vercel, Deployment
2960
+ - Task deliverables: "PostgreSQL schema" β†’ PostgreSQL, Database
2961
+
2962
+ - For EACH technology identified:
2963
+ ```powershell
2964
+ grep -ri "[technology]" experience-vault/
2965
+ ```
2966
+
2967
+ - If gotcha files found:
2968
+ 1. Load content from experience-vault/
2969
+ 2. Display relevant gotchas to Mother Brain (for awareness)
2970
+ 3. Apply defensive patterns automatically during execution
2971
+
2972
+ Example:
2973
+ ```
2974
+ πŸ§™ Elder Brain: Firebase Auth
2975
+
2976
+ Known gotchas for this task:
2977
+ - Firebase Auth requires Console click-through before API works
2978
+ - Environment variables need both dashboard + .env.production
2979
+ - Authorized domains required for production
2980
+
2981
+ Applying defensive patterns:
2982
+ βœ“ Will verify Console setup before implementing
2983
+ βœ“ Will check for .env.production file
2984
+ βœ“ Will add domain authorization to task checklist
2985
+ ```
2986
+
2987
+ - If NO gotchas found:
2988
+ - Note: "No Elder Brain knowledge for [technology]"
2989
+ - Expect to research during execution if issues arise
2990
+ - Plan to contribute back to Elder Brain after task
2859
2991
 
2860
2992
  3. **Skill Sufficiency Check** (CRITICAL):
2861
2993
  - List existing skills in `.github/skills/`
@@ -3010,7 +3142,40 @@ This pattern ensures NO workflow ever traps the userβ€”there's always an escape
3010
3142
  ### 9A. **Error Detection & Self-Healing**
3011
3143
  - When errors occur during task execution:
3012
3144
 
3013
- - **Document the Issue**:
3145
+ - **FIRST: Check Elder Brain for Known Solution**:
3146
+ 1. Extract technology/error context from error message:
3147
+ - "Firebase permission denied" β†’ Firebase, permissions
3148
+ - "Vercel build failed: env var undefined" β†’ Vercel, environment variables
3149
+ - "PowerShell directory exists error" β†’ PowerShell, Windows
3150
+
3151
+ 2. Search Elder Brain for this pattern:
3152
+ ```powershell
3153
+ grep -ri "[technology]" experience-vault/
3154
+ grep -ri "[error keyword]" experience-vault/
3155
+ ```
3156
+
3157
+ 3. If matching gotcha found:
3158
+ ```
3159
+ πŸ§™ Elder Brain: Known Issue Found
3160
+
3161
+ Pattern: [gotcha title]
3162
+ Location: experience-vault/[category]/[file].md
3163
+
3164
+ Known Solution:
3165
+ [Solution from Elder Brain]
3166
+
3167
+ Applying fix...
3168
+ ```
3169
+ - Apply the documented solution immediately
3170
+ - Skip root cause analysis (already known)
3171
+ - Resume task execution
3172
+ - DONE - no further steps needed
3173
+
3174
+ 4. If NO Elder Brain knowledge:
3175
+ - Continue to root cause analysis below
3176
+ - Plan to contribute solution to Elder Brain after fixing
3177
+
3178
+ - **Document the Issue** (if NOT in Elder Brain):
3014
3179
  - What broke (error message, unexpected behavior)
3015
3180
  - What was being attempted
3016
3181
  - What the expected outcome was
@@ -3020,6 +3185,7 @@ This pattern ensures NO workflow ever traps the userβ€”there's always an escape
3020
3185
  - Was it a task definition issue? (unclear instructions)
3021
3186
  - Was it a Mother Brain issue? (missing step, wrong assumption)
3022
3187
  - Was it an environment issue? (dependencies, configuration)
3188
+ - **Was it a known domain gotcha?** (technology-specific pattern)
3023
3189
 
3024
3190
  - **Log & Learn**:
3025
3191
  - Add entry to `docs/learning-log.md`:
@@ -3030,15 +3196,22 @@ This pattern ensures NO workflow ever traps the userβ€”there's always an escape
3030
3196
  **Root Cause**: [Why it happened]
3031
3197
  **Fix Applied**: [How it was resolved]
3032
3198
  **Prevention**: [What to update to prevent recurrence]
3199
+ **Elder Brain Contribution**: [If domain gotcha, note for contribution]
3033
3200
  ```
3034
3201
 
3035
3202
  - **Self-Correction**:
3036
3203
  - Use `ask_user` with choices:
3204
+ - "Contribute to Elder Brain (domain gotcha)"
3037
3205
  - "Update [affected skill] to prevent this"
3038
3206
  - "Update Mother Brain process"
3039
3207
  - "Update task definition"
3040
3208
  - "Just fix it this time (one-off issue)"
3041
3209
 
3210
+ - If "Contribute to Elder Brain":
3211
+ - Invoke Child Brain to route the learning
3212
+ - Child Brain will create Elder Brain entry
3213
+ - Display: `πŸ§™ Elder Brain will remember this`
3214
+
3042
3215
  - If updating skill/Mother Brain:
3043
3216
  - Jump to **Step 2A: Update Mother Brain** (if Mother Brain issue)
3044
3217
  - Or invoke skill-creator with "heal" mode (if skill issue)