mother-brain 0.0.34 → 0.1.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.0.34";
656
+ var VERSION = "0.1.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.0.34",
3
+ "version": "0.1.0",
4
4
  "description": "AI-powered project management framework for GitHub Copilot CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -27,6 +27,10 @@ allowed-tools: powershell view grep glob web_search ask_user create edit skill
27
27
  - EVERY user choice MUST use the `ask_user` tool
28
28
  - NEVER ask questions as plain text output
29
29
  - NEVER leave user in freeform - always return to menu
30
+ - **SELF-CHECK**: After generating ANY output, verify you are presenting `ask_user` with choices
31
+ - If your output ends without an `ask_user` call → STOP and add one
32
+ - Users must NEVER see an empty prompt with no guidance
33
+ - Exception: Only when explicitly executing a task selected by user
30
34
 
31
35
  ### RULE 3: VERSION CHECK FIRST
32
36
  - Before showing ANY menu, run: `npm view mother-brain version --json 2>$null`
@@ -65,6 +69,22 @@ allowed-tools: powershell view grep glob web_search ask_user create edit skill
65
69
  - If you're about to ask the user something without `ask_user` → STOP
66
70
  - If you've completed an action but have no menu to show → STOP and return to Step 2
67
71
 
72
+ ### RULE 8: WORKFLOW COMPLETION DISCIPLINE
73
+ - **NEVER STOP MID-WORKFLOW** - Complete all workflow steps without stopping
74
+ - **Invalid reasons to stop**:
75
+ - ❌ Token usage concerns
76
+ - ❌ Complexity of remaining work
77
+ - ❌ Number of skills to create
78
+ - ❌ Time estimates
79
+ - **Valid reasons to stop**:
80
+ - ✅ User explicitly interrupts
81
+ - ✅ User says "stop" or "pause"
82
+ - **Vision Discovery Workflow Checkpoint**:
83
+ - After Step 7 (Roadmap Created) → Must complete reflection/retrospective
84
+ - Create retrospective document analyzing what worked well vs friction points
85
+ - Invoke child-brain skill to process learnings
86
+ - THEN declare setup complete
87
+
68
88
  ---
69
89
 
70
90
  ## ⚠️ CRITICAL EXECUTION INSTRUCTIONS
@@ -219,6 +239,9 @@ Mother Brain transforms high-level visions into executable reality by:
219
239
  2. GitHub Release with release notes (use `gh release create` with description)
220
240
  3. Update README version badge (if applicable)
221
241
  Never publish to npm without also creating a proper GitHub Release with notes.
242
+ - **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.
243
+ - **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.
244
+ - **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.
222
245
 
223
246
  ### Output Formatting Rules (CRITICAL)
224
247
 
@@ -806,8 +829,14 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
806
829
  - "Yes, fix these issues"
807
830
  - "No, let me describe the problem"
808
831
  - "Back to menu"
809
- - **If "Yes, fix"**: Work on the fix, then offer to send improvement
810
- - **If "No, let me describe"**: Ask user to describe, then work on fix
832
+ - **If "Yes, fix"**: MUST invoke Child Brain to analyze friction and route learnings. Mother Brain NEVER applies fixes directly:
833
+ 1. Invoke `skill child-brain` with detected friction context
834
+ 2. Child Brain analyzes issues and splits learnings:
835
+ - Project-specific → Project Brain
836
+ - Meta-level process → Mother Brain (via edit)
837
+ 3. Child Brain applies fixes and displays visible learning feedback
838
+ 4. After Child Brain returns, offer to send improvement
839
+ - **If "No, let me describe"**: Ask user to describe, then invoke Child Brain with that context
811
840
 
812
841
  **Step 2A.0.2: Missing Feature (for "A feature is missing")**
813
842
 
@@ -874,6 +903,23 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
874
903
  - Display: "📭 No local Mother Brain improvements to send."
875
904
  - Return to Step 2A (Improve Mother Brain Menu)
876
905
 
