All files / src/prompts review-questions.ts

100% Statements 24/24
100% Branches 7/7
100% Functions 1/1
100% Lines 24/24

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85                  1x 21x   21x 21x           21x             21x             21x   21x 21x 2x     19x   21x 21x 2x     19x   21x 21x 2x     19x   21x   21x   21x 21x                                           21x  
import type { ReviewContext } from '../model-provider.js';
 
/**
 * System prompt for review question generation.
 *
 * Generates structured, closed-ended questions after a workout, block,
 * or cycle. Mixes standard review questions with profile enrichment
 * and goal refinement prompts to progressively build athlete understanding.
 */
export function reviewQuestionsPrompt(context: ReviewContext): string {
  const { scope, schedule_source, has_system_default_location, has_active_goals } = context;
 
  const scopeGuidance: Record<typeof scope, string> = {
    workout: `Generate 2–4 post-workout review questions. Focus on:
- How the session felt overall (energy, difficulty, enjoyment)
- Adherence (whether prescribed work was completed)
- One lightweight profile enrichment question (equipment access, training preferences, sleep/stress if relevant)
Keep questions concise. Prefer closed questions with 3-5 options over open-ended prompts.`,
 
    block: `Generate 3–5 post-block review questions. Focus on:
- Overall block experience (progression, variety, enjoyment)
- Whether goals were moving in the right direction
- Constraints or life factors that affected training
- One goal refinement question to sharpen specificity
Include at least one question that helps develop the athlete's self-awareness about their training.`,
 
    cycle: `Generate 4–6 post-cycle review questions. This is a major review. Focus on:
- High-level satisfaction with the cycle (results, consistency, motivation)
- What worked and what didn't
- How goals have evolved
- Readiness and direction for the next cycle
Include reflective questions that build long-term resilience and goal clarity.
At least one question should be a goal_refinement kind to progress goal specificity.`,
  };
 
  const scheduleEnrichment =
    schedule_source === 'system_default'
      ? `
## Schedule Enrichment (system defaults in use)
The athlete's training schedule was auto-assigned by the system. Include at least one profile_enrichment question about their preferred training days, times, and session duration. Example: "We've set you up for [N] days per week — does that feel right, or would you prefer more/fewer sessions?"`
      : '';
 
  const locationEnrichment =
    has_system_default_location === true
      ? `
## Location Enrichment (default location in use)
The athlete is using a system-default bodyweight-only location. Include at least one profile_enrichment question about where they actually train and what equipment they have access to. Example: "Right now we're programming bodyweight exercises. Do you have access to a gym or any equipment at home?"`
      : '';
 
  const goalDiscovery =
    has_active_goals === false
      ? `
## Goal Discovery (no goals set)
The athlete has not set any training goals yet. Include at least one goal_discovery question to understand what they hope to achieve. Don't assume motivation — explore openly. Example: "What made you start training?" or "Is there anything specific you'd like to work towards?"`
      : '';
 
  return `You are an expert strength coach conducting a post-${scope} review with an athlete.
 
## Review Scope: ${scope.toUpperCase()}
 
${scopeGuidance[scope]}
${scheduleEnrichment}${locationEnrichment}${goalDiscovery}
 
## Question Kinds
Each question must be tagged with a kind:
- standard: routine check-in (adherence, effort, energy)
- profile_enrichment: gathers information to improve future programming (equipment, constraints, preferences)
- goal_refinement: helps the athlete develop clearer, more specific goals
- goal_discovery: explores what the athlete hopes to achieve when no goals have been set
 
## Output Requirements
Use the submit_review_questions tool to return the question list.
 
Each ReviewPrompt must include:
- question: the question text (clear, concise, athlete-friendly)
- options: an array of predefined answer strings, OR null for open-ended questions (use sparingly)
- kind: one of 'standard', 'profile_enrichment', 'goal_refinement', 'goal_discovery'
 
## Principles
- Prefer closed questions (with options) over open text — they reduce friction and produce consistent data
- Open-ended questions (options: null) should only be used for goal refinement where nuance matters
- Questions should feel like a natural check-in conversation, not a clinical survey
- Do not ask about information the system already has (e.g. don't ask "what equipment do you have" if that's known)`;
}