health-logging
Skill2 starsChanged 8 months agoMITView on GitHub
Log medications, daily health entries, weight, and lab reports — includes AI-powered lab report parsing where the agent reads a PDF/image and stores all values automatically
- Reads credentials
- Sends data out
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Presidio-Federal/ai-studio-netopstheir own version, first seen Oct 9, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Presidio-Federal/ai-studio-netops★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- health-analysisSkill
- health-setupSkill
- health-syncSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Key capability: When a user shares a lab report (image or PDF), you read it directly using your multimodal capabilities, extract all …
- Distinctive: line 163
Use consistent symptom names for better analysis:
- Distinctive: line 233
When the user says "I have a lab report" or "upload my blood test", ask them to:
- Very specific: line 307
If the report already shows H/L/Normal flags, use those
- Distinctive: line 317
Before storing, show a table summary:
- Distinctive: line 386
Important: When batch inserting, ALL objects must have identical keys (include null for missing fields).
- Distinctive: line 406
Use these consistent parameter names for cross-report tracking:
- Distinctive: line 508
After inserting a lab report, always offer to analyse it:
- Very specific: line 521
Use the /health-analysis skill to run the correlation analysis.
- Distinctive: line 525
After inserting data via Supabase, pull it to your local DuckDB for analysis:
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Health Logging Skill
This skill handles all manual data input: medication doses, daily health entries (mood, energy, symptoms), lab reports, and weight.
Key capability: When a user shares a lab report (image or PDF), you read it directly using your multimodal capabilities, extract all biomarker values, map them to standard parameter names, and store them in Supabase. No external OCR or parsing tool needed.
Data is stored in Supabase (source of truth) and synced to local DuckDB.
Prerequisites
- Supabase credentials configured in
.env(SUPABASE_URL,SUPABASE_SERVICE_KEY) - Patient UUID known (query from
patientstable or checkHEALTH_CONTEXT.md)
Get Patient ID
curl -s "$SUPABASE_URL/rest/v1/patients?select=id,name&limit=1" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY"Or from DuckDB:
SELECT id, name FROM patients LIMIT 1Store this UUID — it is needed for all insert operations below.
Log a Medication Dose
Record That a Medication Was Taken
curl -s -X POST "$SUPABASE_URL/rest/v1/medication_logs" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY" \
-H "Content-Type: application/json" -H "Prefer: return=representation" \
-d '{
"patient_id": "PATIENT_UUID",
"medication_id": MEDICATION_ID,
"date": "2026-03-20",
"taken": true,
"taken_at": "2026-03-20T08:30:00+05:30",
"notes": "Taken with breakfast"
}'Record a Missed Dose
curl -s -X POST "$SUPABASE_URL/rest/v1/medication_logs" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY" \
-H "Content-Type: application/json" -H "Prefer: return=representation" \
-d '{
"patient_id": "PATIENT_UUID",
"medication_id": MEDICATION_ID,
"date": "2026-03-20",
"taken": false,
"notes": "Forgot — was travelling"
}'Fields Reference
| Field | Type | Required | Notes |
patient_id | UUID | Yes | From patients table |
medication_id | INTEGER | Yes | FK to medications table |
date | DATE | Yes | Format: YYYY-MM-DD |
taken | BOOLEAN | Yes | true = taken, false = missed |
taken_at | TIMESTAMPTZ | No | Exact time taken (include timezone) |
notes | TEXT | No | Any relevant context |
Manage Medications
List Active Medications
curl -s "$SUPABASE_URL/rest/v1/medications?patient_id=eq.PATIENT_UUID&active=eq.true&select=id,name,dosage,frequency&order=name" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY"Or from DuckDB:
SELECT id, name, dosage, frequency FROM medications WHERE active = true ORDER BY nameAdd a New Medication
curl -s -X POST "$SUPABASE_URL/rest/v1/medications" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY" \
-H "Content-Type: application/json" -H "Prefer: return=representation" \
-d '{
"patient_id": "PATIENT_UUID",
"name": "Pantoprazole",
"dosage": "40mg",
"frequency": "once daily before breakfast",
"active": true
}'Deactivate a Medication (Stopped Taking)
curl -s -X PATCH "$SUPABASE_URL/rest/v1/medications?id=eq.MEDICATION_ID" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY" \
-H "Content-Type: application/json" -H "Prefer: return=representation" \
-d '{"active": false}'Update Medication Details
curl -s -X PATCH "$SUPABASE_URL/rest/v1/medications?id=eq.MEDICATION_ID" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY" \
-H "Content-Type: application/json" -H "Prefer: return=representation" \
-d '{"dosage": "20mg", "frequency": "twice daily"}'Log Daily Health Entry
Record Mood, Energy, Stress, Exercise, and Symptoms
curl -s -X POST "$SUPABASE_URL/rest/v1/daily_logs" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY" \
-H "Content-Type: application/json" -H "Prefer: return=representation" \
-d '{
"patient_id": "PATIENT_UUID",
"date": "2026-03-20",
"mood": 7,
"energy": 6,
"stress": 4,
"exercise_done": true,
"exercise_type": "running",
"exercise_minutes": 30,
"symptoms": ["bloating", "mild_headache"],
"notes": "Felt good after run. Bloating started after lunch."
}'Fields Reference
| Field | Type | Required | Notes |
patient_id | UUID | Yes | From patients table |
date | DATE | Yes | Format: YYYY-MM-DD |
mood | INTEGER | No | Scale 1-10 (1=terrible, 10=excellent) |
energy | INTEGER | No | Scale 1-10 |
stress | INTEGER | No | Scale 1-10 (1=none, 10=extreme) |
exercise_done | BOOLEAN | No | Did structured exercise today? |
exercise_type | TEXT | No | e.g., "running", "weights", "yoga", "walking" |
exercise_minutes | INTEGER | No | Duration of exercise |
symptoms | JSON (array) | No | List of symptoms as strings |
notes | TEXT | No | Free-form notes about the day |
Common Symptom Tags
Use consistent symptom names for better analysis:
bloating,nausea,acid_reflux,stomach_painheadache,mild_headache,migrainefatigue,brain_fog,poor_focusanxiety,restlessness,insomniamuscle_soreness,joint_pain,back_painpalpitations,chest_tightness
Check Medication Compliance
Compliance for a Specific Date
curl -s "$SUPABASE_URL/rest/v1/medication_logs?patient_id=eq.PATIENT_UUID&date=eq.2026-03-20&select=*,medications(name,dosage)" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY"Compliance Over Past 7 Days
SELECT ml.date,
m.name,
m.dosage,
ml.taken,
ml.taken_at,
ml.notes
FROM medication_logs ml
JOIN medications m ON ml.medication_id = m.id
WHERE ml.date >= current_date - 7
ORDER BY ml.date DESC, m.nameFind Days With Missing Logs
WITH active_meds AS (
SELECT id, name FROM medications WHERE active = true
),
date_range AS (
SELECT generate_series(
current_date - 7,
current_date,
INTERVAL '1 day'
)::DATE as date
),
expected AS (
SELECT d.date, m.id as medication_id, m.name
FROM date_range d CROSS JOIN active_meds m
),
logged AS (
SELECT date, medication_id FROM medication_logs
)
SELECT e.date, e.name as medication, 'NOT LOGGED' as status
FROM expected e
LEFT JOIN logged l ON e.date = l.date AND e.medication_id = l.medication_id
WHERE l.date IS NULL
ORDER BY e.date DESC, e.nameAdd Lab Results
Overview
You (the AI agent) can read lab reports directly. The user shares a PDF or image — you extract all values and store them in Supabase. No external OCR tool needed.
Workflow: Parse a Lab Report
Step 0: User shares the report
When the user says "I have a lab report" or "upload my blood test", ask them to:
Share the lab report as an image (screenshot or photo) or a PDF file. I'll read it and store all the values automatically.
Step 1: Read and extract
Examine the image/PDF carefully. Extract every row in the results table:
| What to extract | Where to find it |
| Report date | Header of the report |
| Lab name | Header (e.g., "Thyrocare", "SRL", "Metropolis") |
| Test package name | Header (e.g., "Aarogyam 1.8", "CBC", "Lipid Profile") |
| Each biomarker name | First column |
| Each value | Result column (numeric) |
| Unit | Unit column |
| Reference range | Normal range column |
| Status | High/Low/Normal flag, OR compare value to reference range yourself |
Step 2: Map to standard parameter names
Convert lab report parameter names to the standard names below before storing. This enables cross-report tracking over time.
| Lab report says | Store as |
| Vitamin D3 (25-OH), 25-OH Vitamin D | vitamin_d |
| Vitamin B12, Cyanocobalamin | vitamin_b12 |
| SGOT / AST | sgot_ast |
| SGPT / ALT | sgpt_alt |
| Gamma GT, GGT | ggt |
| Alkaline Phosphatase, ALP | alkaline_phosphatase |
| Total Cholesterol | total_cholesterol |
| LDL Cholesterol, LDL-C | ldl |
| HDL Cholesterol, HDL-C | hdl |
| Triglycerides | triglycerides |
| VLDL | vldl |
| Lipoprotein(a), Lp(a) | lipoprotein_a |
| HbA1c, Glycated Haemoglobin | hba1c |
| Fasting Blood Glucose, FBS | fasting_glucose |
| Serum Creatinine | creatinine |
| eGFR | egfr |
| Uric Acid | uric_acid |
| TSH | tsh |
| Free T3, fT3 | free_t3 |
| Free T4, fT4 | free_t4 |
| Haemoglobin, Hb | hemoglobin |
| WBC, Total Leucocyte Count, TLC | wbc |
| RBC | rbc |
| Platelets, Platelet Count | platelets |
| MCV | mcv |
| MCH | mch |
| MCHC | mchc |
| RDW-CV | rdw_cv |
| hs-CRP, High Sensitivity CRP | hs_crp |
| Homocysteine | homocysteine |
| Ferritin | ferritin |
| Serum Iron, Iron | iron |
| UIBC | uibc |
| Total Iron Binding Capacity, TIBC | tibc |
| Folate, Folic Acid, Vitamin B9 | vitamin_b9_folate |
| Total Bilirubin | bilirubin_total |
| Direct Bilirubin | bilirubin_direct |
| Albumin | albumin |
| Total Protein | total_protein |
| ESR | esr |
| BUN, Blood Urea Nitrogen | bun |
| Apolipoprotein B, Apo B | apo_b |
For any parameter not in this table, use snake_case of the exact lab name
(e.g., "Calcium" → calcium, "Sodium" → sodium).
Step 3: Determine status
- If the report already shows H/L/Normal flags, use those
- Otherwise compare
value_numerictoref_rangeyourself:- Below range minimum →
"low" - Above range maximum →
"high" - Within range →
"normal" - Significantly above critical threshold →
"critical_high" - Significantly below critical threshold →
"critical_low"
- Below range minimum →
Step 4: Show the user a preview before inserting
Before storing, show a table summary:
Extracted from: [Lab Name] — [Test Name] — [Date]
Parameter | Value | Unit | Range | Status
vitamin_d | 28.5 | ng/mL | 30-100 | LOW
sgpt_alt | 42 | U/L | 0-40 | HIGH
total_cholesterol | 185 | mg/dL | <200 | NORMAL
...
Store all X values? (y/n)Step 5: Insert into Supabase
Step 1: Create a Lab Report Entry
curl -s -X POST "$SUPABASE_URL/rest/v1/lab_reports" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY" \
-H "Content-Type: application/json" -H "Prefer: return=representation" \
-d '{
"patient_id": "PATIENT_UUID",
"report_date": "2026-03-15",
"lab": "Thyrocare",
"test_name": "Aarogyam 1.8",
"source_file": "lab-reports/2026-03-15_thyrocare_aarogyam.pdf"
}'Save the returned id — you need it as report_id for individual results.
Step 2: Insert Lab Results
curl -s -X POST "$SUPABASE_URL/rest/v1/lab_results" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY" \
-H "Content-Type: application/json" -H "Prefer: return=representation" \
-d '[
{
"report_id": REPORT_ID,
"category": "vitamin",
"parameter": "vitamin_d",
"value_numeric": 28.5,
"value_text": null,
"unit": "ng/mL",
"ref_range": "30-100",
"status": "low",
"interpretation": "Below optimal range",
"method": null,
"metadata": null
},
{
"report_id": REPORT_ID,
"category": "liver",
"parameter": "sgpt_alt",
"value_numeric": 42,
"value_text": null,
"unit": "U/L",
"ref_range": "0-40",
"status": "high",
"interpretation": "Mildly elevated",
"method": null,
"metadata": null
}
]'Important: When batch inserting, ALL objects must have identical keys (include null for missing fields). Supabase PostgREST requires this.
Lab Result Fields Reference
| Field | Type | Required | Notes |
report_id | UUID | Yes | FK to lab_reports |
category | TEXT | Yes | e.g., "vitamin", "liver", "lipid", "thyroid", "cbc", "metabolic", "cardiac" |
parameter | TEXT | Yes | Use consistent names (see below) |
value_numeric | NUMERIC | Conditional | Numeric result — use this for numbers |
value_text | TEXT | Conditional | Text result — use for non-numeric values like "Reactive" |
unit | TEXT | No | e.g., "ng/mL", "U/L", "mg/dL" |
ref_range | TEXT | No | e.g., "30-100", "<40" |
status | TEXT | Yes | "normal", "low", "high", "critical_low", "critical_high" |
interpretation | TEXT | No | Brief interpretation |
method | TEXT | No | Lab method used |
metadata | JSON | No | Any additional data |
Standard Parameter Names
Use these consistent parameter names for cross-report tracking:
| Category | Parameters |
| Vitamins | vitamin_b12, vitamin_d, vitamin_b9_folate, iron, ferritin |
| Liver | sgot_ast, sgpt_alt, ggt, alkaline_phosphatase, bilirubin_total, bilirubin_direct, albumin, total_protein |
| Lipids | total_cholesterol, ldl, hdl, triglycerides, vldl, lipoprotein_a, apo_b |
| Thyroid | tsh, t3, t4, free_t3, free_t4 |
| CBC | hemoglobin, wbc, rbc, platelets, mcv, mch, mchc, rdw_cv, rdw_sd |
| Metabolic | hba1c, fasting_glucose, uric_acid, creatinine, bun, egfr |
| Cardiac | hs_crp, homocysteine, nt_pro_bnp, troponin |
| Inflammation | esr, hs_crp |
Upload Lab Report PDF to Storage (Optional)
Requires a health-reports bucket in Supabase Storage. Create it in the Supabase dashboard (Storage → New bucket → name: health-reports, private). This is optional — the core lab report workflow extracts values directly from images/PDFs without storage.
# Upload to Supabase Storage
curl -s -X POST "$SUPABASE_URL/storage/v1/object/health-reports/lab-reports/2026-03-15_thyrocare_aarogyam.pdf" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY" \
-H "Content-Type: application/pdf" --data-binary @/path/to/report.pdfGet a Signed URL for a Lab Report
curl -s -X POST "$SUPABASE_URL/storage/v1/object/sign/health-reports/lab-reports/2026-03-15_thyrocare_aarogyam.pdf" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY" \
-H "Content-Type: application/json" -d '{"expiresIn": 3600}'Log Weight
Manual Weight Entry
curl -s -X POST "$SUPABASE_URL/rest/v1/daily_weight" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY" \
-H "Content-Type: application/json" -H "Prefer: return=representation" \
-d '{
"patient_id": "PATIENT_UUID",
"source": "manual",
"date": "2026-03-20",
"weight_kg": 72.5,
"bmi": null,
"body_fat_pct": null
}'Track Weight Over Time
SELECT date, weight_kg, source
FROM daily_weight
ORDER BY date DESC LIMIT 30Viewing Logged Data
Recent Daily Logs
SELECT date, mood, energy, stress,
exercise_done, exercise_type, exercise_minutes,
symptoms, notes
FROM daily_logs
ORDER BY date DESC LIMIT 7All Flagged Lab Results
curl -s "$SUPABASE_URL/rest/v1/lab_results?select=id,report_id,category,parameter,value_numeric,value_text,unit,ref_range,status,lab_reports(report_date,lab)&status=neq.normal&order=report_id" \
-H "apikey: $SUPABASE_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_SERVICE_KEY"Or from DuckDB:
SELECT lr.parameter, lr.value_numeric, lr.unit, lr.ref_range, lr.status,
rep.report_date, rep.lab
FROM lab_results lr
JOIN lab_reports rep ON lr.report_id = rep.id
WHERE lr.status != 'normal'
ORDER BY rep.report_date DESC, lr.category, lr.parameterTrack a Specific Biomarker Across Reports
SELECT lr.value_numeric, lr.unit, lr.status, lr.ref_range,
rep.report_date, rep.lab
FROM lab_results lr
JOIN lab_reports rep ON lr.report_id = rep.id
WHERE lr.parameter = 'vitamin_d'
ORDER BY rep.report_dateKey biomarkers to track longitudinally: vitamin_b12, vitamin_d, sgot_ast, sgpt_alt, ldl, hba1c, hs_crp, lipoprotein_a, rdw_cv, homocysteine.
After Storing: Offer Analysis
After inserting a lab report, always offer to analyse it:
I've stored all [N] values from your [Lab Name] report.
Flagged results:
- [parameter]: [value] [unit] — [HIGH/LOW] (range: [ref_range])
- ...
Would you like me to:
- Compare these to your previous reports (if any)?
- Cross-reference with your Fitbit data (e.g., elevated liver enzymes + high RHR)?
- Flag anything that needs medical attention?
Use the /health-analysis skill to run the correlation analysis.
After Logging: Sync to Local DuckDB
After inserting data via Supabase, pull it to your local DuckDB for analysis:
# Pull latest data
phf pullThis ensures the health-analysis skill has access to the latest logged data.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