906
+ **Step 2A.1.1A: Check Issues Tracker (Deduplication)**
907
+
908
+ - Check if `.mother-brain/issues-tracker.md` exists
909
+ - **If exists**:
910
+ - Read file and parse submitted issues list
911
+ - Extract issue numbers and titles already submitted
912
+ - Store in memory for comparison
913
+ - **If doesn't exist**:
914
+ - Create empty tracker file with template:
915
+ ```markdown
916
+ # Mother Brain Issues Tracker
917
+
918
+ ## Issues Submitted to GitHub (super-state/mother-brain)
919
+
920
+ (No issues submitted yet)
921
+ ```
922
+
877
923
  **Step 2A.1.2: Correlate Learnings with File Changes**
878
924
 
879
925
  - For each learning entry found:
@@ -886,9 +932,27 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
886
932
  - **Feedback handling** → Child Brain SKILL.md changes
887
933
  - **Skill creation** → Skill Creator SKILL.md changes
888
934
 
889
- **Step 2A.1.3: Generate Individual Issues**
935
+ **Step 2A.1.3: Generate Individual Issues (with Deduplication)**
936
+
937
+ - **Before generating issues**: Check each improvement against issues tracker
938
+ - Compare improvement title/description against already-submitted issues
939
+ - If match found: Skip this improvement
940
+ - If no match: Proceed to generate issue
941
+
942
+ - Display deduplication results:
943
+ ```
944
+ 🔍 Checking for duplicate submissions...
945
+
946
+ Found [X] improvements:
947
+ - [Y] new (will be submitted)
948
+ - [Z] already submitted (skipped)
949
+ ```
950
+
951
+ - **If all improvements already submitted**:
952
+ - Display: "✅ All improvements already submitted! No duplicates created."
953
+ - Return to Step 2A (Improve Mother Brain Menu)
890
954
 
891
- - For EACH distinct improvement, create a separate issue:
955
+ - For EACH NEW (not duplicate) improvement, create a separate issue:
892
956
 
893
957
  ```markdown
894
958
  Title: [Improvement] [Brief title describing THIS specific improvement]
@@ -923,24 +987,71 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
923
987
  *Submitted via Mother Brain v[version]*
924
988
  ```
925
989
 
926
- **Step 2A.1.4: Submit Issues (Batch)**
990
+ **Step 2A.1.4: Submit Issues via gh CLI**
927
991
 
928
- - For each generated improvement:
929
- 1. Create GitHub issue using MCP
930
- 2. Collect issue numbers and URLs
931
- 3. Add small delay between submissions (avoid rate limiting)
992
+ - **Pre-flight Check**: Verify gh CLI is available and authenticated
993
+ ```powershell
994
+ gh --version
995
+ gh auth status
996
+ ```
932
997
 
933
- - Target repository: `super-state/mother-brain`
934
- - Detected from: git remote (if configured)
935
- - Fallback: hardcoded default
998
+ - **If gh CLI available and authenticated**:
999
+ - For each generated improvement:
1000
+ 1. Create GitHub issue using gh CLI:
1001
+ ```powershell
1002
+ gh issue create --repo super-state/mother-brain --title "[title]" --body "[body]"
1003
+ ```
1004
+ 2. Parse output to get issue number and URL
1005
+ 3. Collect issue numbers and URLs
1006
+ 4. Add small delay between submissions (avoid rate limiting): `Start-Sleep -Seconds 2`
1007
+
1008
+ - Target repository: `super-state/mother-brain`
1009
+ - Detected from: git remote (if configured)
1010
+ - Fallback: hardcoded default
1011
+
1012
+ - **If gh CLI not installed or not authenticated**:
1013
+ - **Fallback to manual submission**:
1014
+ 1. Save each issue to `.mother-brain/github-issues/issue-[N].md`
1015
+ 2. Display instructions:
1016
+ ```
1017
+ ⚠️ gh CLI not available
1018
+
1019
+ To auto-submit improvements, install gh CLI:
1020
+ https://cli.github.com
1021
+
1022
+ Then authenticate: gh auth login
1023
+
1024
+ 📁 Issue content saved to:
1025
+ - .mother-brain/github-issues/issue-1.md
1026
+ - .mother-brain/github-issues/issue-2.md
1027
+
1028
+ You can submit these manually at:
1029
+ https://github.com/super-state/mother-brain/issues/new
1030
+ ```
1031
+ 3. Return to main menu with saved files
936
1032
 
