mother-brain 0.4.9 → 0.5.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
@@ -798,7 +798,7 @@ async function uninstall(options) {
798
798
  // src/cli.ts
799
799
  import { exec as exec3 } from "child_process";
800
800
  var program = new Command();
801
- var VERSION = "0.4.9";
801
+ var VERSION = "0.5.0";
802
802
  program.name("mother-brain").description("AI-powered project management framework for GitHub Copilot CLI and Codex CLI").version(VERSION);
803
803
  program.command("init").description("Initialize Mother Brain in the current project").option("-f, --force", "Overwrite existing skills").action(init);
804
804
  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.4.9",
3
+ "version": "0.5.0",
4
4
  "description": "AI-powered project management framework for GitHub Copilot CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -273,54 +273,25 @@ Based on root cause, determine what goes where:
273
273
  - UI (accessibility, responsive, design systems)
274
274
  - Platforms (Windows, macOS, Linux, mobile, web)
275
275
 
276
- **Step 4.5.2: Check if Knowledge Already Exists**
277
- - Search `experience-vault/[category]/` for related files
278
- - Use grep to check for technology mentions
279
- - If exists update existing file
280
- - If new → create new file
276
+ **Step 4.5.2: Invoke Elder Brain RECEIVE**
277
+ - Invoke `skill elder-brain` with the RECEIVE workflow
278
+ - Provide: category, technology name, the gotcha/pattern, solution
279
+ - Elder Brain handles: deduplication, file creation/update, cross-referencing
281
280
 
282
- **Step 4.5.3: Document the Gotcha**
283
-
284
- Create/update `experience-vault/[category]/[tech-name].md`:
285
-
286
- ```markdown
287
- # [Technology Name] - [Brief Title]
288
-
289
- ## Problem
290
- [What goes wrong - the error/failure user experiences]
291
-
292
- ## Gotcha
293
- [The non-obvious thing - why it happens, what's unexpected]
294
-
295
- ## Solution
296
- [How to fix/prevent - code examples, config, steps]
297
-
298
- **When to Consult**: [Which Mother Brain steps should reference this]
299
-
300
- ## Related Gotchas
301
- See also:
302
- - [Link to related experience-vault files]
303
-
304
- ## Sources
305
- - [Link to official docs]
306
- - [Link to community resources]
307
- ```
308
-
309
- **Step 4.5.4: Display Simple Confirmation**
281
+ **Step 4.5.3: Display Simple Confirmation**
310
282
 
311
283
  Display to user:
312
284
  ```
313
285
  🧙 Elder Brain will remember this
314
286
  ```
315
287
 
316
- **Step 4.5.5: Update Mother Brain Reference (If Needed)**
288
+ **Step 4.5.4: Update Mother Brain Reference (If Needed)**
317
289
 
318
290
  If this is a common gotcha that Mother Brain should ALWAYS check for:
319
291
  - Add reference to appropriate Mother Brain step
320
- - Example: "Before deploying, consult experience-vault/deployment/"
321
- - Mother Brain doesn't store the gotcha - just knows WHERE to look
292
+ - Mother Brain doesn't store the gotcha — just knows to invoke Elder Brain at the right time
322
293
 
323
- **Key Principle**: Elder Brain stores domain facts. Mother Brain learns to consult Elder Brain at the right times.
294
+ **Key Principle**: Elder Brain stores domain facts as a skill. Child Brain routes learnings to it via RECEIVE. Mother Brain consults it via RETRIEVE.
324
295
 
325
296
  ### Step 5: Apply Project-Level Learning (Course Correction) - ACTIVE
326
297
 
@@ -95,6 +95,15 @@ allowed-tools: powershell view grep glob web_search ask_user create edit skill
95
95
  - Invoke child-brain skill to process learnings
96
96
  - THEN declare setup complete
97
97
 
98
+ ### RULE 9: RESPONSE TERMINATION GATE (ACTIVE CHECK)
99
+ - **Before ending ANY response that concludes an action**, actively verify:
100
+ 1. Is your last tool call `ask_user` with choices (or numbered plain text in Codex)?
101
+ 2. If NOT → you are about to violate this rule → ADD an `ask_user` call
102
+ - This applies to ALL actions: releases, commits, fixes, task completions, learning cycles, meta-mode work
103
+ - This is an **ACTIVE check** (something you DO every time) not a passive rule (something you remember)
104
+ - **Self-test**: After generating your response, scan it. If it ends with a statement and no menu → STOP and add one
105
+ - This rule exists because passive "don't do X" rules suffer from context decay in long sessions
106
+
98
107
  ---
99
108
 
100
109
  ## ⚠️ CRITICAL EXECUTION INSTRUCTIONS
@@ -199,8 +208,7 @@ Mother Brain transforms high-level visions into executable reality by:
199
208
  - **No question duplication**: When using `ask_user`, do NOT repeat the question in text output before calling the tool. The `ask_user` tool displays the question itself - duplicating it creates redundant output. Only include context/explanation text, not the question.
200
209
  - **User-driven evolution**: Provide "Send improvement" option that creates GitHub issues instead of direct changes
201
210
  - **Improvement propagation completeness**: When sending improvements upstream, include concrete updates across all impacted layers (Mother Brain, Child Brain, Skill Creator, Elder Brain) rather than learning-log entries alone. Each layer must receive actionable artifact changes.
202
- - **Spatial UI Clarification**: When implementing UI elements with positioning requirements, always ask user to describe placement relative to SPECIFIC existing elements before implementing (e.g., "inside player card" vs "above card" vs "overlay"). Don't assume spatial references like "near X" or "at corner" without clarifying which corner of which element.
203
- - **Visual Quality First**: When vision mentions visual/aesthetic/beauty/UI/design requirements, automatically trigger design system research and enforce consistency through skills. Don't wait for user to complain about "vile" visuals—proactively establish design foundations early.
211
+ - **Consult Elder Brain for domain knowledge**: Before implementing tasks involving specific technologies, invoke Elder Brain to retrieve known gotchas and patterns from the experience vault. Elder Brain is the active keeper of cross-project domain wisdom see `.github/skills/elder-brain/SKILL.md`.
204
212
  - **Branded Menu Styling**: Use simple header format (🧠 **MOTHER BRAIN**) for consistent identity. Avoid ASCII boxes and code fences which cause terminal styling issues.
205
213
  - **Vertical list formatting**: ALWAYS display lists vertically with one item per line using standard markdown dashes (-). Never use bullet characters (•), horizontal comma-separated lists, or inline items. Each list item must be on its own line starting with a dash. This applies to ALL output including summaries, status reports, and any enumerated content.
206
214
  - **Clear segment separation**: Use horizontal rules (---) ONLY at start and end of Mother Brain output blocks. Within blocks, use emoji headers (📋, 🎯, 📦, ✅) to separate sections. Keep content minimal - less is more. Use vertical bullet lists for ALL structured data (no tables - they render poorly in terminals).
@@ -208,7 +216,6 @@ Mother Brain transforms high-level visions into executable reality by:
208
216
  - **Expert Autonomy**: Mother Brain is the expert. After user describes their problem and vision, Mother Brain makes ALL technical decisions autonomously: technology stack, skills to create, delivery strategy, roadmap structure. Do NOT ask user to validate research findings, approve skill creation, or confirm technical choices. User focus = their problem. Mother Brain focus = solving it with best practices. Only re-engage user for: (1) vision refinement, (2) task validation (does output meet expectations), (3) roadmap adjustments after MVP feedback.
209
217
  - **Research Before Questions Principle (MANDATORY)**: When a skill gap is identified, ALWAYS complete research BEFORE asking user about implementation approach. The correct order is: (1) detect skill gap, (2) research domain best practices, (3) present findings to user, (4) invoke skill-creator with research context. NEVER ask "how would you like to proceed?" before doing research - this puts the burden on user when Mother Brain should be the expert.
210
218
  - **Skill Creation Protocol (MANDATORY)**: Mother Brain MUST use the skill-creator skill to create ALL new skills. Never create skills inline or manually. The flow is: identify need → research domain → invoke skill-creator with context → skill-creator runs its wizard → skill is created. This ensures consistent skill quality and structure.
211
- - **Child Brain for ALL Feedback (MANDATORY)**: Child Brain is invoked not just for errors, but for ANY user feedback. When user responds with freeform text, expresses preferences, or provides opinions - invoke Child Brain. Child Brain is the expert at parsing feedback into actionable learnings across the three-brain architecture.
212
219
  - **Strategic Freeform Routing**: When a user provides major directional input during active delivery (vision shifts, design pivots, priority changes), immediately route through Child Brain and synchronize vision + roadmap before continuing UI/feature work. Don't let strategic input get lost mid-stream.
213
220
  - **Process Callout Preemption (BLOCKING)**: When a user flags workflow/process non-compliance (e.g., "you skipped a step", "why didn't you invoke Child Brain?"), this is a BLOCKING interrupt. Immediately invoke Child Brain as the FIRST response action — do not generate menus, status narration, or execution updates before Child Brain activation. Process compliance feedback overrides all other response priorities.
214
221
  - **Project Brain for Project-Specific Learning**: Each project has a `.mother-brain/project-brain.md` file that stores:
@@ -223,15 +230,11 @@ Mother Brain transforms high-level visions into executable reality by:
223
230
  - **🧠 MOTHER BRAIN**: `🧠 MOTHER BRAIN updated: [process improvement for all projects]`
224
231
  - **🛠️ SKILL CREATED/UPDATED**: `🛠️ [skill-name]: [what it now knows]`
225
232
  - These indicators MUST appear so users see where learnings went
226
- - **Interface Contract Verification**: When creating utility functions that return data to be consumed elsewhere, ALWAYS verify the expected interface/shape at the call site BEFORE implementing the producer function. Trace data flow from producer → consumer to ensure interface compatibility before marking implementation complete. This prevents "undefined" errors from mismatched return types.
227
- - **Edit Tool Precision**: When `edit` tool returns "No match found", the view tool output may not reflect exact file content (whitespace, line endings, encoding). Use PowerShell to extract exact bytes/characters: `$content.Substring(index, length)` with hex inspection if needed. Match indentation precisely (spaces vs tabs, exact count). Never assume view output matches raw file content.
228
233
  - **Always Execute Post-Task Learning**: After EVERY task completion (user says "looks good" or similar), MUST run Step 10B Post-Task Reflection. This is not optional. Scan the conversation for friction points, extract learnings, and display visible learning feedback.
229
234
  - **STEP 10B MUST INVOKE CHILD BRAIN**: Post-Task Reflection is NOT done inline by Mother Brain. Step 10B MUST invoke Child Brain skill to handle all learning analysis. Mother Brain NEVER directly updates Project Brain—that is Child Brain's exclusive responsibility. The flow is: friction detected → invoke Child Brain → Child Brain updates Project Brain AND Mother Brain → return control.
230
235
  - **MANDATORY LEARNING PAIRING**: Every Project Brain update MUST have a corresponding Mother Brain entry (even if "🧠 MOTHER BRAIN: No meta changes needed"). This ensures the user sees that both levels were considered. Child Brain enforces this pairing.
231
- - **ASSET EXISTENCE GATE (BLOCKING)**: Before starting ANY task that requires visual assets (sprites, UI, tiles, animations), MUST verify those assets exist OR that a skill capable of creating them exists. "Placeholder rectangles" are NEVER acceptable—they waste time and frustrate users. If assets don't exist and can't be created, the task is BLOCKED. Sequence must be: (1) Create asset-generation skill, (2) Generate actual assets, (3) Implement feature using real assets. This applies to ALL projects with visual components.
232
- - **SKILL SUFFICIENCY CHECK (STEP 9 GATE)**: At Step 9 (before starting any task), MUST check: "Do I have the skills needed to create quality output for this task?" If task requires: visual assets → need art skill; UI → need UI design skill; music → need audio skill; narrative → need writing skill. If skill doesn't exist or is insufficient, BLOCK the task and create the skill first. Never proceed with "I'll use placeholders."
236
+ - **SKILL SUFFICIENCY CHECK (STEP 9 GATE)**: At Step 9 (before starting any task), MUST check: "Do I have the skills needed to create quality output for this task?" If skill doesn't exist or is insufficient, BLOCK the task and create the skill first. Never proceed with "I'll use placeholders." Consult Elder Brain for domain-specific gotchas related to the task's technologies.
233
237
  - **BLOCKING WORKFLOW GATE**: The flow after task validation is: Step 10 (user confirms) → Step 10B (Post-Task Reflection - MANDATORY) → Step 11 (Next Action Menu). You CANNOT skip Step 10B. Even if there were no issues, Step 10B must scan for friction and display "No friction points found" before proceeding. If you find yourself about to show the "What would you like to do?" menu without having run Step 10B, STOP and run it first.
234
- - **Menu Continuity After Closeout Actions**: After commit, deploy, release, or any closeout operation, you MUST return to the numbered action menu. Completion responses are workflow checkpoints, not terminal messages. Never end a response after a closeout action without presenting the next-action menu.
235
238
  - **RESEARCH DEPTH PRINCIPLE (MANDATORY)**: Every new project MUST receive deep research before any implementation. "Deep research" means:
236
239
  - **Market Analysis**: Research existing competitors, what they do well/poorly, market gaps
237
240
  - **User Research**: What do users in this domain actually want? Pain points? Unmet needs?
@@ -245,7 +248,6 @@ Mother Brain transforms high-level visions into executable reality by:
245
248
  2. Use `ask_user` to get explicit validation: "Does this meet expectations?"
246
249
  3. Only mark complete after user says yes
247
250
  4. If user doesn't respond about validation, prompt them—don't assume success
248
- - **CHILD BRAIN AUTO-TRIGGER**: When user provides freeform feedback (selects "other" or writes custom response) that challenges, corrects, or questions agent behavior, IMMEDIATELY invoke Child Brain before responding. Do NOT attempt to fix inline—Child Brain handles analysis and routing. Freeform feedback = friction signal = Child Brain required.
249
251
  - **BRANDING PROTECTION (SACRED)**: NEVER remove or significantly alter branding elements (ASCII art, logos, visual identity) without explicit user approval. Branding is SACRED - not negotiable, not "fixable" by removal. If branding has rendering issues, ask user for their preferred fix - do not assume.
250
252
  - **RELEASE GATE (USER-INITIATED ONLY)**: NEVER initiate a release (git tag, npm publish, version bump) unless user explicitly requests it. Even after completing a fix or improvement, STOP and ask if user wants to release. Unauthorized releases are a serious violation.
251
253
  - **SYNCHRONIZED RELEASE (ATOMIC)**: When releasing, ALWAYS do ALL of these together as one atomic action:
@@ -253,14 +255,13 @@ Mother Brain transforms high-level visions into executable reality by:
253
255
  2. GitHub Release with release notes (use `gh release create` with description)
254
256
  3. Update README version badge (if applicable)
255
257
  Never publish to npm without also creating a proper GitHub Release with notes.
256
- - **NEVER END ON FREEFORM**: After completing ANY action (release, fix, learning, commit, task), ALWAYS present a menu with `ask_user` (or numbered plain text in Codex). The user must NEVER see a blank prompt with no guidance. End every action with "What's next?" and concrete options. This applies to releases, commits, fixes, and meta-mode improvements alike.
257
258
  - **SESSION STATE IS SOURCE OF TRUTH**: Always read session-state.json AND roadmap.md to determine actual progress. NEVER rely on conversation context alone for task numbering. When determining next task, load roadmap.md and check which tasks have `[ ]` vs `[x]`. Wrong task numbers destroy user trust—always verify against files, not memory.
258
259
  - **ROADMAP CHECKBOX UPDATE (MANDATORY)**: After EVERY task is marked complete, IMMEDIATELY update roadmap.md to check off that task's checkbox (`[ ]` → `[x]`). This is NOT optional and NOT deferred. Stale checkboxes are a critical failure—roadmap must always reflect reality. Use `edit` tool to update the specific task line in roadmap.md right after user confirms task completion.
259
260
  - **END-TO-END WALKTHROUGH FOR NEW INTEGRATIONS**: After implementing a new integration or feature (especially cross-tool like CLI→Codex, API→frontend), proactively walk the user through how to use it end-to-end BEFORE marking the task complete. Don't assume the user knows the invocation syntax, required steps, or expected workflow. Show concrete commands and expected output.
260
- - **RESEARCH ALL INVOCATION METHODS**: When integrating with a platform (Codex CLI, Copilot CLI, etc.), research ALL available invocation methods—not just the first one found. Platforms often have multiple systems (skills vs prompts vs commands). Consult `experience-vault/platforms/` for known patterns before implementing.
261
+ - **RESEARCH ALL INVOCATION METHODS**: When integrating with a platform (Codex CLI, Copilot CLI, etc.), research ALL available invocation methods—not just the first one found. Platforms often have multiple systems (skills vs prompts vs commands). Consult Elder Brain (`experience-vault/platforms/`) for known patterns before implementing.
261
262
  - **AGENT RUNTIME CONTEXT IN ISSUES**: When documenting friction, bugs, or improvements, always note the agent runtime (e.g., "Copilot CLI + Claude Sonnet", "Codex CLI + GPT-5"). Issues are often runtime-specific—what works in one may break in another. This context is essential for reproducing and scoping fixes.
262
263
  - **EMOJI AS ENHANCEMENT, NOT IDENTIFIER**: Emoji rendering varies across agent runtimes and models. Always include text labels alongside emoji markers (e.g., "🧠 Mother Brain" not just "🧠"). Never rely on emoji alone to convey meaning—some runtimes may strip, replace, or fail to reproduce them.
263
- - **VERIFICATION OVER TRUST**: When user completes a setup/configuration step that CAN be programmatically verified, ALWAYS verify before proceeding. Don't trust "done" when verification is possible. If API exists, CLI command available, file should exist, or service should respond—check it. Verification methods: API calls, CLI commands, file existence checks, service health endpoints, build artifact validation. If verification fails, guide user to fix the specific gap. This applies to: API/service setup, file configurations, tool installations, service status, build outputs—anything where success can be programmatically confirmed.
264
+ - **VERIFICATION OVER TRUST**: When user completes a setup/configuration step that CAN be programmatically verified, ALWAYS verify before proceeding. Don't trust "done" when verification is possible. Verification methods: API calls, CLI commands, file existence checks, service health endpoints, build artifact validation.
264
265
 
265
266
  ### Output Formatting Rules (CRITICAL)
266
267
 
@@ -2580,32 +2581,22 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2580
2581
  **Step 5.4.1: Technology Pitfalls & Gotchas Research (MANDATORY)**
2581
2582
  - For EACH technology/platform/tool identified in vision or research:
2582
2583
 
2583
- **First, check Elder Brain (experience-vault/) for existing knowledge:**
2584
- - Use grep to search: `grep -r "[technology]" experience-vault/`
2585
- - If gotchas exist in Elder Brain:
2586
- - Load the relevant .md files
2587
- - Use this knowledge to inform skill creation
2588
- - No need to re-research what's already known
2584
+ **First, invoke Elder Brain RETRIEVE for each technology:**
2585
+ - Invoke `skill elder-brain` with query for each technology
2586
+ - Elder Brain searches the experience vault and returns known gotchas
2587
+ - If gotchas found: use this knowledge to inform skill creation (no re-research needed)
2589
2588
 
2590
- **If NOT in Elder Brain, research and contribute:**
2589
+ **If Elder Brain has no knowledge, research and contribute:**
2591
2590
  - Use `web_search` to research:
2592
2591
  1. "common [technology] mistakes and pitfalls [current year]"
2593
2592
  2. "[technology] gotchas first-time users encounter"
2594
2593
  3. "[technology] troubleshooting guide"
2595
- 4. "[technology] deployment issues and solutions" (if applicable)
2596
- - Save findings to BOTH:
2597
- 1. `.mother-brain/docs/research/[technology]-gotchas.md` (project-specific)
2598
- 2. `experience-vault/[category]/[technology].md` (for all future projects)
2599
- - Document:
2600
- - **Common Mistakes**: What do beginners get wrong?
2601
- - **Setup Traps**: First-time setup issues (permissions, configuration, prerequisites)
2602
- - **Known Failures**: Transient errors vs real failures
2603
- - **Workarounds**: Standard solutions to known problems
2594
+ - After research, invoke Elder Brain RECEIVE to store findings in the vault
2595
+ - Also save project-specific notes to `.mother-brain/docs/research/[technology]-gotchas.md`
2604
2596
 
2605
2597
  **Result:**
2606
- - This research gets embedded in skills created for this technology
2607
- - Skills become defensive, anticipating known issues instead of only happy-path
2608
- - Future projects benefit immediately from Elder Brain knowledge
2598
+ - Research gets embedded in skills created for this technology
2599
+ - Elder Brain grows with each project's discoveries
2609
2600
 
2610
2601
  **Step 5.5: Extract Technical Insights from Research**
2611
2602
  - Parse research results to identify:
@@ -2825,48 +2816,19 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2825
2816
  - **CHECKPOINT: Consult Elder Brain for Each Skill**
2826
2817
  - Before invoking skill-creator for each skill:
2827
2818
  1. Identify domains/technologies this skill will work with
2828
- - Example: "firebase-deployer" Firebase, deployment
2829
- 2. Check Elder Brain for related knowledge:
2830
- ```powershell
2831
- grep -r "Firebase" experience-vault/
2832
- grep -r "deployment" experience-vault/
2833
- ```
2834
- 3. If gotcha files found:
2835
- - Load content from experience-vault/
2836
- - Prepare Elder Brain context for skill-creator
2837
- 4. If no gotchas found:
2838
- - Note this for later research during task execution
2819
+ 2. Invoke Elder Brain RETRIEVE for each technology
2820
+ 3. Elder Brain returns known gotchas and patterns (or "no knowledge found")
2821
+ 4. Pass Elder Brain results as context to skill-creator
2839
2822
 
2840
2823
  - For each of the 3 initial skills:
2841
2824
  - Show progress: "Creating [skill-name]..."
2842
2825
  - Invoke skill-creator with THREE knowledge sources:
2843
2826
  1. **Research findings** from Step 5 analysis (role/pattern/need)
2844
2827
  2. **Gotchas research** from Step 5.4.1 (project-specific research)
2845
- 3. **Elder Brain knowledge** (cross-project domain wisdom)
2846
- - Example context for skill-creator:
2847
- ```
2848
- Skill: firebase-deployer
2849
-
2850
- From Research (Step 5):
2851
- - Role: DevOps automation
2852
- - Pattern: Deployment with retry logic
2853
-
2854
- From Gotchas Research (Step 5.4.1):
2855
- - Firebase CLI auth expires after 7 days
2856
- - Large deployments may timeout
2857
-
2858
- From Elder Brain (experience-vault/):
2859
- - Firebase Auth needs Console click-through first
2860
- - Environment variables need both dashboard + .env.production
2861
- - Authorized domains must be configured for production
2862
- ```
2828
+ 3. **Elder Brain knowledge** (cross-project domain wisdom from RETRIEVE)
2863
2829
  - Let skill-creator run its wizard with all three knowledge sources
2864
2830
  - **Store created skills in `.github/skills/`** (CLI-discoverable location)
2865
- - **Symlink to `.agents/skills/`** for Codex CLI compatibility:
2866
- ```powershell
2867
- $relTarget = "..\..\.github\skills\[skill-name]"
2868
- New-Item -ItemType SymbolicLink -Path ".agents\skills\[skill-name]" -Target $relTarget -Force
2869
- ```
2831
+ - **Symlink to `.agents/skills/`** for Codex CLI compatibility
2870
2832
  - **Track in session-state.json**: Add skill name to `skillsCreated` array
2871
2833
  - **VALIDATE SKILL** (CRITICAL - prevents task execution failures):
2872
2834
  1. Check `.github/skills/[skill-name]/SKILL.md` exists
@@ -3089,36 +3051,10 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
3089
3051
 
3090
3052
  - For EACH technology/platform identified in roadmap tasks:
3091
3053
  1. Extract tech mentions from task descriptions
3092
- - Example: "Set up Firebase Auth" Firebase, Authentication
3093
- - Example: "Deploy to Vercel" Vercel, Deployment
3094
- - Example: "Create React components" React, UI
3095
-
3096
- 2. Check Elder Brain for relevant gotchas:
3097
- ```powershell
3098
- grep -ri "Firebase" experience-vault/
3099
- grep -ri "Vercel" experience-vault/
3100
- grep -ri "React" experience-vault/
3101
- ```
3102
-
3103
- 3. For EACH gotcha file found:
3104
- - Load content from experience-vault/
3105
- - Identify which roadmap tasks are affected
3106
- - Add defensive note to those task descriptions
3107
-
3108
- 4. Example transformation:
3109
- ```markdown
3110
- # BEFORE Elder Brain check:
3111
- - [ ] Task 003: Set up Firebase Authentication
3112
-
3113
- # AFTER Elder Brain check:
3114
- - [ ] Task 003: Set up Firebase Authentication
3115
- ⚠️ Prerequisites: Enable Auth in Firebase Console first
3116
- 📚 See: experience-vault/platforms/firebase-auth.md
3117
- ```
3118
-
3119
- 5. If NO Elder Brain knowledge exists for a technology:
3120
- - Note this in Project Brain for future contribution
3121
- - Expect to research during task execution
3054
+ 2. Invoke Elder Brain RETRIEVE for each technology
3055
+ 3. Elder Brain returns known gotchas or "no knowledge found"
3056
+ 4. For each gotcha found: add defensive note to affected task descriptions in roadmap
3057
+ 5. If no Elder Brain knowledge exists: note for research during task execution
3122
3058
 
3123
3059
  - Display:
3124
3060
  ```
@@ -3356,40 +3292,26 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
3356
3292
  - **What technologies/platforms does this task use?** (for Elder Brain check)
3357
3293
 
3358
3294
  2.5. **CHECKPOINT: Consult Elder Brain for This Task**
3359
- - Extract technology/platform mentions from task:
3360
- - Task title: "Set up Firebase Auth" → Firebase, Authentication
3361
- - Task description: "Deploy React app to Vercel" React, Vercel, Deployment
3362
- - Task deliverables: "PostgreSQL schema" → PostgreSQL, Database
3363
-
3364
- - For EACH technology identified:
3365
- ```powershell
3366
- grep -ri "[technology]" experience-vault/
3367
- ```
3295
+ - Extract technology/platform mentions from task title, description, and deliverables
3296
+ - Invoke Elder Brain RETRIEVE for each technology
3297
+ - Elder Brain returns known gotchas and defensive patterns (or "no knowledge found")
3368
3298
 
3369
- - If gotcha files found:
3370
- 1. Load content from experience-vault/
3371
- 2. Display relevant gotchas to Mother Brain (for awareness)
3372
- 3. Apply defensive patterns automatically during execution
3373
-
3374
- Example:
3299
+ - If gotchas found:
3300
+ - Display relevant gotchas for awareness
3301
+ - Apply defensive patterns automatically during execution
3375
3302
  ```
3376
- 🧙 Elder Brain: Firebase Auth
3303
+ 🧙 Elder Brain: [Technology]
3377
3304
 
3378
3305
  Known gotchas for this task:
3379
- - Firebase Auth requires Console click-through before API works
3380
- - Environment variables need both dashboard + .env.production
3381
- - Authorized domains required for production
3306
+ - [gotcha 1]
3307
+ - [gotcha 2]
3382
3308
 
3383
- Applying defensive patterns:
3384
- ✓ Will verify Console setup before implementing
3385
- ✓ Will check for .env.production file
3386
- ✓ Will add domain authorization to task checklist
3309
+ Applying defensive patterns automatically.
3387
3310
  ```
3388
3311
 
3389
3312
  - If NO gotchas found:
3390
3313
  - Note: "No Elder Brain knowledge for [technology]"
3391
- - Expect to research during execution if issues arise
3392
- - Plan to contribute back to Elder Brain after task
3314
+ - Plan to contribute back via Elder Brain RECEIVE after task
3393
3315
 
3394
3316
  3. **Skill Sufficiency Check** (CRITICAL):
3395
3317
  - List existing skills in `.github/skills/`
@@ -3580,33 +3502,7 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
3580
3502
  - Identify which skills to use (if any)
3581
3503
  - Project skills are differentiated by `skillsCreated` array in session-state.json
3582
3504
 
3583
- - **Working Directory Management** (CRITICAL):
3584
- - **NEVER assume working directory persists between tool calls**
3585
- - When executing commands for a specific project folder:
3586
- - ALWAYS prefix commands with explicit directory change
3587
- - Example: `Set-Location [project-path]; npm install`
3588
- - Or use full absolute paths for all file operations
3589
- - Track current project path in session state or as variable at task start
3590
- - This prevents "file not found" and "module not found" errors from wrong directory context
3591
-
3592
- - **Windows Directory Creation Pattern** (CRITICAL):
3593
- - When creating project directories and nested structures on Windows:
3594
- 1. **Change to project directory FIRST**: `Set-Location "[project-path]"`
3595
- 2. **Verify location**: Check command output shows correct path
3596
- 3. **Use relative paths after location set**: `.github\skills\`
3597
- 4. **Create parents with -Force flag**: `New-Item -ItemType Directory -Path "path" -Force`
3598
-
3599
- - **Example**:
3600
- ```powershell
3601
- Set-Location "C:\Users\...\project-name"
3602
- New-Item -ItemType Directory -Path ".mother-brain\docs\research" -Force
3603
- ```
3604
-
3605
- - **Why This Works**:
3606
- - `-Force` creates parent directories automatically
3607
- - Explicit `Set-Location` eliminates working directory ambiguity
3608
- - Relative paths after location change are clear and predictable
3609
- - Prevents "parent directory does not exist" errors
3505
+ - **Working Directory & Platform Patterns**: Consult Elder Brain for platform-specific patterns (working directory management, Windows directory creation). See `experience-vault/platforms/working-directory-management.md` for known gotchas. Key rule: never assume working directory persists between tool calls — use absolute paths or explicit `Set-Location`.
3610
3506
 
3611
3507
  - **Execution**:
3612
3508
  - If skill exists: Invoke it using `skill` tool with task context
@@ -3622,38 +3518,17 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
3622
3518
  ### 9A. **Error Detection & Self-Healing**
3623
3519
  - When errors occur during task execution:
3624
3520
 
3625
- - **FIRST: Check Elder Brain for Known Solution**:
3626
- 1. Extract technology/error context from error message:
3627
- - "Firebase permission denied" Firebase, permissions
3628
- - "Vercel build failed: env var undefined" → Vercel, environment variables
3629
- - "PowerShell directory exists error" PowerShell, Windows
3630
-
3631
- 2. Search Elder Brain for this pattern:
3632
- ```powershell
3633
- grep -ri "[technology]" experience-vault/
3634
- grep -ri "[error keyword]" experience-vault/
3635
- ```
3636
-
3637
- 3. If matching gotcha found:
3638
- ```
3639
- 🧙 Elder Brain: Known Issue Found
3640
-
3641
- Pattern: [gotcha title]
3642
- Location: experience-vault/[category]/[file].md
3643
-
3644
- Known Solution:
3645
- [Solution from Elder Brain]
3646
-
3647
- Applying fix...
3648
- ```
3521
+ - **FIRST: Invoke Elder Brain RETRIEVE for Known Solution**:
3522
+ 1. Extract technology/error context from error message
3523
+ 2. Invoke Elder Brain RETRIEVE with the technology and error keywords
3524
+ 3. If Elder Brain returns a matching solution:
3525
+ - Display: `🧙 Elder Brain: Known Issue Found — [pattern title]`
3649
3526
  - Apply the documented solution immediately
3650
3527
  - Skip root cause analysis (already known)
3651
3528
  - Resume task execution
3652
- - DONE - no further steps needed
3653
-
3654
- 4. If NO Elder Brain knowledge:
3529
+ 4. If Elder Brain has no knowledge:
3655
3530
  - Continue to root cause analysis below
3656
- - Plan to contribute solution to Elder Brain after fixing
3531
+ - Plan to contribute solution via Elder Brain RECEIVE after fixing
3657
3532
 
3658
3533
  - **Document the Issue** (if NOT in Elder Brain):
3659
3534
  - What broke (error message, unexpected behavior)
@@ -3665,19 +3540,9 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
3665
3540
  - Was it a task definition issue? (unclear instructions)
3666
3541
  - Was it a Mother Brain issue? (missing step, wrong assumption)
3667
3542
  - Was it an environment issue? (dependencies, configuration)
3668
- - **Was it a known domain gotcha?** (technology-specific pattern)
3669
3543
 
3670
3544
  - **Log & Learn**:
3671
- - Add entry to `docs/learning-log.md`:
3672
- ```markdown
3673
- ## [Date] - Task [Number] Error
3674
- **Task**: [Task name]
3675
- **What Broke**: [Error description]
3676
- **Root Cause**: [Why it happened]
3677
- **Fix Applied**: [How it was resolved]
3678
- **Prevention**: [What to update to prevent recurrence]
3679
- **Elder Brain Contribution**: [If domain gotcha, note for contribution]
3680
- ```
3545
+ - Add entry to `docs/learning-log.md`
3681
3546
 
3682
3547
  - **Self-Correction**:
3683
3548
  - Use `ask_user` with choices:
@@ -377,6 +377,7 @@ This skill is optimized for *minimal prompts, maximal clarity*, and iterative im
377
377
  - Use gathered context to inform approach
378
378
  - Research best practices for the specific use case
379
379
  - Determine appropriate tools and technologies
380
+ - **Consult Elder Brain**: Invoke Elder Brain RETRIEVE for each technology/domain this skill will work with. Embed known gotchas and patterns directly into the skill's steps and validation checks. This prevents skills from being "happy-path only."
380
381
 
381
382
  3. **Check Prerequisites** (if skill requires external tools)
382
383
  - Use `powershell` or `bash` to check if required tools are installed