SuperAPI AI Directory

goal

Data & analytics

View repository

Updated 10-15 22:15

About this skill

Health Goal and Habit Management Skill

Set health goals, track progress, build habits, and generate visualization reports.

Core Process

用户输入 -> 识别操作类型 -> 解析信息 -> 检查完整性 -> SMART验证 -> 生成JSON -> 保存数据

Step 1: Parse User Input

Operation Type Identification

Input Keywords Operation Type
set Set goal
progress Update progress
habit Record habit
review View goals and progress
report Generate visualization report
achieve View achievement system
complete Complete goal
adjust Adjust goal

Goal Type Recognition

Type Keywords
weight-loss Lose weight, weight loss goal
weight-gain Gain weight, muscle gain goal
exercise Exercise, workout, fitness
diet Diet, nutrition, meal
sleep Sleep, rest
health-metric Blood pressure, blood sugar, health metric

Step 2: Check Information Completeness

Set Goal (set)

  • Required: Goal type, goal description
  • Recommended: Goal value, deadline
  • Optional: Action plan

Update Progress (progress)

  • Required: Progress information
  • Recommended: Specific value

Record Habit (habit)

  • Required: Habit identifier or description
  • Recommended: Completion status

Step 3: SMART Principle Validation

SMART Checklist

  • Specific: Clear and specific goal
  • Measurable: Progress can be quantified
  • Achievable: Realistic and attainable
  • Relevant: Health-related
  • Time-bound: Has clear deadline |

Validation Prompts

Goal Validation:
✓ Specific: Clear goal content
✓ Measurable: Has quantifiable metrics
✓ Achievable: Realistic and feasible
✓ Relevant: Health-related
✓ Time-bound: Has deadline

If validation fails, user will be prompted to adjust goal

Step 4: Generate JSON

Goal Data Structure

{
  "goal_id": "goal_20250101_001",
  "type": "weight-loss",
  "title": "减重5公斤",
  "description": "在6个月内减重5公斤",
  "start_date": "2025-01-01",
  "target_date": "2025-06-30",
  "current_value": 0,
  "target_value": 5,
  "unit": "公斤",
  "status": "in_progress",
  "progress_percentage": 0,
  "smart_verified": true,
  "action_plan": [
    "每周运动4次",
    "减少500卡路里摄入",
    "每天吃5份蔬果"
  ],
  "milestones": [
    {
      "target": 2.5,
      "date": "2025-03-31",
      "achieved": false
    }
  ],
  "created_at": "2025-01-01T00:00:00.000Z"
}

Habit Data Structure

{
  "habit_id": "habit_20250101_001",
  "name": "morning-stretch",
  "title": "早上拉伸",
  "description": "每天早上7点拉伸10分钟",
  "frequency": "daily",
  "trigger": "起床后",
  "streak": 7,
  "longest_streak": 21,
  "total_completions": 45,
  "created_at": "2025-01-01T00:00:00.000Z"
}

See the complete Schema definition at schema.json。

Step 5: Save Data

  1. Generate Unique ID
  2. Save to data/goal-tracker.json
  3. Update Progress Statistics

Achievement System

Basic Achievement List

Achievement Unlock Condition
First Goal Complete first health goal
7-Day Streak Complete any habit for 7 consecutive days
21-Day Streak Complete any habit for 21 consecutive days
30-Day Streak Complete any habit for 30 consecutive days
Halfway Complete 50% of any goal
Goal Complete Complete a health goal
Early Finish Complete goal ahead of schedule
Exceed Goal Exceed goal target

Progress Prediction Algorithm

// Predict completion date based on current progress
function predictCompletion(goal) {
  const daysPassed = getDaysBetween(goal.start_date, new Date());
  const daysRemaining = getDaysBetween(new Date(), goal.target_date);
  const progressPerDay = goal.current_value / daysPassed;

  const predictedDays = (goal.target_value - goal.current_value) / progressPerDay;
  const predictedDate = addDays(new Date(), predictedDays);

  return {
    predicted_date: predictedDate,
    on_track: predictedDate <= goal.target_date,
    days_ahead: getDaysBetween(predictedDate, goal.target_date)
  };
}

Execution Instructions

1. 识别操作类型
2. 解析输入参数,提取所有可用信息
3. 检查必填字段,如有缺失则询问用户
4. 对目标进行SMART原则验证
5. 生成符合 schema.json 的 JSON
6. 保存到数据文件
7. 向用户确认保存成功,并显示摘要和建议
8. 如达成成就,自动解锁并提示

Example Interactions

Example 1: Set a Weight Loss Goal

用户: 设定目标 减重5公斤 2025年6月30日
AI: ✅ 目标设定成功

    目标信息:
    类型: 减重目标
    目标: 减重5公斤
    开始日期: 2025-01-01
    目标日期: 2025-06-30

    SMART验证: ✅ 通过
    ✓ 具体: 明确减重5公斤
    ✓ 可衡量: 可追踪体重变化
    ✓ 可实现: 现实可行
    ✓ 相关: 与健康相关
    ✓ 有时限: 6个月期限

    行动计划建议:
    • 每周运动4次,每次30分钟
    • 每天减少500卡路里摄入
    • 每天吃5份蔬果
    • 戒烟限酒

    已保存至健康目标

Example 2: Record a Habit

用户: 记录习惯 早上拉伸 完成
AI: ✅ 习惯记录已更新

    习惯: 早上拉伸
    连续天数: 8天
    最长连续: 21天
    总完成次数: 46次

    🎉 新成就解锁: 连续7天!

    继续保持!还有13天解锁"连续21天"成就

Example 3: Generate a Progress Report

用户: 目标进度报告
AI: 📊 健康目标进度报告

    减重目标:
    进度: 3.5/5公斤 (70%)
    预计完成: 2025年5月20日 (提前41天)
    状态: 进展顺利 ✅

    运动目标:
    进度: 2/4次 (50%)
    本周完成: 2次
    状态: 需要努力 ⚠️

    习惯追踪:
    • 早上拉伸: 7天连续 ✅
    • 餐前喝水: 5天连续

    [生成完整可视化报告...]

Important Notes

  • The health goal setting and tracking provided by this system are for reference only
  • It does not constitute medical diagnosis, treatment, or professional advice
  • Setting extreme or unhealthy weight loss/gain goals will trigger a warning
  • If you have chronic diseases, please consult a doctor before setting goals
  • All data is stored locally only