937
- **Step 2A.1.5: Display Results**
1033
+ **Step 2A.1.5: Update Issues Tracker & Display Results**
1034
+
1035
+ - **Update `.mother-brain/issues-tracker.md`**:
1036
+ - Add new section for this session (if new issues were created):
1037
+ ```markdown
1038
+ ### Session: [Date] - [Context]
1039
+
1040
+ | Issue # | Title | Status | URL |
1041
+ |---------|-------|--------|-----|
1042
+ | #[N] | [Title] | ✅ Submitted | [URL] |
1043
+ ```
1044
+ - Commit changes to git:
1045
+ ```powershell
1046
+ git add .mother-brain/issues-tracker.md
1047
+ git commit -m "docs: track submitted issues from [session context]"
1048
+ ```
938
1049
 
939
1050
  - Display summary of ALL submitted issues:
940
1051
  ```
941
1052
  ✅ Improvements Submitted!
942
1053
 
943
- Created [N] issues:
1054
+ Created [N] new issues:
944
1055
 
945
1056
  📝 #[1]: [title1]
946
1057
  [issue URL]
@@ -951,7 +1062,10 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
951
1062
  📝 #[3]: [title3]
952
1063
  [issue URL]
953
1064
 
1065
+ [If any were skipped] Skipped [Z] duplicates already submitted
1066
+
954
1067
  Your contributions are now visible to maintainers.
1068
+ Tracker updated: .mother-brain/issues-tracker.md
955
1069
  ```
956
1070
 
957
1071
  - Use `ask_user` with choices:
@@ -1822,6 +1936,13 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
1822
1936
  - **Aesthetic/Experience**: How should it feel? Look? Sound?
1823
1937
  - **Constraints**: Budget, skills, platform limitations?
1824
1938
  - **MVP Scope**: What proves the concept works?
1939
+ - **Data Sensitivity (MANDATORY)**: If project involves user/customer data:
1940
+ - Identify what data is handled (PII, orders, payments, health data, financial data, personal info)
1941
+ - Ask: "Who should have access to this data?"
1942
+ - Flag access control/authentication as a hard requirement
1943
+ - Document in vision.md under "Security & Access Requirements"
1944
+ - This triggers authentication/authorization tasks in Phase 1 (not post-MVP)
1945
+ - Example: "Dashboard shows customer orders → authentication required before deployment"
1825
1946
 
1826
1947
  **Domain-Specific Questions (Generated From Research)**:
1827
1948
  - For games: gameplay loop, art style, audio needs, target platform
@@ -2066,6 +2187,22 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2066
2187
  5. "documentation standards for [project type]"
2067
2188
  6. "quality assurance approach for [project type]"
2068
2189
 
2190
+ **Step 5.4.1: Technology Pitfalls & Gotchas Research (MANDATORY)**
2191
+ - For EACH technology/platform/tool identified in vision or research:
2192
+ - Use `web_search` to research:
2193
+ 1. "common [technology] mistakes and pitfalls"
2194
+ 2. "[technology] gotchas first-time users encounter"
2195
+ 3. "[technology] troubleshooting guide"
2196
+ 4. "[technology] deployment issues and solutions" (if applicable)
2197
+ - Save findings to `.mother-brain/docs/research/[technology]-gotchas.md`
2198
+ - Document:
2199
+ - **Common Mistakes**: What do beginners get wrong?
2200
+ - **Setup Traps**: First-time setup issues (permissions, configuration, prerequisites)
2201
+ - **Known Failures**: Transient errors vs real failures
2202
+ - **Workarounds**: Standard solutions to known problems
2203
+ - This research gets embedded in skills created for this technology
2204
+ - Skills become defensive, anticipating known issues instead of only happy-path
2205
+
2069
2206
  **Step 5.5: Extract Technical Insights from Research**
2070
2207
  - Parse research results to identify:
2071
2208
  - **Roles/Disciplines**: (e.g., designer, architect, QA, DevOps, DBA)
@@ -2246,14 +2383,47 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2246
2383
  4. [skill-name] - [what it does] - [when useful]
