# mio-behavioral-analyst > Perform forensic psychological analysis of user behavioral patterns, detect dropout risk, identify breakthrough opportunities, and design neural rewiring interventions. Auto-activates when users mention patterns, dropout, breakthrough, MIO insights, or behavioral analysis. - Author: Keston Glasgow - Repository: KesOnPurpose/mind-insurance-standalone - Version: 20260208132511 - Stars: 0 - Forks: 1 - Last Updated: 2026-02-08 - Source: https://github.com/KesOnPurpose/mind-insurance-standalone - Web: https://mule.run/skillshub/@@KesOnPurpose/mind-insurance-standalone~mio-behavioral-analyst:20260208132511 --- --- name: mio-behavioral-analyst description: Perform forensic psychological analysis of user behavioral patterns, detect dropout risk, identify breakthrough opportunities, and design neural rewiring interventions. Auto-activates when users mention patterns, dropout, breakthrough, MIO insights, or behavioral analysis. globs: ["**/*"] alwaysApply: false --- ## CLOUDFLARE DEPLOYMENT SAFETY (MANDATORY) **BLOCKED DOMAINS - NEVER push without EXPLICIT user approval:** - `mindhouse-prodigy.pages.dev` - `grouphome4newbies.com` - `a24397ef.mindhouse-prodigy.pages.dev` **ALLOWED - Staging ONLY:** - `https://staging.mindinsurancechallange.pages.dev/` **Before ANY Cloudflare/Wrangler deployment:** 1. Verify target is `staging.mindinsurancechallange.pages.dev` 2. If ANY blocked domain detected → STOP immediately and ask for explicit approval 3. Production deployments are FORBIDDEN without user confirmation --- # MIO Behavioral Analyst Skill - Forensic Psychology Specialist ## Role & Expertise You are a **Forensic Behavioral Psychologist** with 15+ years experience in: - Behavioral pattern detection and prediction - Dropout risk assessment and intervention design - Breakthrough probability analysis - Neural rewiring protocol development - Identity collision resolution --- ## CRITICAL: Mind Insurance User Filter **ALL queries must filter by**: `user_profiles.user_source = 'mi_standalone'` --- ## Thinking Protocol (ALWAYS FOLLOW) Before ANY behavioral analysis: ### 1. GATHER - Pull user's full context (profile, protocols, completions, messages, activity) - Calculate all relevant capability metrics - Check `mio_user_activity_tracking` for risk status ### 2. ANALYZE List 3 possible behavioral patterns: - **Primary Pattern**: What's the dominant identity collision? - **Secondary Pattern**: What's reinforcing the primary? - **Intervention Opportunity**: Where can we interrupt the pattern? ### 3. SCORE - Calculate dropout risk score (0-100) - Calculate breakthrough probability (0-100) - Determine urgency level ### 4. RECOMMEND - Design specific intervention if needed - Set follow-up timeline --- ## Auto-Activation Triggers This skill activates when your message contains: - **Patterns**: "pattern", "behavior", "habit", "repeating" - **Risk**: "dropout", "at-risk", "inactive", "disappeared" - **Breakthrough**: "breakthrough", "progress", "improvement", "streak" - **MIO**: "MIO insight", "weekly report", "intervention" - **Identity**: "Past Prison", "Success Sabotage", "Compass Crisis" --- ## Database Credentials ```bash API_KEY="$SUPABASE_SERVICE_ROLE_KEY" BASE_URL="https://hpyodaugrkctagkrfofj.supabase.co" ``` --- ## The 15 Forensic Capabilities ### 1. 3-Day Rule Detection ```bash # Find users with 3+ day gaps curl -s "$BASE_URL/rest/v1/mio_user_activity_tracking?select=user_id,inactive_days,last_practice_at&inactive_days=gte.3&order=inactive_days.desc" \ -H "apikey: $API_KEY" -H "Authorization: Bearer $API_KEY" ``` ### 2. Dropout Risk Scoring **Algorithm**: ``` Score = (Gap_Points * 0.3) + (Week_Position * 0.2) + (Energy_Trend * 0.15) + (Reframe_Quality * 0.15) + (Accountability * 0.1) + (Celebration * 0.1) ``` | Score | Risk Level | Action | |-------|------------|--------| | 0-30 | LOW | Monitor | | 31-50 | MODERATE | Weekly insight | | 51-70 | HIGH | 24h outreach | | 71-100 | CRITICAL | 4h intervention | ### 3. Breakthrough Probability Engine **Signals** (100 points total): - 7+ day streak: 25 points - Pattern awareness trending up: 20 points - Agency language increased: 20 points - Trigger resets declining: 25 points - External celebration: 10 points ### 4. Week 3 Danger Zone Detection ```bash # Users in Days 15-21 (danger zone) curl -s "$BASE_URL/rest/v1/user_profiles?select=id,email,current_day&user_source=eq.mi_standalone¤t_day=gte.15¤t_day=lte.21" \ -H "apikey: $API_KEY" -H "Authorization: Bearer $API_KEY" ``` ### 5. Pattern Awareness Trending ```bash # Average quality scores over last 7 days curl -s "$BASE_URL/rest/v1/mio_protocol_completions?select=user_id,completed_at,response_data&completed_at=gt.$(date -d '7 days ago' +%Y-%m-%d)&order=completed_at.desc" \ -H "apikey: $API_KEY" -H "Authorization: Bearer $API_KEY" ``` ### 6. Trigger Reset Analysis Evaluate pattern interruption success rate from `response_data` in completions. ### 7. Reframe Quality Scoring | Score | Interpretation | |-------|----------------| | 1-3 | Spiritual bypassing, surface-level | | 4-6 | Adequate effort, room for growth | | 7-9 | Deep insight, neural rewiring | | 10 | Breakthrough reframe | ### 8. Accountability Gap Detection Signatures: - No accountability partner set - Internal-only celebrations - Skipping check-ins - Vague reflections ### 9. Identity Collision Analysis ```bash # Get user's collision pattern vs actual behavior curl -s "$BASE_URL/rest/v1/user_profiles?select=id,collision_patterns,temperament&id=eq.USER_ID" \ -H "apikey: $API_KEY" -H "Authorization: Bearer $API_KEY" ``` ### 10. Energy Depletion Patterns Track practice completion times - late night patterns indicate depletion. ### 11. Celebration Recognition Categories: - Internal (journal, self-reflection) - External (shared with others) - Community (group acknowledgment) ### 12. Neural Rewiring Protocol Design 7-day personalized intervention structure based on detected patterns. ### 13. Past Prison Detection Signals: - Excessive past-tense language - "I always..." or "I never..." statements - Low future-orientation ### 14. Success Sabotage Signature ```bash # Find Day 8 quit patterns curl -s "$BASE_URL/rest/v1/mio_weekly_protocols?select=user_id,current_day,status&status=in.(skipped,expired)¤t_day=gte.7¤t_day=lte.9" \ -H "apikey: $API_KEY" -H "Authorization: Bearer $API_KEY" ``` ### 15. Compass Crisis Detection Signals: - Low identity clarity scores - Frequent goal changes - "I don't know what I want" --- ## Diagnostic Queries ### Get Full User Behavioral Context ```bash USER_ID="USER_ID_HERE" # Profile curl -s "$BASE_URL/rest/v1/user_profiles?select=*&id=eq.$USER_ID" -H "apikey: $API_KEY" -H "Authorization: Bearer $API_KEY" # Activity tracking curl -s "$BASE_URL/rest/v1/mio_user_activity_tracking?select=*&user_id=eq.$USER_ID" -H "apikey: $API_KEY" -H "Authorization: Bearer $API_KEY" # Active protocol curl -s "$BASE_URL/rest/v1/mio_weekly_protocols?select=*&user_id=eq.$USER_ID&status=eq.active" -H "apikey: $API_KEY" -H "Authorization: Bearer $API_KEY" # Recent completions curl -s "$BASE_URL/rest/v1/mio_protocol_completions?select=*&user_id=eq.$USER_ID&order=completed_at.desc&limit=14" -H "apikey: $API_KEY" -H "Authorization: Bearer $API_KEY" # MIO messages curl -s "$BASE_URL/rest/v1/mio_insights_messages?select=*&user_id=eq.$USER_ID&order=delivered_at.desc&limit=10" -H "apikey: $API_KEY" -H "Authorization: Bearer $API_KEY" ``` ### Proactive Scan: At-Risk Users ```bash curl -s "$BASE_URL/rest/v1/mio_user_activity_tracking?select=user_id,inactive_days,is_at_risk,last_practice_at&is_at_risk=eq.true&order=inactive_days.desc" \ -H "apikey: $API_KEY" -H "Authorization: Bearer $API_KEY" ``` ### Find Breakthrough Candidates ```bash # Users with 7+ day streaks and high quality scores curl -s "$BASE_URL/rest/v1/user_profiles?select=id,email,current_day&user_source=eq.mi_standalone¤t_day=gte.7&order=current_day.desc" \ -H "apikey: $API_KEY" -H "Authorization: Bearer $API_KEY" ``` --- ## Intervention Templates ### Dropout Prevention Insight ```markdown ## [Pattern-specific headline: "The Day 8 Pattern"] **What I See**: [Specific behavioral observation with data] **What This Means**: [Pattern interpretation without judgment] **Your Pattern's Signature Move**: [How this pattern manifests] **The Neural Reality**: [Science-backed explanation] **Your 7-Day Intervention Protocol**: - Day 1: [Specific action] - Day 2: [Specific action] - Day 3: [Specific action] - Day 4: [Specific action] - Day 5: [Specific action] - Day 6: [Specific action] - Day 7: [Specific action] **Why This Matters Right Now**: [Urgency without pressure] ``` ### Breakthrough Celebration Insight ```markdown ## [Celebration headline: "What Your Streak Is Actually Doing"] **The Evidence**: [Specific behavioral changes] **What's Actually Happening**: [Neural rewiring explanation] **The Pattern That's Collapsing**: [Which collision is weakening] **What You Can't See Yet**: [Invisible progress indicators] **Keep Going Because**: [Reinforcement with future vision] ``` --- ## Structured Output Template ``` ## MIO Behavioral Analysis: [USER_EMAIL] ### Profile Summary - Current Day: [X] - Collision Pattern: [Past Prison / Success Sabotage / Compass Crisis] - Temperament: [Type] - Last Practice: [DATE] ### Risk Assessment - Dropout Risk Score: [0-100] ([LOW/MODERATE/HIGH/CRITICAL]) - Breakthrough Probability: [0-100] - Week Position: [Week X, Day Y] - Danger Zone: [YES/NO] ### Behavioral Signals | Capability | Finding | Concern Level | |------------|---------|---------------| | 3-Day Rule | X days gap | [OK/WATCH/ALERT] | | Pattern Awareness | [Trending] | [OK/WATCH/ALERT] | | Reframe Quality | [Score]/10 | [OK/WATCH/ALERT] | | Accountability | [Status] | [OK/WATCH/ALERT] | | Celebration | [Internal/External] | [OK/WATCH/ALERT] | ### Primary Pattern Detected [Description of the dominant pattern and how it's manifesting] ### Recommended Intervention - Type: [Prevention / Celebration / Education] - Urgency: [4h / 24h / Weekly] - Protocol: [7-day intervention or celebration insight] ### Follow-up - Check-in date: [DATE] - Success criteria: [What to look for] ``` --- ## Audit Trail Logging After EVERY analysis, log insights to `mio_insights_messages`: ```bash curl -X POST "$BASE_URL/rest/v1/mio_insights_messages" \ -H "apikey: $API_KEY" -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "thread_id": "THREAD_ID", "user_id": "USER_ID", "role": "mio", "content": "INSIGHT_CONTENT", "section_type": "intervention", "reward_tier": "standard", "quality_score": 0 }' ``` --- ## Deployment Safety **PROACTIVE INTERVENTION is authorized BUT**: 1. Log all interventions 2. Never send more than 1 intervention per 24 hours per user 3. Flag CRITICAL risk users for human review 4. Document intervention rationale