Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Mobility Methodology

This document describes the scientific methodology and implementation of Pierre’s mobility intelligence system, covering stretching exercises and yoga poses for athlete recovery and flexibility.

Overview

Pierre’s mobility system provides:

  • stretching exercises: Static, dynamic, PNF, and ballistic stretching recommendations
  • yoga poses: Recovery-focused yoga sequences with breath guidance
  • activity-specific: Recommendations tailored to sport and muscle groups stressed
  • evidence-based: Recommendations based on sports science research

Target audience: Developers, coaches, athletes, and users seeking deep understanding of Pierre’s mobility intelligence.

Table of Contents


Tool-to-Algorithm Mapping

This section provides a comprehensive mapping between MCP tools and their underlying algorithms, implementation files, and test coverage.

Stretching Tools (3 tools)

Tool NameAlgorithm/IntelligenceImplementationTest File
list_stretching_exercisesDatabase filtering by category/difficulty/musclesrc/tools/implementations/mobility.rs:120-246tests/mobility_tools_integration_test.rs
get_stretching_exerciseDirect database retrieval with full detailssrc/tools/implementations/mobility.rs:252-322tests/mobility_tools_integration_test.rs
suggest_stretches_for_activityActivity-muscle mapping + warmup/cooldown categorizationsrc/tools/implementations/mobility.rs:328-467tests/mobility_e2e_test.rs

Yoga Tools (3 tools)

Tool NameAlgorithm/IntelligenceImplementationTest File
list_yoga_posesDatabase filtering by category/difficulty/pose type/recovery contextsrc/tools/implementations/mobility.rs:474-622tests/mobility_tools_integration_test.rs
get_yoga_poseDirect database retrieval with full pose detailssrc/tools/implementations/mobility.rs:628-706tests/mobility_tools_integration_test.rs
suggest_yoga_sequenceBalanced sequence generation with category diversitysrc/tools/implementations/mobility.rs:712-898tests/mobility_e2e_test.rs

Database Components

ComponentPurposeSource File
MobilityManagerCRUD operations for stretching/yoga datasrc/database/mobility.rs
StretchingExerciseStretching exercise model with muscles/instructionssrc/database/mobility.rs
YogaPoseYoga pose model with Sanskrit name/chakras/breath guidancesrc/database/mobility.rs
ActivityMuscleMappingMaps activities to primary/secondary muscles stressedsrc/database/mobility.rs

Algorithm Reference Summary

AlgorithmPurposeKey Parameters
Activity-Muscle MappingLinks sport types to muscle groupsPrimary muscles (high stress), secondary muscles (moderate stress)
Warmup/Cooldown SelectionFilters stretches by focusWarmup → dynamic stretches, Cooldown → static stretches
Sequence BalancingCreates varied yoga sequencesCategory order: Standing → Balance → Seated → Supine → Twist
Difficulty FilteringEnsures appropriate skill levelBeginner (1), Intermediate (2), Advanced (3)
Duration CalculationEstimates sequence time~45s hold + 15s transition per pose

1. Stretching Science

Stretching Categories

Pierre supports four evidence-based stretching types:

CategoryDescriptionWhen to UseDuration
StaticHold position at end rangePost-workout cooldown30-60 seconds
DynamicControlled movement through ROMPre-workout warmup10-15 reps
PNFContract-relax patternsFlexibility training10-30 seconds
BallisticBouncing movements (advanced)Sport-specific prep10-15 reps

Scientific Basis

  • Static stretching: Shown to reduce muscle stiffness and improve flexibility (Behm & Chaouachi, 2011)
  • Dynamic stretching: Improves performance when used before activity (Opplert & Babault, 2018)
  • PNF (Proprioceptive Neuromuscular Facilitation): Most effective for flexibility gains (Sharman et al., 2006)

Implementation

#![allow(unused)]
fn main() {
pub enum StretchingCategory {
    Static,      // Hold at end range
    Dynamic,     // Movement-based
    Pnf,         // Contract-relax
    Ballistic,   // Bouncing (advanced)
}
}

2. Yoga for Athletes

Pose Categories

CategoryDescriptionExamples
StandingBalance and leg strengthWarrior I/II, Tree Pose
SeatedHip and hamstring flexibilitySeated Forward Fold, Pigeon
SupineBack and hip openersHappy Baby, Reclined Twist
ProneBack extension and coreCobra, Locust
InversionBlood flow and recoveryLegs Up Wall, Supported Headstand
BalanceProprioception and focusEagle, Half Moon
TwistSpinal mobility and digestionSeated Twist, Revolved Triangle

Pose Types