2247
2384
  ```
2248
2385
 
2249
- - **Automatically create ALL identified skills** (no user prompt):
2250
- - Display: "🔨 Creating skills for project..."
2251
- - Mother Brain decides which skills are needed based on research - user does not approve skill list
2252
- - For each skill (essential AND optional that Mother Brain deems beneficial):
2386
+ - **Skill Creation Lifecycle Strategy**:
2387
+ - **Upfront Phase** (Step 6): Create minimum 3 foundational skills
2388
+ - Select 3 most critical skills from essential list
2389
+ - These provide core capabilities needed immediately
2390
+ - Document remaining identified skills in Project Brain
2391
+
2392
+ - **Continuous Creation** (Throughout project):
2393
+ - Skills should be created throughout project lifecycle, not all upfront
2394
+ - At start of each task (Step 9), check Project Brain for:
2395
+ - Existing skills that apply to this task
2396
+ - Skills identified but not yet created (create now if task needs them)
2397
+ - New patterns emerging in this task (create new skills mid-task)
2398
+ - Project Brain tracks:
2399
+ - `skillsCreated`: Skills that exist
2400
+ - `skillsPending`: Skills identified but not yet created
2401
+ - `skillsNeededForTasks`: Map of which tasks need which skills
2402
+
2403
+ - **Task-Start Skill Assessment** (Mandatory at Step 9):
2404
+ 1. Load Project Brain before starting task
2405
+ 2. Check which skills exist and apply to this task
2406
+ 3. Check if task requires pending skills (create them now)
2407
+ 4. Check if task reveals new skill needs (document in Project Brain)
2408
+ 5. Use relevant skills during task execution
2409
+
2410
+ - **Why This Approach**:
2411
+ - Minimum viable skill set upfront (3) doesn't delay project start
2412
+ - Skills created when actually needed = better context and design
2413
+ - Continuous skill creation = skills evolve with project understanding
2414
+ - Project Brain coordination = no duplicate skill creation
2415
+
2416
+
2417
+ - **Create Initial 3 Skills** (Upfront - minimum viable skill set):
2418
+ - Display: "🔨 Creating initial 3 skills for project..."
2419
+ - Select 3 most critical skills from essential list (based on immediate MVP needs)
2420
+ - For each of the 3 initial skills:
2253
2421
  - Show progress: "Creating [skill-name]..."
2254
- - Invoke skill-creator with context from research findings
2255
- - Explain role/pattern/need from Step 5 analysis
2256
- - Let skill-creator run its wizard
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
2257
2427
  - **Store created skills in `.github/skills/`** (CLI-discoverable location)
2258
2428
  - **Track in session-state.json**: Add skill name to `skillsCreated` array
2259
2429
  - **VALIDATE SKILL** (CRITICAL - prevents task execution failures):
@@ -2267,8 +2437,16 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2267
2437
  4. Only mark complete if skill invokes successfully
2268
2438
  - Show completion: "✅ [skill-name] created and validated"
2269
2439
 
2270
- - **After all skills created**:
2271
- - Display summary: "Skills ready: [list of validated skills]"
2440
+ - **Document remaining skills in Project Brain**:
2441
+ - Create/update `.mother-brain/project-brain.md` with:
2442
+ - `skillsCreated`: [list of 3 created skills]
2443
+ - `skillsPending`: [list of remaining identified skills]
2444
+ - `skillsNeededForTasks`: Map of which upcoming tasks will need which pending skills
2445
+ - Display: "📘 Documented [N] additional skills for later creation"
2446
+
2447
+ - **After initial 3 skills created**:
2448
+ - Display summary: "Initial skills ready: [list of 3 validated skills]"
2449
+ - Display: "Additional skills will be created as tasks require them"
2272
2450
  - Log in session-state.json: skillsCreated array with validated names
2273
2451
  - This ensures Step 9 can reliably invoke these skills
2274
2452
  - **Proceed immediately** - do not ask user to approve skills created
@@ -2292,6 +2470,16 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2292
2470
  - **What's the shortest path to user value?** (What must be in Phase 1 vs what can wait)
2293
2471
  - **How do projects like this collect feedback and learn?**
2294
2472
 
2473
+ **Step 6A.2.1: Outcome-Driven Research (MANDATORY)**
2474
+ - Extract user's stated outcome from vision document (e.g., "deployed app", "published package", "launched service", "released game")
2475
+ - Research what achieving THAT OUTCOME requires:
2476
+ - Use `web_search`: "[project type] [outcome type] prerequisites checklist"
2477
+ - Use `web_search`: "what's needed to [outcome] a [project type]"
2478
+ - Use `web_search`: "[project type] production readiness checklist"
2479
+ - Identify ALL steps between "code works locally" and "user achieves stated outcome"
2480
+ - Common discoveries: environment configuration, production databases, API keys, deployment verification, app store requirements, package publishing setup
2481
+ - These become tasks in the roadmap automatically - don't assume, research discovers them
2482
+
2295
2483
  **Step 6A.3: Synthesize MVP-First Strategy**
2296
2484
  - Display findings (for transparency, not approval):
2297
2485
  ```
