name: load-anomaly-guard description: Detects unsafe training load spikes (>20-30% week-over-week) and emits safety flags. Use in nightly background jobs or when reviewing weekly training volume with conservative adjustment recommendations. metadata: short-description: Background load monitor that flags spikes and proposes protective changes. agent: cursor
When Cursor should use this skill
- Nightly background check on training data
- Immediately after a high-intensity or long run is logged
- When analyzing weekly training load patterns for safety issues
- When implementing load monitoring features or debugging training load calculations
Invocation guidance
- Provide recent
TrainingHistory, plannedPlanwindow, and any injury flags. - Compute week-over-week changes and monotony; flag spikes > deterministic caps.
- Calculate Acute:Chronic Workload Ratio (ACWR) and training monotony.
- Suggest adjustments (rest/swaps) and emit
SafetyFlag[]. - Use deterministic thresholds from
v0/lib/plan-complexity-engine.ts.
Input schema
See references/input-schema.json.
Output schema
See references/output-schema.json.
Load metrics
Weekly Volume
- Calculation: Sum of all running duration/distance in past 7 days
- Safe increase: <20% week-over-week
- Caution: 20-30% increase
- Danger: >30% increase
Acute:Chronic Workload Ratio (ACWR)
- Acute load: Average daily load over past 7 days
- Chronic load: Average daily load over past 28 days (rolling 4-week average)
- ACWR: Acute / Chronic
- Safe zone: 0.8-1.3
- Caution zone: 1.3-1.5 or 0.5-0.8
- Danger zone: >1.5 or <0.5
Training Monotony
- Calculation: Mean daily load / Standard deviation of daily load
- Low: <1.5 (good variety)
- Moderate: 1.5-2.0 (acceptable)
- High: >2.0 (concerning - too repetitive)
Training Strain
- Calculation: Weekly load × Monotony
- Low: <1000
- Moderate: 1000-2000
- High: >2000 (injury risk)
Detection rules
Spike detection
- Calculate current week volume
- Calculate previous week volume
- If increase >20%, emit
load_spikewarning - If increase >30%, emit
load_spikedanger
Monotony detection
- Calculate daily load variance over 2 weeks
- If monotony >2.0, emit
high_monotonywarning - Suggest adding variety or rest days
ACWR violation
- Calculate 7-day and 28-day average loads
- If ACWR >1.5, emit
acwr_highdanger - If ACWR <0.5 (after training), emit
detrainingwarning
Consecutive hard days
- Count hard sessions (HR >80% max or RPE >7) in past 7 days
- If 3+ hard days without 48h recovery, emit
inadequate_recovery
Integration points
- Background job: Nightly cron (via
v0/lib/backgroundJobs.tsif added) - API:
v0/app/api/plan/load-guard(to add) returning flags + suggested adjustments - UI:
- Badge on Plan/Today screens showing load status
- Push/email via
v0/lib/email.ts - Warning modal before high-load workouts
- Database:
- Calculate from
runsandworkoutstables - Store load metrics in
training_loadtable (if added)
- Calculate from
Safety & guardrails
- If spike >20–30% week-over-week, emit
load_spikeand recommend rest or reduced volume. - If injury signals present, bias toward
rest-dayadjustments. - No medical diagnosis; advise professional consult on repeated spikes or pain.
- Always prefer conservative adjustments.
- Never suggest increasing load to "make up" for previous low weeks.
Adjustment recommendations
For load spike (20-30%)
- Reduce next week's volume by 15-20%
- Add extra rest day
- Convert 1 hard session to easy
- Maintain intensity but reduce duration
For load spike (>30%)
- Mandatory rest day insertion
- Reduce volume by 30-40% next week
- All runs at easy pace
- Consider cross-training substitution
For high monotony (>2.0)
- Add variety: mix distances, paces, surfaces
- Include cross-training day
- Vary workout types more
- Add optional rest day
For ACWR >1.5
- Immediate volume reduction
- Extra recovery day
- Monitor for injury signals
- Extend build phase timeline
For inadequate recovery
- Insert rest day before next hard session
- Convert upcoming hard session to easy
- Increase recovery time between efforts
- Monitor sleep and soreness
Telemetry
- Emit
ai_skill_invoked,ai_safety_flag_raised, and optionallyai_adjustment_appliedwhen suggestions are auto-applied with:load_spike_percentacwr_valuemonotony_valuesafety_flags(array)adjustment_recommendedauto_applied(boolean)
Common edge cases
- First week of training: No comparison data, establish baseline
- Return from break: Low ACWR is expected, don't flag as detraining
- Taper period: Low load is intentional, don't flag
- Race week: Allow slight spike for race day
- Illness/injury: Pause monitoring during recovery
- Data gaps: Don't flag if data is incomplete
Testing considerations
- Test spike detection with various volume increases
- Verify ACWR calculation accuracy
- Test monotony calculation with different training patterns
- Validate adjustment recommendation appropriateness
- Test with missing or incomplete data
- Verify no false positives during taper or planned down-weeks