Complete rewrite of the neuroskill-bci skill based on actual source material from the NeuroSkill desktop app and NeuroLoop CLI repos. Supersedes PR #708. Key improvements over #708: - All CLI commands verified against actual NeuroSkill/NeuroLoop source - Added --json flag usage throughout (critical for reliable parsing) - Fixed metric formulas: Focus = σ(β/(α+θ)), Relaxation = σ(α/(β+θ)) - Scores are 0-1 scale (not 0-100 as in #708) - Added all 40+ metrics: FAA, TAR, BAR, TBR, APF, SNR, coherence, consciousness (LZC, wakefulness, integration), complexity (PE, HFD, DFA), cardiac (RMSSD, SDNN, pNN50, LF/HF, stress index, SpO2), motion (stillness, blinks, jaw clenches, nods, shakes) - Added all missing CLI subcommands: session, search-labels, interactive, listen, umap, calibrate, timer, notify, raw - Protocols sourced from actual NeuroLoop protocol repertoire (70+) organized by category (attention, stress, emotional, sleep, somatic, digital, dietary, motivation) - Added full WebSocket/HTTP API reference with all endpoints and JSON response formats - Fixed gamma range: 30-50 Hz (not 30-100) - Added signal quality per electrode with thresholds - Added composite state patterns (flow, fatigue, anxiety, creative, etc.) - Added ZUNA embedding documentation - Placed as optional built-in skill (not bundled by default) Files: - optional-skills/health/DESCRIPTION.md (new category) - optional-skills/health/neuroskill-bci/SKILL.md (main skill) - optional-skills/health/neuroskill-bci/references/metrics.md - optional-skills/health/neuroskill-bci/references/protocols.md - optional-skills/health/neuroskill-bci/references/api.md Refs: #694, #708
16 KiB
NeuroSkill Guided Protocols
Over 70 mind-body practices triggered by specific biometric (EXG) signals. These are sourced from NeuroLoop's protocol repertoire and are designed to be suggested when the system detects specific cognitive or physiological states.
⚠️ Contraindication: Wim Hof and hyperventilation-style breathwork are unsuitable for epilepsy_risk > 30, known cardiac conditions, or pregnancy.
When to Suggest Protocols
Always ask before starting. Match ONE protocol to the single most salient metric signal. Explain the metric connection to the user.
| User State | Recommended Protocol |
|---|---|
| Focus < 0.40, TBR > 1.5 | Theta-Beta Neurofeedback Anchor or Box Breathing |
| Low engagement, session start | WOOP or Pre-Task Priming |
| Relaxation < 0.30, stress_index high | Cardiac Coherence or 4-7-8 Breathing |
| Cognitive Load > 0.70 sustained | Cognitive Load Offload (Mind Dump) |
| Engagement < 0.30 for > 20 min | Novel Stimulation Burst or Environment Change |
| Flow State (focus > 0.75, engagement > 0.70) | Do NOT interrupt — protect the session |
| Drowsiness > 0.60, post-lunch | Ultradian Reset or Power Nap |
| FAA < 0, depression_index elevated | FAA Rebalancing |
| Low RMSSD (< 25ms) | Vagal Toning |
| High stillness + headache signals | Neck Release Sequence |
| Pre-sleep, HRV low | Sleep Wind-Down |
| Post-social-media, low mood | Envy & Comparison Alchemy |
Attention & Focus Protocols
Theta-Beta Neurofeedback Anchor
Duration: ~90 seconds Trigger: High TBR (> 1.5) and low focus Instructions:
- Close your eyes
- Breathe slowly — 4s inhale, 6s exhale
- Count rhythmically from 1 to 10, matching your breath
- Focus on the counting — if you lose count, restart from 1
- Open your eyes after 4–5 full cycles Effect: Suppresses theta dominance and lifts beta activity
Focus Reset
Duration: 90 seconds Trigger: Scattered engagement, difficulty settling into task Instructions:
- Close your eyes completely
- Take 5 slow, deep breaths
- Mentally state your intention for the next work block
- Open your eyes and begin immediately Effect: Resets attentional baseline
Working Memory Primer
Duration: 3 minutes Trigger: Low PAC θ-γ (theta-gamma coupling), low sample entropy Instructions:
- Breathe at theta pace: 4s inhale, 6s exhale, 2s hold
- While breathing, do a verbal 3-back task: listen to or read a sequence of numbers, say which number appeared 3 positions back
- Continue for 3 minutes Effect: Lifts theta-gamma coupling and working memory engagement
Creativity Unlock
Duration: 5 minutes Trigger: High beta, low rel_alpha — system is too analytically locked Instructions:
- Stop all structured work
- Let your mind wander without a goal
- Doodle, look out the window, or listen to ambient sound
- Don't force any outcome — just observe what arises
- After 5 minutes, jot down any ideas that surfaced Effect: Promotes alpha and theta activity for creative ideation
Dual-N-Back Warm-Up
Duration: 3 minutes Trigger: Low PAC θ-γ, low sample entropy Instructions:
- Read or listen to a sequence of spoken numbers
- Track which number appeared 2 positions back (2-back)
- If comfortable, increase to 3-back Effect: Activates prefrontal cortex, lifts executive function
Novel Stimulation Burst
Duration: 2–3 minutes Trigger: Low APF (< 9 Hz), dementia_index > 30 Instructions:
- Pick up an unusual object nearby and describe it in detail
- Name 5 things you can see, 4 you can touch, 3 you can hear
- Try a quick riddle or lateral thinking puzzle Effect: Counters cortical slowing, raises alpha peak frequency
Autonomic & Stress Regulation Protocols
Box Breathing (4-4-4-4)
Duration: 2–4 minutes Trigger: High BAR, high anxiety_index, acute stress Instructions:
- Inhale for 4 counts
- Hold for 4 counts
- Exhale for 4 counts
- Hold for 4 counts
- Repeat 4–8 cycles Effect: Engages parasympathetic nervous system, reduces beta activity
Extended Exhale (4-7-8)
Duration: 3–5 minutes Trigger: Acute stress spikes, racing thoughts, high sympathetic activation Instructions:
- Exhale completely through mouth
- Inhale through nose for 4 counts
- Hold for 7 counts
- Exhale through mouth for 8 counts
- Repeat 4 cycles Effect: Fastest parasympathetic trigger for acute stress
Cardiac Coherence
Duration: 5 minutes Trigger: Low RMSSD (< 30 ms), high stress_index Instructions:
- Breathe evenly: 5-second inhale, 5-second exhale
- Focus on the area around your heart
- Recall a positive memory or feeling of appreciation
- Maintain for 5 minutes Effect: Maximizes HRV, creates coherent heart rhythm pattern
Physiological Sigh
Duration: 30 seconds (1–3 cycles) Trigger: Rapid overwhelm, acute panic Instructions:
- Take a quick double inhale through the nose (sniff-sniff)
- Follow with a long, slow exhale through the mouth
- Repeat 1–3 times Effect: Rapid parasympathetic activation, immediate calming
Alpha Induction (Open Focus)
Duration: 5 minutes Trigger: High beta, low relaxation — cannot relax Instructions:
- Soften your gaze — don't focus on any single object
- Notice the space between and around objects
- Expand your awareness to peripheral vision
- Maintain this "open focus" for 5 minutes Effect: Promotes alpha wave production, reduces beta dominance
Open Monitoring
Duration: 5–10 minutes Trigger: Low LZC (< 40 on 0-100 scale) — neural complexity too low Instructions:
- Sit comfortably with eyes closed or softly focused
- Don't direct attention to anything specific
- Simply notice whatever arises — thoughts, sounds, sensations
- Let each observation pass without engagement Effect: Raises neural complexity and consciousness metrics
Vagal Toning
Duration: 3 minutes Trigger: Low RMSSD (< 25 ms) — weak vagal tone Instructions:
- Hum a long, steady note on each exhale for 30 seconds
- Alternatively: gargle cold water for 30 seconds
- Repeat 3–5 times Effect: Directly stimulates the vagus nerve, increases parasympathetic tone
Emotional Regulation Protocols
FAA Rebalancing
Duration: 5 minutes Trigger: Negative FAA (right-hemisphere dominant), high depression_index Instructions:
- Think of something you're genuinely looking forward to (approach motivation)
- Visualize yourself successfully completing a meaningful goal
- Squeeze your left hand into a fist for 10 seconds, release
- Repeat the visualization + left-hand squeeze 3–4 times Effect: Activates left prefrontal cortex, shifts FAA positive
Loving-Kindness (Metta)
Duration: 5–10 minutes Trigger: Loneliness signals, shame, low mood Instructions:
- Close your eyes and think of someone you care about
- Silently repeat: "May you be happy. May you be healthy. May you be safe."
- Extend the same wishes to yourself
- Extend to a neutral person, then gradually to someone difficult Effect: Reduces withdrawal motivation, increases positive affect
Emotional Discharge
Duration: 2 minutes Trigger: High bipolar_index or extreme FAA swings Instructions:
- Take 30 seconds of vigorous, fast breathing (safely)
- Stop and take 3 slow, deep breaths
- Do a 60-second body scan — notice where tension is held
- Shake out your hands and arms for 15 seconds Effect: Releases trapped sympathetic energy, recalibrates
Havening Touch
Duration: 3–5 minutes Trigger: Acute distress, trauma activation, overwhelming anxiety Instructions:
- Gently stroke your arms from shoulder to elbow, palms down
- Rub your palms together slowly
- Gently touch your forehead, temples
- Continue for 3–5 minutes while breathing slowly Effect: Disrupts amygdala-cortex encoding loop, reduces distress
Anxiety Surfing
Duration: ~8 minutes Trigger: Rising anxiety without clear cause Instructions:
- Notice where anxiety lives in your body — chest? stomach? throat?
- Describe the sensation without judging it (tight? hot? buzzing?)
- Breathe into that area for 3 breaths
- Notice: is it getting bigger, smaller, or changing shape?
- Continue observing for 5–8 minutes — anxiety typically peaks then subsides
Anger: Palm-Press Discharge
Duration: 2 minutes Trigger: Anger signals, high BAR + elevated HR Instructions:
- Press your palms together firmly for 10 seconds
- Release and take 3 extended exhales (4s in, 8s out)
- Repeat 3–4 times
Envy & Comparison Alchemy
Duration: 3 minutes Trigger: Post-social-media, envy signals Instructions:
- Name the envy: "I feel envious of ___"
- Ask: "What does this envy tell me I actually want?"
- Convert: "My next step toward that is ___" Effect: Converts envy into a desire-signal that identifies personal values
Awe Induction
Duration: 3–5 minutes Trigger: Existential flatness, low engagement, loss of meaning Instructions:
- Imagine standing at the edge of the Grand Canyon, or beneath a starry sky
- Let yourself feel the scale — you are small, and that's beautiful
- Recall a moment of genuine wonder from your past
- Notice what changes in your body Effect: Counters hedonic adaptation, restores sense of meaning
Sleep & Recovery Protocols
Ultradian Reset
Duration: 20 minutes Trigger: End of a 90-minute focus block, drowsiness rising Instructions:
- Set a timer for 20 minutes
- No agenda — just rest (don't force sleep)
- Dim lights if possible, close eyes
- Let mind wander without structure Effect: Aligns with 90-minute ultradian rhythm, restores cognitive resources
Wake Reset
Duration: 5 minutes Trigger: narcolepsy_index > 40, severe drowsiness Instructions:
- Splash cold water on your face and wrists
- Do 20 seconds of Kapalabhati breath (sharp nasal exhales)
- Expose yourself to bright light for 2–3 minutes Effect: Acute arousal response, suppresses drowsiness
NSDR (Non-Sleep Deep Rest / Yoga Nidra)
Duration: 20–30 minutes Trigger: Accumulated fatigue, need deep recovery without sleeping Instructions:
- Lie on your back, palms up
- Close your eyes and do a slow body scan from toes to crown
- At each body part, notice sensation without changing anything
- If you fall asleep, that's fine — set an alarm Effect: Restores dopamine and cognitive resources without sleep inertia
Power Nap
Duration: 10–20 minutes (set alarm!) Trigger: Drowsiness > 0.70, post-lunch slump, Theta dominant Instructions:
- Set alarm for 20 minutes maximum (avoids N3 sleep inertia)
- Lie down or recline
- Even if you don't fully sleep, rest with eyes closed
- On waking: 30 seconds of stretching before resuming work Effect: Restores focus and alertness for 2–3 hours
Sleep Wind-Down
Duration: 60 minutes before bed Trigger: Evening session, rising drowsiness, pre-sleep Instructions:
- Dim all screens to night mode
- Stop new learning or complex tasks
- Do a mind dump of tomorrow's tasks
- 10 minutes of progressive relaxation or 4-7-8 breathing
- Keep room cool (65–68°F / 18–20°C)
Somatic & Physical Protocols
Progressive Muscle Relaxation (PMR)
Duration: 10 minutes Trigger: Relaxation < 0.25, HRV declining over session Instructions:
- Start with feet — tense for 5 seconds, release for 8–10 seconds
- Move upward: calves → thighs → abdomen → hands → arms → shoulders → face
- Hold each tension 5 seconds, release 8–10 seconds
- End with 3 deep breaths
Grounding (5-4-3-2-1)
Duration: 3 minutes Trigger: Panic, dissociation, acute anxiety spike Instructions:
- Name 5 things you can see
- Name 4 things you can touch
- Name 3 things you can hear
- Name 2 things you can smell
- Name 1 thing you can taste
20-20-20 Vision Reset
Duration: 20 seconds Trigger: Extended screen time, eye strain Instructions:
- Every 20 minutes of screen time
- Look at something 20 feet away
- For 20 seconds
Neck Release Sequence
Duration: 3 minutes Trigger: High stillness (> 0.85) + headache_index elevated Instructions:
- Ear-to-shoulder tilt — hold 15 seconds each side
- Chin tucks — 10 reps (pull chin straight back)
- Gentle neck circles — 5 each direction
- Shoulder shrugs — 10 reps (squeeze up, release)
Motor Cortex Activation
Duration: 2 minutes Trigger: Very high stillness, prolonged static sitting Instructions:
- Cross-body movements: touch right hand to left knee, alternate 10 times
- Shake out hands and feet for 15 seconds
- Roll ankles and wrists 5 times each direction Effect: Resets proprioception, activates motor cortex
Cognitive Load Offload (Mind Dump)
Duration: 5 minutes Trigger: Cognitive load > 0.70 sustained, racing thoughts, high beta Instructions:
- Open a blank document or grab paper
- Write everything on your mind without filtering or organizing
- Brain-dump worries, tasks, ideas — anything occupying working memory
- Close the document (review later if needed) Effect: Externalizing working memory can reduce cognitive load by 20–40%
Digital & Lifestyle Protocols
Craving Surf
Duration: 90 seconds Trigger: Phone addiction signals, urge to check social media Instructions:
- Notice the urge to check your phone
- Don't act on it — just observe for 90 seconds
- Notice: does the urge peak and then fade?
- Resume what you were doing Effect: Breaks automatic dopamine-seeking loop
Dopamine Palette Reset
Duration: Ongoing Trigger: Flatness from short-form content spikes Instructions:
- Identify activities that provide sustained reward (reading, cooking, walking)
- Replace 15 minutes of scrolling with one sustained-reward activity
- Track mood before/after for 3 days
Digital Sunset
Duration: 60–90 minutes before bed Trigger: Evening, pre-sleep routine Instructions:
- Hard stop on all screens 60–90 minutes before bed
- Switch to non-screen activities: reading, conversation, stretching
- If screens are necessary, use night mode at minimum brightness
Dietary Protocols
Caffeine Timing
Trigger: Morning routine, anxiety_index Guidelines:
- Consume caffeine 90–120 minutes after waking (cortisol has already peaked)
- None after 2 PM (half-life ~6 hours)
- If anxiety_index > 50, stack with L-theanine (200mg) to smooth the curve
Post-Meal Energy Crash
Trigger: Post-lunch drowsiness spike Instructions:
- 5-minute brisk walk immediately after eating
- 10 minutes of sunlight exposure Effect: Counters post-prandial drowsiness
Motivation & Planning Protocols
WOOP (Wish, Outcome, Obstacle, Plan)
Duration: 5 minutes Trigger: Low engagement before a task Instructions:
- Wish: What do you want to accomplish in this session?
- Outcome: What's the best possible result? Visualize it.
- Obstacle: What internal obstacle might get in the way?
- Plan: "If [obstacle], then I will [action]." Effect: Mental contrasting improves follow-through by 2–3x
Pre-Task Priming
Duration: 3 minutes Trigger: Low engagement at session start, drowsiness < 0.50 Instructions:
- Set a clear intention for the next work block
- Write down the single most important task
- Do 10 jumping jacks or 20 deep breaths
- Start with the easiest sub-task to build momentum
Protocol Execution Guidelines
When guiding the user through a protocol:
- Match one protocol to the single most salient metric signal
- Explain the metric connection — why this protocol for this state
- Ask permission — never start without the user's consent
- Announce each step clearly with timing
- Check in after — run
npx neuroskill status --jsonto see if metrics improved - Label the moment —
npx neuroskill label "post-protocol: [name]"for tracking
Timing Guidelines for Step-by-Step Guidance
- Breath inhale: 3–5 seconds
- Breath hold: 2–4 seconds
- Breath exhale: 4–8 seconds
- Muscle tense: 5 seconds
- Muscle release: 8–10 seconds
- Body-scan region: 10–15 seconds