@@ -2462,6 +2650,7 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2462
2650
  - Do NOT ask user to approve roadmap - Mother Brain determined optimal phasing
2463
2651
 
2464
2652
  **Step 7.5: Setup Complete - What's Next?**
2653
+ - **⚠️ CRITICAL**: This is NOT the end of setup. Step 7.6 (Reflection) is MANDATORY before declaring complete.
2465
2654
  - Display setup completion summary:
2466
2655
  ```
2467
2656
  ✅ Setup Complete!
@@ -2471,6 +2660,8 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2471
2660
  🛠️ Skills: [X] created and validated
2472
2661
  📊 Roadmap: [Y] tasks across [Z] phases
2473
2662
  📄 First Task: [Task 001 name] ready
2663
+
2664
+ 🔄 Next: Running mandatory reflection (Step 7.6)...
2474
2665
  ```
2475
2666
 
2476
2667
  - Use `ask_user` with choices:
@@ -2479,20 +2670,23 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2479
2670
  - "Review the vision document"
2480
2671
  - "I want to adjust something before starting"
2481
2672
 
2482
- - If "Start Task 001 now": **FIRST run Step 7.6 (mandatory)**, then proceed to Step 8 (Task Document Creation)
2483
- - If "Review roadmap": Display full roadmap, then return to this menu
2484
- - If "Review vision": Display vision summary, then return to this menu
2485
- - If "Adjust something": Use `ask_user` to ask what needs adjusting, make changes, return to this menu
2673
+ - **⛔ BLOCKING GATE**: Regardless of user selection, you MUST run Step 7.6 (Setup Validation & Self-Healing) BEFORE proceeding to the chosen action.
2674
+
2675
+ - If "Start Task 001 now": Run Step 7.6 (mandatory), then proceed to Step 8 (Task Document Creation)
2676
+ - If "Review roadmap": Run Step 7.6 (mandatory), display full roadmap, then return to this menu
2677
+ - If "Review vision": Run Step 7.6 (mandatory), display vision summary, then return to this menu
2678
+ - If "Adjust something": Run Step 7.6 (mandatory), use `ask_user` to ask what needs adjusting, make changes, return to this menu
2486
2679
 
2487
- - **MANDATORY**: After ANY selection from this menu, run Step 7.6 (Setup Validation & Self-Healing) BEFORE proceeding to the chosen action. This ensures setup issues are caught and fixed before task execution begins.
2680
+ - **DO NOT declare "setup complete" or proceed to ANY action without running Step 7.6 first**
2488
2681
 
2489
2682
  - Use outcome-focused language (what gets achieved, not just tasks)
2490
2683
  - Link Phase 1 tasks back to MVP criteria from vision
2491
2684
  - Mark post-MVP items clearly as "subject to validation"
2492
2685
  - Emphasize learning and iteration mindset
2493
2686
 
