Purpose
Defines the shared conventions, contracts, safety posture, and telemetry used by all Run-Smart AI skills. This index allows Cursor Agent to discover available skills and the rules they follow.
When Cursor should use this skill
- Before invoking any Run-Smart skill to understand shared schemas, safety guidance, and telemetry
- When onboarding a new skill to ensure compliance with common contracts
- When working with running coach features and need to understand data schemas or safety patterns
- When user asks about available AI capabilities or skill documentation
Invocation guidance
- Load shared references in
running-coach-index/references/ (contracts, telemetry, conventions, smoke-tests)
- Select the appropriate skill directory based on the user's need (plan generation, adjustment, insights, etc.)
- Validate request/response payloads against the schemas in
contracts.md and skill-specific schemas
- Always follow safety guardrails and emit SafetyFlags when thresholds are crossed
- Log telemetry events via
v0/lib/analytics.ts for monitoring and improvement
Shared components
- Contracts:
running-coach-index/references/contracts.md - TypeScript interfaces for all data structures
- Telemetry:
running-coach-index/references/telemetry.md - Standard event logging patterns
- Conventions:
running-coach-index/references/conventions.md - Naming, formatting, and design patterns
- Smoke tests:
running-coach-index/references/smoke-tests.md - Quick validation scenarios
Available Skills Catalog
Planning & Generation
- plan-generator - Generates 14-21 day personalized training plans with safe load progression
- plan-adjuster - Recomputes upcoming workouts based on recent runs and feedback
- conversational-goal-discovery - Chat-based goal classification with constraint clarification
Pre-Run Assessment
- readiness-check - Pre-run safety gate evaluating readiness (proceed/modify/skip decisions)
- workout-explainer - Translates planned workouts into execution cues and purpose explanations
Post-Run Analysis
- post-run-debrief - Converts run telemetry into structured reflections with confidence scores
- run-insights-recovery - Analyzes completed runs for effort assessment and recovery recommendations
Safety & Monitoring
- load-anomaly-guard - Detects unsafe training load spikes (>20-30% week-over-week)
- adherence-coach - Identifies missed sessions and proposes plan reshuffles with motivational support
Advanced Features
- race-strategy-builder - Generates race-day pacing and fueling strategies
- route-builder - Generates route specifications with distance and elevation constraints
Safety & guardrails
Universal Safety Rules
- No Medical Diagnosis: Never provide medical advice, diagnosis, or treatment recommendations
- Conservative Under Uncertainty: When data is missing or uncertain, prefer safer, more conservative options
- Pain/Injury Signals: If user reports pain, dizziness, chest discomfort, or severe symptoms:
- Recommend stopping activity immediately
- Advise consulting a qualified healthcare professional
- Emit
SafetyFlag with severity high
- Load Management: Enforce hard caps on training load increases:
- Weekly volume: max +20-30% increase
- Long run: max +10-15% increase
- Use
plan-complexity-engine.ts for deterministic caps
- SafetyFlag Emission: Emit structured
SafetyFlag objects when:
- Load thresholds exceeded
- Critical data missing
- Injury signals detected
- Heat/weather risks present
- Model confidence low (<50%)
Data Handling
- Redact PII before logging telemetry
- Validate all inputs against schemas
- Handle missing data gracefully with appropriate defaults
- Never assume user state - always verify from database
Model Behavior
- Prefer deterministic rules over probabilistic when safety is involved
- Fall back to template-based plans if AI generation fails
- Log all fallbacks and failures for monitoring
- Maintain consistent tone: supportive, evidence-based, non-alarmist
Integration points
API Routes
- Chat:
v0/app/api/chat/route.ts - Conversational AI interactions
- Plan Generation:
v0/app/api/generate-plan/route.ts - Training plan creation
- Adjustments: Background jobs (plan adjustment logic)
- Insights: Post-run screens (run analysis and recovery)
Core Libraries
- Enhanced AI Coach:
v0/lib/enhanced-ai-coach.ts - Skill orchestration and routing
- Plan Generator:
v0/lib/planGenerator.ts - Plan creation logic
- Plan Templates:
v0/lib/plan-templates.ts - Fallback templates
- Recovery Engine:
v0/lib/recoveryEngine.ts - Recovery score calculations
- Periodization:
v0/lib/periodization.ts - Training load management
- Plan Complexity:
v0/lib/plan-complexity-engine.ts - Safety caps and thresholds
Data Layer
- Database:
v0/lib/db.ts - Dexie IndexedDB schema
- DB Utils:
v0/lib/dbUtils.ts - Common database operations
- Analytics:
v0/lib/analytics.ts - PostHog event tracking
- Monitoring:
v0/lib/backendMonitoring.ts - Performance and error tracking
UI Components
- Today Screen: Main dashboard with readiness check
- Plan Screen: Training calendar and workout details
- Record Screen: GPS tracking and run recording
- Chat Screen: Conversational AI interface
- Profile Screen: User settings and history
Telemetry events (standard)
All skills should emit these standard events via v0/lib/analytics.ts:
ai_skill_invoked - Every skill invocation with context
ai_plan_generated - Training plan creation
ai_adjustment_applied - Plan modifications
ai_insight_created - Run analysis
ai_safety_flag_raised - Safety warnings
ai_user_feedback - User ratings and comments
See references/telemetry.md for detailed event schemas.
Development workflow
Adding a New Skill
- Create skill directory:
.cursor/skills/skill-name/
- Write
SKILL.md with metadata, description, and guidance
- Create
references/ subdirectory
- Add JSON schemas:
input-schema.json, output-schema.json
- Document examples in
examples.md
- Document edge cases in
edge-cases.md
- Update this index to include the new skill
- Add integration code in relevant API routes/libraries
- Add tests for the skill
- Update CURSOR.md with skill description
Testing Skills
- Use smoke tests from
references/smoke-tests.md
- Verify safety guardrails with edge case inputs
- Test fallback behavior when data is missing
- Validate telemetry event emission
- Check SafetyFlag generation for risky scenarios
Monitoring Skills
- Check
v0/lib/backendMonitoring.ts for error rates
- Review PostHog analytics for usage patterns
- Monitor SafetyFlag frequency and severity
- Track user feedback ratings
- Analyze model latency and performance
Version History
- v1.0 (2026-01-23): Initial Cursor Agent skills system with 12 core skills
1---2name: running-coach-index-23description: Reference catalog for all running coach AI skills, shared TypeScript contracts, safety guardrails, and telemetry conventions. Use when working with any running coach feature to understand data schemas, safety patterns, or integration points.4---5
6## Purpose
7Defines the shared conventions, contracts, safety posture, and telemetry used by all Run-Smart AI skills. This index allows Cursor Agent to discover available skills and the rules they follow.
8
9## When Cursor should use this skill
10- Before invoking any Run-Smart skill to understand shared schemas, safety guidance, and telemetry
11- When onboarding a new skill to ensure compliance with common contracts
12- When working with running coach features and need to understand data schemas or safety patterns
13- When user asks about available AI capabilities or skill documentation
14
15## Invocation guidance
161. Load shared references in `running-coach-index/references/` (contracts, telemetry, conventions, smoke-tests)
172. Select the appropriate skill directory based on the user's need (plan generation, adjustment, insights, etc.)
183. Validate request/response payloads against the schemas in `contracts.md` and skill-specific schemas
194. Always follow safety guardrails and emit SafetyFlags when thresholds are crossed
205. Log telemetry events via `v0/lib/analytics.ts` for monitoring and improvement
21
22## Shared components
23- **Contracts:** `running-coach-index/references/contracts.md` - TypeScript interfaces for all data structures
24- **Telemetry:** `running-coach-index/references/telemetry.md` - Standard event logging patterns
25- **Conventions:** `running-coach-index/references/conventions.md` - Naming, formatting, and design patterns
26- **Smoke tests:** `running-coach-index/references/smoke-tests.md` - Quick validation scenarios
27
28## Available Skills Catalog
29
30### Planning & Generation
31- **plan-generator** - Generates 14-21 day personalized training plans with safe load progression
32- **plan-adjuster** - Recomputes upcoming workouts based on recent runs and feedback
33- **conversational-goal-discovery** - Chat-based goal classification with constraint clarification
34
35### Pre-Run Assessment
36- **readiness-check** - Pre-run safety gate evaluating readiness (proceed/modify/skip decisions)
37- **workout-explainer** - Translates planned workouts into execution cues and purpose explanations
38
39### Post-Run Analysis
40- **post-run-debrief** - Converts run telemetry into structured reflections with confidence scores
41- **run-insights-recovery** - Analyzes completed runs for effort assessment and recovery recommendations
42
43### Safety & Monitoring
44- **load-anomaly-guard** - Detects unsafe training load spikes (>20-30% week-over-week)
45- **adherence-coach** - Identifies missed sessions and proposes plan reshuffles with motivational support
46
47### Advanced Features
48- **race-strategy-builder** - Generates race-day pacing and fueling strategies
49- **route-builder** - Generates route specifications with distance and elevation constraints
50
51## Safety & guardrails
52
53### Universal Safety Rules
541. **No Medical Diagnosis**: Never provide medical advice, diagnosis, or treatment recommendations
552. **Conservative Under Uncertainty**: When data is missing or uncertain, prefer safer, more conservative options
563. **Pain/Injury Signals**: If user reports pain, dizziness, chest discomfort, or severe symptoms:
57 - Recommend stopping activity immediately
58 - Advise consulting a qualified healthcare professional
59 - Emit `SafetyFlag` with severity `high`
604. **Load Management**: Enforce hard caps on training load increases:
61 - Weekly volume: max +20-30% increase
62 - Long run: max +10-15% increase
63 - Use `plan-complexity-engine.ts` for deterministic caps
645. **SafetyFlag Emission**: Emit structured `SafetyFlag` objects when:
65 - Load thresholds exceeded
66 - Critical data missing
67 - Injury signals detected
68 - Heat/weather risks present
69 - Model confidence low (<50%)
70
71### Data Handling
72- Redact PII before logging telemetry
73- Validate all inputs against schemas
74- Handle missing data gracefully with appropriate defaults
75- Never assume user state - always verify from database
76
77### Model Behavior
78- Prefer deterministic rules over probabilistic when safety is involved
79- Fall back to template-based plans if AI generation fails
80- Log all fallbacks and failures for monitoring
81- Maintain consistent tone: supportive, evidence-based, non-alarmist
82
83## Integration points
84
85### API Routes
86- **Chat**: `v0/app/api/chat/route.ts` - Conversational AI interactions
87- **Plan Generation**: `v0/app/api/generate-plan/route.ts` - Training plan creation
88- **Adjustments**: Background jobs (plan adjustment logic)
89- **Insights**: Post-run screens (run analysis and recovery)
90
91### Core Libraries
92- **Enhanced AI Coach**: `v0/lib/enhanced-ai-coach.ts` - Skill orchestration and routing
93- **Plan Generator**: `v0/lib/planGenerator.ts` - Plan creation logic
94- **Plan Templates**: `v0/lib/plan-templates.ts` - Fallback templates
95- **Recovery Engine**: `v0/lib/recoveryEngine.ts` - Recovery score calculations
96- **Periodization**: `v0/lib/periodization.ts` - Training load management
97- **Plan Complexity**: `v0/lib/plan-complexity-engine.ts` - Safety caps and thresholds
98
99### Data Layer
100- **Database**: `v0/lib/db.ts` - Dexie IndexedDB schema
101- **DB Utils**: `v0/lib/dbUtils.ts` - Common database operations
102- **Analytics**: `v0/lib/analytics.ts` - PostHog event tracking
103- **Monitoring**: `v0/lib/backendMonitoring.ts` - Performance and error tracking
104
105### UI Components
106- **Today Screen**: Main dashboard with readiness check
107- **Plan Screen**: Training calendar and workout details
108- **Record Screen**: GPS tracking and run recording
109- **Chat Screen**: Conversational AI interface
110- **Profile Screen**: User settings and history
111
112## Telemetry events (standard)
113
114All skills should emit these standard events via `v0/lib/analytics.ts`:
115
116- `ai_skill_invoked` - Every skill invocation with context
117- `ai_plan_generated` - Training plan creation
118- `ai_adjustment_applied` - Plan modifications
119- `ai_insight_created` - Run analysis
120- `ai_safety_flag_raised` - Safety warnings
121- `ai_user_feedback` - User ratings and comments
122
123See `references/telemetry.md` for detailed event schemas.
124
125## Development workflow
126
127### Adding a New Skill
1281. Create skill directory: `.cursor/skills/skill-name/`
1292. Write `SKILL.md` with metadata, description, and guidance
1303. Create `references/` subdirectory
1314. Add JSON schemas: `input-schema.json`, `output-schema.json`
1325. Document examples in `examples.md`
1336. Document edge cases in `edge-cases.md`
1347. Update this index to include the new skill
1358. Add integration code in relevant API routes/libraries
1369. Add tests for the skill
13710. Update CURSOR.md with skill description
138
139### Testing Skills
140- Use smoke tests from `references/smoke-tests.md`
141- Verify safety guardrails with edge case inputs
142- Test fallback behavior when data is missing
143- Validate telemetry event emission
144- Check SafetyFlag generation for risky scenarios
145
146### Monitoring Skills
147- Check `v0/lib/backendMonitoring.ts` for error rates
148- Review PostHog analytics for usage patterns
149- Monitor SafetyFlag frequency and severity
150- Track user feedback ratings
151- Analyze model latency and performance
152
153## Version History
154- **v1.0** (2026-01-23): Initial Cursor Agent skills system with 12 core skills