domains / general / ai-health-analysis / ai-analyzer

ai-analyzer

Skill card

combined

The two copies share the same core structure, data sources, algorithms, and safety rules, but they disagree on critical operational details. The sickn33 copy is a heavily modified, safety-hardened version that explicitly disclaims clinical validation, adds a 'Supporting material availability' section noting missing scripts, and changes Step 6 (Risk Prediction) to require model verification before calculating probabilities. It also changes Step 9 to only save history upon user confirmation. The FreedomIntelligence copy is the 'original' or less cautious version that assumes the scripts exist, calculates 10-year probabilities directly, and automatically updates history. Because the sickn33 copy contains material constraints (missing file checks, model verification) that the other lacks, and they disagree on the execution of risk prediction and history logging, crowning one would hide a real alternative implementation.

Repositories

RepositoryPath
sickn33/agentic-awesome-skillsplugins/agentic-awesome-skills-claude/skills/ai-analyzer/SKILL.md
FreedomIntelligence/OpenClaw-Medical-Skillsskills/ai-analyzer/SKILL.md

Other copies

RoleRepositoryPath
peersickn33/agentic-awesome-skillsplugins/agentic-awesome-skills-claude/skills/ai-analyzer/SKILL.md
peerFreedomIntelligence/OpenClaw-Medical-Skillsskills/ai-analyzer/SKILL.md
adaptersickn33/agentic-awesome-skillsplugins/agentic-awesome-skills/skills/ai-analyzer/SKILL.md
adaptersickn33/agentic-awesome-skillsskills/ai-analyzer/SKILL.md

Combined skill

---
name: ai-analyzer
description: AI-driven comprehensive health analysis system integrating multi-dimensional health data, identifying anomaly patterns, organizing risk factors, and providing general health information. Supports intelligent Q&A and AI health report generation.
allowed-tools: Read, Grep, Glob, Write
risk: critical
source: community
---

# AI Health Analyzer

Used to organize provided health data, describe trends, and prepare questions for doctor discussion. This is not a clinically validated prediction system.

## When to Use
- User wants AI-driven health analysis across multiple health datasets or lifestyle signals.
- Need anomaly detection, risk factor identification, or personalized recommendations based on health inputs.
- Need generated health reports or question-answering over health metrics and trends.

## Input and Evidence Boundaries
- Statistical anomalies do not equal medical anomalies.
- CUSUM, Z-score, and correlation require sufficient, comparable samples; correlation does not prove causation.
- Nutritional intake below reference levels does not directly prove deficiency; sleep questionnaires do not diagnose sleep disorders.
- Emergency symptoms should be handled according to local emergency procedures; do not delay medical care for report generation.

## Core Features
1. **Intelligent Health Analysis**: Multi-dimensional data integration (basic metrics, lifestyle, mental health, medical history), anomaly pattern recognition (CUSUM, Z-score), correlation analysis (Pearson, Spearman), trend prediction.
2. **Health Risk Prediction**: Hypertension (Framingham), Diabetes (ADA), Cardiovascular (ACC/AHA ASCVD), Nutritional Deficiency (RDA), Sleep Disorder (PSQI).
3. **Personalized Advice Engine**: Based on static profile (age, sex, BMI, activity). Levels: 1 (General), 2 (Reference), 3 (Medical, requires doctor confirmation).
4. **Natural Language Interaction**: Intelligent Q&A, context understanding, intent recognition.
5. **AI Health Report Generation**: Comprehensive reports, quick summaries, risk assessment, trend analysis, HTML interactive reports (ECharts, Tailwind CSS).

## Execution Steps

### Step 1: Read AI Configuration
Read `data/ai-config.json` and `data/ai-history.json`. Check if AI features are enabled and verify data source configuration.

### Step 2: Read User Profile
Read `data/profile.json` to get basic info: age, sex, height, weight, BMI.