2494
- ### 7.6 **Setup Validation & Self-Healing** (Post-Setup Quality Check)
2495
- - **When to run**: Automatically after Step 7.5 menu is displayed, before proceeding to any next action
2687
+ ### 7.6 **Setup Validation & Self-Healing (MANDATORY REFLECTION - BLOCKS COMPLETION)**
2688
+ - **Purpose**: This is the REFLECTION step mentioned in RULE 8. It MUST complete before declaring "setup complete".
2689
+ - **When to run**: IMMEDIATELY after Step 7.5 displays menu and receives user response, BEFORE proceeding to any next action
2496
2690
  - **Purpose**: Detect and learn from any issues that occurred during the setup flow (Steps 3-7)
2497
2691
 
2498
2692
  **Step 7.6.1: Scan Conversation for Setup Issues**
@@ -2552,10 +2746,10 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2552
2746
  **Impact**: Prevents [issue type] in all future projects
2553
2747
  ```
2554
2748
 
2555
- **Step 7.6.5: Display Summary (If Issues Were Found)**
2556
- - Display:
2749
+ **Step 7.6.5: Display Summary**
2750
+ - If issues were found, display:
2557
2751
  ```
2558
- 🔧 Setup Validation Complete
2752
+ 🔧 Setup Validation & Reflection Complete
2559
2753
 
2560
2754
  Found [X] issue(s) during setup - all resolved:
2561
2755
 
@@ -2565,9 +2759,22 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2565
2759
  ✅ Mother Brain Improvements:
2566
2760
  - [Meta-lesson applied for future projects]
2567
2761
 
2568
- Ready to proceed!
2762
+ Reflection complete - setup is now truly complete!
2569
2763
  ```
2570
2764
 
2765
+ - If no issues found, display:
2766
+ ```
2767
+ ✅ Reflection Complete
2768
+
2769
+ No issues detected during setup.
2770
+ All steps executed successfully.
2771
+
2772
+ Setup is now complete!
2773
+ ```
2774
+
2775
+ - **ONLY AFTER this step completes can you proceed to user's selected action from Step 7.5 menu**
2776
+ - This checkpoint ensures learning happens every session, not just when errors occur
2777
+
2571
2778
  - Continue to user's selected action from Step 7.5 menu
2572
2779
 
2573
2780
  **Key Principle**: Every setup run improves Mother Brain for all future projects. Issues are not just fixed—they're learned from.
@@ -2636,7 +2843,14 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2636
2843
  - Read `.mother-brain/project-brain.md`
2637
2844
  - Review "Validation Checks" section
2638
2845
  - Check "Style & Tone" preferences for relevant categories
2639
- - Note any skills created for this project
2846
+ - **Check skill tracking sections**:
2847
+ - `skillsCreated`: Skills that exist and are available
2848
+ - `skillsPending`: Skills identified but not yet created
2849
+ - `skillsNeededForTasks`: Map of which tasks need which skills
2850
+ - **If this task needs a pending skill**:
2851
+ - Create that skill NOW before implementing task
2852
+ - Update skillsCreated and skillsPending arrays
2853
+ - Validate skill works before proceeding
2640
2854
 
2641
2855
  2. **Analyze Task Requirements**:
2642
2856
  - What creative/visual/narrative elements does this task involve?
@@ -2675,12 +2889,16 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2675
2889
  📘 Project Brain:
2676
2890
  - Style preferences: [found/not found]
2677
2891
  - Validation checks: [X] checks to run
2892
+ - Skills created: [X] available
2893
+ - Skills pending: [Y] identified for later
2894
+ - This task needs: [list pending skills this task requires, if any]
2678
2895
 
2679
2896
  🛠️ Skill Coverage:
2680
- - [element 1]: [skill-name] ✅ or [MISSING] ❌
2681
- - [element 2]: [skill-name] ✅ or [MISSING] ❌
2897
+ - [element 1]: [skill-name] ✅ or [PENDING - creating now] ⏳ or [MISSING] ❌
2898
+ - [element 2]: [skill-name] ✅ or [PENDING - creating now] ⏳ or [MISSING] ❌
2682
2899
 
2683
2900
  [If all covered]: Proceeding to implementation...
2901
+ [If pending skills needed]: Creating required skills first...
2684
2902
  [If gaps]: Need to address gaps before implementing...
2685
2903
  ```
2686
2904
 
@@ -2694,6 +2912,19 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2694
2912
  - Invoke skill-creator to create skills proactively
