Running Training Plan
Sync with Strava, track weekly mileage against goals, and auto-schedule runs on your calendar
š§ Ingredients
š APIs
running_activity_data_distance_pace_elevation_heart_rate
š Alternatives:
schedule_planned_runs_and_rest_days
š Alternatives:
alerts_for_mileage_milestones_and_injury_risk_warnings
š Alternatives:
š Step-by-Step Build Guide
Authenticate with Strava OAuth2 and pull recent activities via GET /athlete/acti
1. Authenticate with Strava OAuth2 and pull recent activities via GET /athlete/activities
Authenticate with Strava OAuth2 and pull recent activities via GET /athlete/activities Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
š§ Human Required
- ⢠## Set up strava OAuth Authentication 1. Go to the strava developer portal and create an app 2. Set the redirect URI to your app's callback URL 3. Note your **Client ID** and **Client Secret** 4. Your agent will handle the OAuth flow ā you just need to authorize access when prompted 5. Click "Allow" when the authorization page appears ā±ļø Takes about 5 minutes. The refresh token is stored securely so you only do this once.
Define your training plan
2. Define your training plan: weekly mileage targets for the next 8-12 weeks (e.g., 20mi ā 25mi ā 30mi ramp)
Define your training plan: weekly mileage targets for the next 8-12 weeks (e.g., 20mi ā 25mi ā 30mi ramp) Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Each Sunday evening, calculate total miles run this week from Strava activities
3. Each Sunday evening, calculate total miles run this week from Strava activities
Process the data and calculate the requested metrics. Steps: 1. Validate input data ā check for nulls, out-of-range values, duplicates 2. Apply the calculation/aggregation logic 3. Compare against benchmarks or previous periods if available 4. Format results with appropriate precision (2 decimal places for percentages, whole numbers for counts) Include: current value, previous value, change (absolute and %), trend direction (āāā). Flag any anomalies: values >2 standard deviations from the mean. If insufficient data for a reliable calculation, state the minimum needed and return partial results.
Compare actual vs planned mileage
4. Compare actual vs planned mileage ā flag if >10% over (injury risk) or >20% under (falling behind)
Process the data and calculate the requested metrics. Steps: 1. Validate input data ā check for nulls, out-of-range values, duplicates 2. Apply the calculation/aggregation logic 3. Compare against benchmarks or previous periods if available 4. Format results with appropriate precision (2 decimal places for percentages, whole numbers for counts) Include: current value, previous value, change (absolute and %), trend direction (āāā). Flag any anomalies: values >2 standard deviations from the mean. If insufficient data for a reliable calculation, state the minimum needed and return partial results.
Auto
5. Auto-schedule next week's runs on Google Calendar based on remaining plan, spreading across available days
Auto-schedule next week's runs on Google Calendar based on remaining plan, spreading across available days Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Include estimated pace and distance for each scheduled run
6. Include estimated pace and distance for each scheduled run
Include estimated pace and distance for each scheduled run Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Monday morning
7. Monday morning: send a weekly summary ā miles completed, average pace, elevation gain, and next week's plan
Monday morning: send a weekly summary ā miles completed, average pace, elevation gain, and next week's plan Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Alert immediately if weekly mileage increase exceeds 10% over previous week (10%
8. Alert immediately if weekly mileage increase exceeds 10% over previous week (10% rule for injury prevention)
Monitor the data for anomalies and trigger alerts when thresholds are exceeded. Detection rules: 1. Compare current values against defined thresholds 2. Check for sudden changes (>X% deviation from rolling average) 3. Look for pattern breaks (missing expected data, unusual timing) 4. Cross-reference multiple signals for higher confidence For each detected anomaly: - Severity: š“ Critical (immediate action) / š” Warning (attention needed) / šµ Info (notable) - What: specific metric and current value - Why: what threshold or pattern was violated - Context: recent trend, baseline comparison - Suggested action: what to do about it Suppress duplicate alerts ā don't re-alert for the same issue within the configured cooldown period.
š¤ Example Agent Prompt
Authenticate with Strava OAuth2 and pull recent activities via GET /athlete/activities Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Copy this prompt into your agent to get started.