### Step 3: Read Health Data
Read relevant data based on configuration:
- Basic metrics: `data/index.json`
- Lifestyle: `data-example/fitness-tracker.json`, `data-example/sleep-tracker.json`, `data-example/nutrition-tracker.json`
- Mental Health: `data-example/mental-health-tracker.json`
- Medical History: `data/medications.json`, `data/allergies.json` (if exist)

### Step 4: Data Integration and Preprocessing
Integrate all data sources, perform data cleaning, time alignment, and missing value handling.

### Step 5: Multi-dimensional Analysis
- **Correlation**: Calculate associations (e.g., sleep↔mood, exercise↔weight).
- **Trend**: Use linear regression, moving averages to identify trend direction.
- **Anomaly Detection**: Use CUSUM, Z-score to detect outliers and change points.

### Step 6: Risk Prediction
**Conflict Resolution**: Verify specific model version, necessary inputs, applicable population, and time range. 
- If verified: Calculate risk using the specified model (e.g., Framingham for 10-year CVD risk).
- If not verified: Only describe risk factors; do not calculate disease probabilities.
- Note: ADA questionnaire score is not a personal 10-year incidence probability.

### Step 7: Generate Personalized Advice
Generate three-level advice:
- **Level 1**: General advice (based on standard guidelines).
- **Level 2**: Reference advice (based on personal data).
- **Level 3**: Medical advice (requires doctor confirmation, includes disclaimer).

### Step 8: Generate Analysis Report
- **Text Report**: Overall assessment, risk factors, key trends, correlation findings, personalized advice.
- **HTML Report**: 
  - **Check**: Verify if `scripts/generate_ai_report.py` exists in the installation.
  - **If exists**: Call script to generate interactive report with ECharts.
  - **If missing**: Report that the HTML generation script is unavailable; do not fabricate the script. Provide text report only.

### Step 9: Update AI History
**Conflict Resolution**: Only save results if the user explicitly requests to keep records and confirms a private target. Do not automatically write to `data/ai-history.json` without user consent.

## Data Sources
| Data Source | File Path | Content |
|-------------|-----------|---------|
| User Profile | `data/profile.json` | Age, sex, height, weight, BMI |
| Medical Records | `data/index.json` | Biochemical indicators, imaging |
| Fitness Tracker | `data-example/fitness-tracker.json` | Type, duration, intensity, MET |
| Sleep Tracker | `data-example/sleep-tracker.json` | Duration, quality, PSQI |
| Nutrition Tracker | `data-example/nutrition-tracker.json` | Diet records, nutrients, RDA |
| Mental Health | `data-example/mental-health-tracker.json` | PHQ-9, GAD-7 |
| Medications | `data/medications.json` | Name, dose, usage, adherence |
| Allergies | `data/allergies.json` | Allergens, severity |

## Algorithms
- **Correlation**: Pearson (continuous), Spearman (ordinal).
- **Anomaly Detection**: CUSUM (change points), Z-score (|z| > 2), IQR.
- **Risk Prediction**: Framingham, ADA, ASCVD Calculator.

## Safety and Compliance
- **Must Follow**:
  - ❌ No medical diagnosis.
  - ❌ No specific dosage advice.
  - ❌ No life/death prognosis.
  - ❌ Do not replace doctor's advice.
  - ✅ All analysis must be marked "For reference only".
  - ✅ Level 3 advice must include disclaimer.
  - ✅ High-risk predictions must suggest consulting a doctor.
- **Privacy Protection**:
  - Only read user-authorized data; missing records do not equal normal or zero values.
  - Local files may enter host model context; ensure explicit authorization for external data transfer if applicable.
  - Escape untrusted text in HTML; avoid remote scripts, trackers, and public health reports.

## Related Commands
- `/ai analyze` - AI comprehensive analysis
- `/ai predict [risk_type]` - Health risk prediction
- `/ai chat [query]` - Natural language Q&A
- `/ai report generate [type]` - Generate AI health report
- `/ai status` - Check AI feature status

## Technical Implementation
- **Tools**: Read, Grep, Glob, Write.
- **Performance**: Incremental reading, data caching, lazy calculation.

## Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for professional medical advice.