Integrate multiple digital health data sources, connect to WellAlly.tech knowledge base, providing data import and knowledge reference for personal health management systems.
Use this skill when users mention the following scenarios:
Data Import:
Knowledge Base Query:
Data Management:
Determine what the user wants:
If user wants to import data:
2.1 Determine Data Source
const dataSource = identifySource(userInput);
// Possible returns: "apple-health", "fitbit", "oura", "generic-csv", "generic-json"
2.2 Read External Data Use appropriate import script based on data source type:
// Apple Health
const appleHealthData = readAppleHealthExport(exportPath);
// Fitbit
const fitbitData = fetchFitbitData(dateRange);
// Oura Ring
const ouraData = fetchOuraData(dateRange);
// Generic CSV/JSON
const genericData = readGenericFile(filePath, mappingConfig);
2.3 Data Mapping and Conversion Map external data to local format:
// Example: Apple Health steps mapping
function mapAppleHealthSteps(appleRecord) {
return {
date: formatDateTime(appleRecord.startDate),
steps: parseInt(appleRecord.value),
source: "Apple Health",
device: appleRecord.sourceName
};
}
// Save to local file
saveToLocalFile("data/fitness/activities.json", mappedData);
2.4 Data Validation
function validateImportedData(data) {
// Check required fields
// Validate data types
// Check data ranges
// Ensure correct time format
return {
valid: true,
errors: [],
warnings: []
};
}
2.5 Generate Import Report
const importReport = {
source: dataSource,
import_date: new Date().toISOString(),
records_imported: {
steps: 1234,
weight: 30,
heart_rate: 1200,
sleep: 90
},
date_range: {
start: "2025-01-01",
end: "2025-01-22"
},
validation: validationResults
};
If user wants to query knowledge base:
3.1 Identify Query Topic
const topic = identifyTopic(userInput);
// Possible returns: "nutrition", "fitness", "sleep", "mental-health", "chronic-disease", "hypertension", "diabetes", etc.
3.2 Search Relevant Articles Find relevant articles from knowledge base index:
function searchKnowledgeBase(topic) {
// Read knowledge base index
const kbIndex = readFile('.claude/skills/wellally-tech/knowledge-base/index.md');
// Find matching articles
const articles = kbIndex.categories.filter(cat =>
cat.tags.includes(topic) || cat.keywords.includes(topic)
);
return articles;
}
3.3 Return Article Links
const results = {
topic: topic,
articles: [
{
title: "Hypertension Monitoring and Management",
url: "https://wellally.tech/knowledge-base/chronic-disease/hypertension-monitoring",
category: "Chronic Disease Management",
description: "Learn how to effectively monitor and manage blood pressure"
},
{
title: "Blood Pressure Lowering Strategies",
url: "https://wellally.tech/knowledge-base/chronic-disease/bp-lowering-strategies",
category: "Chronic Disease Management",
description: "Improve blood pressure levels through lifestyle changes"
}
],
total_found: 2
};
If user wants personalized recommendations:
4.1 Read User Health Data
// Read relevant health data
const profile = readFile('data/profile.json');
const bloodPressure = glob('data/blood-pressure/**/*.json');
const sleepRecords = glob('data/sleep/**/*.json');
const weightHistory = profile.weight_history || [];
4.2 Analyze Health Status
function analyzeHealthStatus(data) {
const status = {
concerns: [],
good_patterns: []
};
// Analyze blood pressure
if (data.blood_pressure?.average > 140/90) {
status.concerns.push({
area: "blood_pressure",
severity: "high",
condition: "Hypertension",
value: data.blood_pressure.average
});
}
// Analyze sleep
if (data.sleep?.average_duration < 6) {
status.concerns.push({
area: "sleep",
severity: "medium",
condition: "Sleep Deprivation",
value: data.sleep.average_duration + " hours"
});
}
// Analyze weight trend
if (data.weight?.trend === "increasing") {
status.concerns.push({
area: "weight",
severity: "medium",
condition: "Weight Gain",
value: data.weight.change + " kg"
});
}
// Identify good patterns
if (data.steps?.average > 8000) {
status.good_patterns.push({
area: "activity",
description: "Daily average steps over 8000",
value: data.steps.average
});
}
return status;
}
4.3 Recommend Relevant Articles
function recommendArticles(healthStatus) {
const recommendations = [];
for (const concern of healthStatus.concerns) {
const articles = findArticlesForCondition(concern.condition);
recommendations.push({
condition: concern.condition,
severity: concern.severity,
articles: articles
});
}
return recommendations;
}
4.4 Generate Recommendation Report
const recommendationReport = {
generated_at: new Date().toISOString(),
health_status: healthStatus,
recommendations: recommendations,
total_articles: recommendations.reduce((sum, r) => sum + r.articles.length, 0)
};
✅ Data Import Successful
Data Source: Apple Health
Import Time: 2025-01-22 14:30:00
Import Records Statistics:
━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Step Records: 1,234 records
⚖️ Weight Records: 30 records
❤️ Heart Rate Records: 1,200 records
😴 Sleep Records: 90 records
Data Time Range: 2025-01-01 to 2025-01-22
━━━━━━━━━━━━━━━━━━━━━━━━━━
💾 Data Saved To:
• data/fitness/activities.json (steps)
• data/profile.json (weight history)
• data/fitness/heart-rate.json (heart rate)
• data/sleep/sleep-records.json (sleep)
⚠️ Validation Warnings:
• 3 step records missing timestamps, used default values
• 1 weight record abnormal (<20kg), skipped
💡 Next Steps:
• Use /health-trend to analyze imported data
• Use /wellally-tech for personalized article recommendations
📚 WellAlly Knowledge Base Search Results
Search Topic: Hypertension Management
Articles Found: 2
━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Hypertension Monitoring and Management
Category: Chronic Disease Management
Link: https://wellally.tech/knowledge-base/chronic-disease/hypertension-monitoring
Description: Learn how to effectively monitor and manage blood pressure
2. Blood Pressure Lowering Strategies
Category: Chronic Disease Management
Link: https://wellally.tech/knowledge-base/chronic-disease/bp-lowering-strategies
Description: Improve blood pressure levels through lifestyle modifications
━━━━━━━━━━━━━━━━━━━━━━━━━━
🔗 Related Topics:
• Diabetes Management
• Cardiovascular Health
• Medication Adherence
💡 Tips:
Click links to visit [WellAlly.tech](https://www.wellally.tech/) platform for full articles
💡 Article Recommendations Based on Your Health Data
Generated Time: 2025-01-22 14:30:00
━━━━━━━━━━━━━━━━━━━━━━━━━━
🔴 Attention Needed: Blood Pressure Management
━━━━━━━━━━━━━━━━━━━━━━━━━━
Current Status: Average blood pressure 142/92 mmHg (elevated)
Recommended Articles:
1. Hypertension Monitoring and Management
https://wellally.tech/knowledge-base/chronic-disease/hypertension-monitoring
2. Blood Pressure Lowering Strategies
https://wellally.tech/knowledge-base/chronic-disease/bp-lowering-strategies
3. Antihypertensive Medication Adherence Guide
https://wellally.tech/knowledge-base/chronic-disease/medication-adherence
━━━━━━━━━━━━━━━━━━━━━━━━━━
🟡 Attention Needed: Sleep Improvement
━━━━━━━━━━━━━━━━━━━━━━━━━━
Current Status: Average sleep duration 5.8 hours (insufficient)
Recommended Articles:
1. Sleep Hygiene Basics
https://wellally.tech/knowledge-base/sleep/sleep-hygiene
2. Improve Sleep Quality
https://wellally.tech/knowledge-base/sleep/sleep-quality-improvement
━━━━━━━━━━━━━━━━━━━━━━━━━━
🟢 Keep Up: Daily Activity
━━━━━━━━━━━━━━━━━━━━━━━━━━
Current Status: Daily average steps 9,234 (good)
Related Reading:
1. Maintain Active Lifestyle
https://wellally.tech/knowledge-base/fitness/active-lifestyle
━━━━━━━━━━━━━━━━━━━━━━━━━━
Summary: 5 related articles recommended
Visit [WellAlly.tech](https://www.wellally.tech/) Knowledge Base for full content
| Data Source | Type | Import Method | Data Content |
|---|---|---|---|
| Apple Health | File Import | XML/ZIP Parsing | Steps, weight, heart rate, sleep, workouts |
| Fitbit | API/CSV | OAuth2 or CSV | Activities, heart rate, sleep, weight |
| Oura Ring | API | OAuth2 | Sleep stages, readiness, heart rate variability |
| Generic CSV | File Import | Field Mapping | Custom health data |
| Generic JSON | File Import | Field Mapping | Custom health data |
| File Path | Data Content | Source Mapping |
|---|---|---|
data/profile.json |
Profile, weight history | Apple Health, Fitbit, Oura |
data/fitness/activities.json |
Steps, activity data | Apple Health, Fitbit, Oura |
data/fitness/heart-rate.json |
Heart rate records | Apple Health, Fitbit, Oura |
data/sleep/sleep-records.json |
Sleep records | Apple Health, Fitbit, Oura |
data/fitness/recovery.json |
Recovery data | Oura Ring (readiness) |
Nutrition & Diet (knowledge-base/nutrition.md)
Fitness & Exercise (knowledge-base/fitness.md)
Sleep Health (knowledge-base/sleep.md)
Mental Health (knowledge-base/mental-health.md)
Chronic Disease Management (knowledge-base/chronic-disease.md)
const articleMapping = {
"Hypertension": [
"chronic-disease/hypertension-monitoring",
"chronic-disease/bp-lowering-strategies"
],
"Diabetes": [
"chronic-disease/diabetes-management",
"nutrition/diabetic-diet"
],
"Sleep Deprivation": [
"sleep/sleep-hygiene",
"sleep/sleep-quality-improvement"
],
"Weight Gain": [
"nutrition/healthy-diet",
"nutrition/calorie-management"
],
"High Stress": [
"mental-health/stress-management",
"mental-health/mindfulness"
]
};
Export Steps:
Import Steps:
python scripts/import_apple_health.py ~/Downloads/apple_health_export.zip
API Integration:
Import Data:
python scripts/import_fitbit.py --api --days 30
CSV Import:
python scripts/import_fitbit.py --csv fitbit_export.csv
API Integration:
Import Data:
python scripts/import_oura.py --date-range 2025-01-01 2025-01-22
CSV Import:
python scripts/import_generic.py health_data.csv --mapping mapping_config.json
Mapping Configuration Example (mapping_config.json):
{
"date": "Date",
"steps": "Step Count",
"weight": "Weight (kg)",
"heart_rate": "Resting Heart Rate"
}
File Read Failure:
API Call Failure:
Data Validation Failure:
/health-trend: Analyze health trends (using imported data)/sleep: Record sleep data/diet: Record diet data/fitness: Record exercise data/profile: Manage personal profileThis Skill only uses the following tools:
Python packages potentially needed for import scripts:
# Apple Health
import xml.etree.ElementTree as ET
import zipfile
# Fitbit/Oura
import requests
# Generic Import
import csv
import json
User: "Import fitness tracker data from Apple Health" Output: Execute import workflow, generate import report
User: "WellAlly platform articles about sleep" Output: Return sleep-related knowledge base article links
User: "Recommend articles based on my health data" Output: Analyze health data, recommend relevant articles
User: "Import this CSV health data file health.csv" Output: Parse CSV, map fields, save to local
integrations/ directoryscripts/ directorydata-sources.md documentationknowledge-base/ directoryknowledge-base/index.md
Q: Will imported data overwrite existing data? A: No. Imported data will be appended to existing data, not overwritten. Duplicate data will be automatically deduplicated.
Q: Can I import data from multiple platforms? A: Yes. You can import data from Apple Health, Fitbit, Oura, and other platforms simultaneously, the system will merge all data.
Q: Are WellAlly.tech knowledge base articles offline? A: No. Knowledge base articles are referenced via URLs, requiring network connection to access the WellAlly.tech platform.
Q: Where are API credentials stored? A: API credentials are encrypted and stored in local configuration files, not uploaded to any server.