Health trend analyzer

From vitaclaw/vitaclaw · View interactive version

Health trend analyzer is an AI agent skill from the GitHub repository vitaclaw/vitaclaw. Analyzes health data trends and patterns over time. Correlates medications, symptoms, vital signs, lab results, and other health metrics. Identifies concerning trends, improvements, and provides data-driven insights with interactive HTML visualization reports (ECharts). Use when the user asks about

How to use this skill

Skill file

Health Trend Analyzer

Analyzes health data trends and patterns over time, identifies changes, correlations, and provides data-driven health insights.

Core Features

1. Multi-Dimensional Trend Analysis

2. Correlation Analysis Engine

3. Change Detection

4. Predictive Insights

Usage Instructions

Trigger Conditions

Use this skill when the user mentions the following scenarios:

General Inquiries:

Specific Dimensions:

Correlation Analysis:

Time Range:

Execution Steps

Step 1: Determine Analysis Time Range

Extract the time range from user input, or use the default (3 months).

Step 2: Read Health Data

Read the following data sources:

// 1. Personal profile (BMI, weight)
const profile = readFile('data/profile.json');

// 2. Symptom records
const symptomFiles = glob('data/symptoms/**/*.json');
const symptoms = readAllJson(symptomFiles);

// 3. Mood records
const moodFiles = glob('data/mood/**/*.json');
const moods = readAllJson(moodFiles);

// 4. Diet records
const dietFiles = glob('data/diet/**/*.json');
const diets = readAllJson(dietFiles);

// 5. Medication logs
const medicationLogs = glob('data/medication-logs/**/*.json');

// 6. Women's health data (if applicable)
const cycleData = readFile('data/cycle-tracker.json');
const pregnancyData = readFile('data/pregnancy-tracker.json');
const menopauseData = readFile('data/menopause-tracker.json');

// 7. Allergy history
const allergies = readFile('data/allergies.json');

// 8. Radiation records
const radiation = readFile('data/radiation-records.json');
Step 3: Data Filtering

Filter data by time range:

function filterByDate(data, startDate, endDate) {
  return data.filter(item => {
    const itemDate = new Date(item.date || item.created_at);
    return itemDate >= startDate && itemDate <= endDate;
  });
}
Step 4: Trend Analysis

Perform trend analysis for each data dimension:

4.1 Weight/BMI Trend

4.2 Symptom Patterns

4.3 Medication Adherence

4.4 Lab Results

4.5 Mood & Sleep

Step 5: Correlation Analysis

Use statistical methods to identify correlations:

// Pearson correlation coefficient
function pearsonCorrelation(x, y) {
  // Calculate correlation coefficient
  // Return value range: -1 (negative correlation) to 1 (positive correlation)
}

// Application scenarios
- Medication start date vs. symptom frequency
- Sleep duration vs. mood score
- Weight change vs. diet records
- Exercise volume vs. mood state
Step 6: Change Detection

Identify significant changes:

// Change point detection
function detectChangePoints(timeSeries) {
  // Use statistical methods to detect significant change points
  // E.g.: sudden weight loss, sudden symptom increase
}

// Threshold alerts
function checkThresholds(value, thresholds) {
  // Check whether values approach or exceed danger thresholds
  // E.g.: BMI > 30, radiation dose > safety limit
}
Step 7: Generate Insights

Generate predictive insights based on analysis results:

// Risk assessment
function assessRisks(trends) {
  // Identify high-risk trends
  // E.g.: rapid weight loss, frequent symptoms
}

// Prevention recommendations
function generateRecommendations(trends, correlations) {
  // Suggest preventive measures based on patterns
  // E.g.: improve sleep, increase medication adherence
}

// Early warnings
function earlyWarnings(trends) {
  // Predict problems before they become serious
  // E.g.: rising symptom frequency, persistent low mood
}
Step 8: Generate Visualization Report

Generate an interactive HTML report:

  1. Data summary: Generate analysis results in JSON format
  2. HTML template rendering: Inject data into HTML template
  3. ECharts chart configuration: Configure 6 types of interactive charts
  4. Save file: Save as a standalone HTML file

See Data Source Documentation for detailed output format.

Output Format

Text Report (Concise Version)

Health Trend Analysis Report
==============================
Generated: 2025-12-31
Analysis Period: Past 3 months (2025-10-01 to 2025-12-31)

Overall Assessment
==============================
Improving: Weight management, cholesterol levels
Stable: Blood glucose control, mood state
Needs Attention: Medication adherence, sleep quality

Weight/BMI Trend
|- Current weight: 68.5 kg
|- Current BMI: 23.1 (normal range)
|- 3-month change: -2.3 kg (-3.2%)
|- Trend: Gradual weight loss
|- Assessment: Positive trend, within healthy range