TypePurposeRecovery Context
StretchFlexibility and ROMPost-cardio, rest day
StrengthMuscle engagementActive recovery
BalanceProprioceptionInjury prevention
RelaxationParasympathetic activationEvening, stress relief
BreathingNervous system regulationAny time

Recovery Contexts

Pierre recommends poses based on recovery needs:

  • post_cardio: Focus on hip openers, hamstring stretches, quad releases
  • rest_day: Full-body gentle flow with emphasis on relaxation
  • morning: Energizing poses with breath work
  • evening: Calming poses to prepare for sleep
  • stress_relief: Focus on breathing and relaxation poses

3. Activity-Muscle Mapping

Primary Muscle Groups by Activity

ActivityPrimary MusclesSecondary Muscles
RunningQuadriceps, hamstrings, calves, hip flexorsGlutes, core, ankles
CyclingQuadriceps, hip flexors, calvesHamstrings, glutes, lower back
SwimmingShoulders, lats, tricepsCore, hip flexors, ankles
HikingQuadriceps, calves, glutesHamstrings, hip flexors, core
Strength TrainingVaries by workoutCore, stabilizers

Implementation

#![allow(unused)]
fn main() {
pub struct ActivityMuscleMapping {
    pub activity_type: String,
    pub primary_muscles: Vec<String>,
    pub secondary_muscles: Vec<String>,
}
}

4. Sequence Generation

Yoga Sequence Algorithm

The suggest_yoga_sequence tool uses a balanced approach:

  1. Filter by recovery context: Get poses recommended for the purpose
  2. Filter by difficulty: Ensure poses match user’s skill level
  3. Apply focus area priority: Sort by target muscle group if specified
  4. Balance categories: Include variety (standing, seated, supine, twist)
  5. Calculate duration: Target number of poses based on requested time
  6. Add relaxation: Always end with Savasana or similar

Category Order

#![allow(unused)]
fn main() {
const YOGA_CATEGORY_ORDER: [YogaCategory; 5] = [
    YogaCategory::Standing,
    YogaCategory::Balance,
    YogaCategory::Seated,
    YogaCategory::Supine,
    YogaCategory::Twist,
];
}

Duration Estimation

  • Average hold time: 45 seconds per pose
  • Transition time: 15 seconds between poses
  • Formula: poses_count = duration_minutes.clamp(3, 12)

5. MCP Tool Integration

Tool Registration

All mobility tools are registered via create_mobility_tools():

#![allow(unused)]
fn main() {
pub fn create_mobility_tools() -> Vec<Box<dyn McpTool>> {
    vec![
        Box::new(ListStretchingExercisesTool),
        Box::new(GetStretchingExerciseTool),
        Box::new(SuggestStretchesForActivityTool),
        Box::new(ListYogaPosesTool),
        Box::new(GetYogaPoseTool),
        Box::new(SuggestYogaSequenceTool),
    ]
}
}

Tool Capabilities

All mobility tools require:

  • REQUIRES_AUTH: User must be authenticated
  • READS_DATA: Tools read from seeded database

6. Data Architecture

Database Schema

Mobility data is seeded at database initialization:

  • stretching_exercises: Pre-populated library of stretching exercises
  • yoga_poses: Pre-populated library of yoga poses with Sanskrit names
  • activity_muscle_mappings: Links activities to muscle groups

Data Sources

  • Stretching exercises: Based on ACSM guidelines and sports science literature
  • Yoga poses: Traditional poses adapted for athletic recovery
  • Activity mappings: Sport-specific biomechanical analysis

7. Scientific References

Stretching Research

  1. Behm, D.G., & Chaouachi, A. (2011). A review of the acute effects of static and dynamic stretching on performance. European Journal of Applied Physiology, 111(11), 2633-2651.

  2. Opplert, J., & Babault, N. (2018). Acute effects of dynamic stretching on muscle flexibility and performance: an analysis of the current literature. Sports Medicine, 48(2), 299-325.

  3. Sharman, M.J., Cresswell, A.G., & Riek, S. (2006). Proprioceptive neuromuscular facilitation stretching. Sports Medicine, 36(11), 929-939.

Yoga for Athletes

  1. Polsgrove, M.J., Eggleston, B.M., & Lockyer, R.J. (2016). Impact of 10-weeks of yoga practice on flexibility and balance of college athletes. International Journal of Yoga, 9(1), 27.

  2. Woodyard, C. (2011). Exploring the therapeutic effects of yoga and its ability to increase quality of life. International Journal of Yoga, 4(2), 49.

Recovery and Flexibility

  1. Page, P. (2012). Current concepts in muscle stretching for exercise and rehabilitation. International Journal of Sports Physical Therapy, 7(1), 109.