Chat-based goal classification (habit/distance/speed/race) with constraint clarification. Use during onboarding or when user wants to update their running goals through conversation with weekly commitment discovery.
ConversationTurn entries and any partial onboarding answers.habit | distance | speed | race) with confidence and blockers.CoachMessage summary plus structured GoalDiscoveryResult.{
"conversation": ConversationTurn[],
"profile": UserProfile,
"partialOnboarding"?: Record<string, unknown>
}
{
"goalDiscovery": {
"goal": Goal,
"confidence": number,
"blockers": string[],
"weeklyCommitment": number,
"preferredDays"?: string[],
"starterPlanId"?: string,
"summaryCard": string,
"safetyFlags"?: SafetyFlag[]
},
"coachMessage": CoachMessage
}
v0/app/api/chat/route.ts - Conversational interfacev0/lib/conversationStorage.ts - Conversation historyv0/lib/onboardingPromptBuilder.ts - Onboarding promptsv0/app/api/generate-plan/route.ts when confidence ≥0.7chat_messages tableSafetyFlag on harmful intents or ambiguous data.ai_skill_invoked with:
goal (classified)confidenceturns_count (conversation length)latency_msai_user_feedback when user responds to suggestions