Medication Adherence
|- Current medications: 3
|- Overall adherence rate: 78%
|- Missed doses: 8
|- Best: Aspirin (95%)
|- Needs improvement: Amlodipine (65%)

Symptom Patterns
|- Most frequent: Headache (12 times in past 3 months)
|- Trend: Frequency decreasing (4 fewer than previous period)
|- Potential trigger: Moderate correlation with sleep quality identified (r=0.62)
|- Recommendation: Continue improving sleep patterns

Lab Result Trends
|- Cholesterol: 240 -> 210 mg/dL (improved)
|- Blood glucose: 5.6 -> 5.4 mmol/L (stable)
|- Last test: 30 days ago
|- Recommendation: Recheck in 3 months

Mood & Sleep
|- Average mood score: 6.8/10
|- Average sleep duration: 6.5 hours
|- Trend: Mood stable, sleep slightly improved
|- Correlation: Sleep duration strongly correlated with mood score (r=0.78)

Correlation Analysis
==============================
- Sleep duration <-> Mood score: Strong positive correlation (r=0.78)
- Weight change <-> Diet records: Moderate correlation (r=0.55)
- Medication adherence <-> Symptom frequency: Moderate negative correlation (r=-0.62)

Risk Assessment & Recommendations
==============================

Keep It Up
- Current weight management approach is effective
- Cholesterol levels show notable improvement

Needs Attention
- Improve amlodipine adherence (set reminders)
- Increase sleep duration to 7-8 hours

Follow-up Schedule
- Recheck lipid panel in 3 months
- Assess medication adherence improvement in 1 month

==============================
Disclaimer:
This analysis is for reference only and does not replace
professional medical diagnosis. Please consult a doctor
for professional advice.

HTML Visualization Report (Full Version)

Generates a standalone HTML file with ECharts interactive charts, including:

  1. Overall assessment cards: Key metrics at a glance
  2. Weight/BMI trend chart: Dual Y-axis line chart (weight + BMI)
  3. Symptom frequency chart: Color-coded bar chart (high-frequency red / moderate yellow / low green)
  4. Medication adherence dashboard: Overall adherence rate + per-medication details
  5. Lab result trend chart: Multi-series line chart + reference lines
  6. Correlation heat map: Heat map showing inter-variable correlations
  7. Mood & sleep area chart: Dual Y-axis area chart

HTML File Features:

Data Sources

Primary Data Sources

| Data Source | File Path | Data Content |

|------------|-----------|-------------|

| Personal profile | data/profile.json | Weight, height, BMI history |

| Symptom records | data/symptoms/**/*.json | Symptom name, severity, duration |

| Mood records | data/mood/**/*.json | Mood score, sleep quality, stress level |

| Diet records | data/diet/**/*.json | Meals, foods, calories, nutrients |

| Medication logs | data/medication-logs/**/*.json | Medication time, adherence records |

| Lab results | data/medical_records/**/*.json | Biochemical markers, reference ranges |

Supplementary Data Sources

| Data Source | File Path | Data Content |

|------------|-----------|-------------|

| Menstrual cycle | data/cycle-tracker.json | Cycle length, symptom records |

| Pregnancy tracking | data/pregnancy-tracker.json | Gestational week, weight, exam records |

| Menopause | data/menopause-tracker.json | Symptoms, HRT use |

| Allergy history | data/allergies.json | Allergens, severity |

| Radiation records | data/radiation-records.json | Cumulative radiation dose |

For detailed data structure descriptions, see: data-sources.md

Analysis Algorithms

Time Series Analysis

Correlation Analysis

Change Point Detection

Statistical Metrics

For detailed algorithm descriptions, see: algorithms.md

Safety & Privacy

Must Follow

Information Accuracy

Privacy Protection

Error Handling

Missing Data

Analysis Failure

Usage Examples

Example 1: General Health Trends

User: "How has my health changed over the past 3 months?"

Output: Generates a complete HTML report with trend analysis across all dimensions.

Example 2: Symptom Analysis

User: "Analyze my symptom patterns"

Output: Focused analysis of symptom frequency, triggers, and trends.

Example 3: Weight Trends

User: "What are my weight trends?"

Output: Focused analysis of weight/BMI changes, correlation with diet/exercise.

Example 4: Medication Effectiveness

User: "Is my blood pressure medication working?"

Output: Correlates medication start date with blood pressure readings and symptom improvement.

For more complete examples, see: examples.md

Related Commands

Technical Implementation

Tool Limitations

This skill uses only the following tools (no additional permissions required):

Performance Optimization

Extensibility

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.