2695
2913
  - Do NOT ask user for approval (Expert Autonomy)
2696
2914
 
2915
+ - **DATA EXPOSURE CHECK (MANDATORY - BLOCKING GATE)**:
2916
+ - Before implementing ANY task, check:
2917
+ - Does this task involve displaying/exposing user or customer data?
2918
+ - Data types to watch for: PII, orders, payments, health records, personal info, financial data, private messages, user activity
2919
+ - If task exposes sensitive data:
2920
+ 1. Check if authentication/authorization exists in project
2921
+ 2. If NO auth exists → BLOCK implementation
2922
+ 3. Display: "⚠️ BLOCKED: This task exposes [data type] without access control. Authentication required first."
2923
+ 4. Check roadmap for auth task → If missing, add "Authentication & Authorization" task to Phase 1
2924
+ 5. Guide user: "Let's implement authentication before continuing with data-facing features"
2925
+ - This is a BLOCKING GATE - do NOT implement data-exposing features without access control
2926
+ - Only unblock when auth is implemented OR user explicitly confirms data is public/non-sensitive
2927
+
2697
2928
  - **MANDATORY Skill Check for Creative/Visual/Narrative Tasks**:
2698
2929
  - Before implementing ANY task that involves:
2699
2930
  - **Visual art**: Pixel art, sprites, character design, scene backgrounds, UI design
@@ -2746,6 +2977,25 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2746
2977
  - Track current project path in session state or as variable at task start
2747
2978
  - This prevents "file not found" and "module not found" errors from wrong directory context
2748
2979
 
2980
+ - **Windows Directory Creation Pattern** (CRITICAL):
2981
+ - When creating project directories and nested structures on Windows:
2982
+ 1. **Change to project directory FIRST**: `Set-Location "[project-path]"`
2983
+ 2. **Verify location**: Check command output shows correct path
2984
+ 3. **Use relative paths after location set**: `.github\skills\`
2985
+ 4. **Create parents with -Force flag**: `New-Item -ItemType Directory -Path "path" -Force`
2986
+
2987
+ - **Example**:
2988
+ ```powershell
2989
+ Set-Location "C:\Users\...\project-name"
2990
+ New-Item -ItemType Directory -Path ".mother-brain\docs\research" -Force
2991
+ ```
2992
+
2993
+ - **Why This Works**:
2994
+ - `-Force` creates parent directories automatically
2995
+ - Explicit `Set-Location` eliminates working directory ambiguity
2996
+ - Relative paths after location change are clear and predictable
2997
+ - Prevents "parent directory does not exist" errors
2998
+
2749
2999
  - **Execution**:
2750
3000
  - If skill exists: Invoke it using `skill` tool with task context
2751
3001
  - If no skill: Execute task following approach in task doc
@@ -2797,6 +3047,20 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2797
3047
  - After fixing, continue task execution from where it failed
2798
3048
 
2799
3049
  ### 10. **Task Validation** (Critical)
3050
+ - **DATA EXPOSURE VALIDATION (MANDATORY - BEFORE DEPLOYMENT)**:
3051
+ - If task involves deployment or making UI/API publicly accessible:
3052
+ 1. Check what data is exposed by this interface
3053
+ 2. If interface shows user/customer data (PII, orders, payments, health records, personal info):
3054
+ - Verify authentication/authorization is implemented
3055
+ - Test that unauthenticated users CANNOT access sensitive data
3056
+ - If NO auth → BLOCK deployment
3057
+ - Display: "⚠️ DEPLOYMENT BLOCKED: This interface exposes [data type] without access control."
3058
+ 3. Only allow deployment if:
3059
+ - Authentication exists AND is tested, OR
3060
+ - User explicitly confirms data is public/non-sensitive, OR
3061
+ - Data is anonymized/aggregated with no PII
3062
+ - This is a BLOCKING GATE for deployments - never deploy data-exposing interfaces without access control
3063
+
2800
3064
  - After completing deliverables:
2801
3065
  - ✅ **Build Test**: If code, build/compile it
2802
3066
  - ✅ **Functional Test**: Present output to user using environment-aware strategy