healthflow-data-refresh

Refresh healthflow_data.db from public sources with atomic writes.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/saikamara59/health-insurance-agent --skill healthflow-data-refresh
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: healthflow-data-refresh
Source: https://github.com/saikamara59/health-insurance-agent/tree/main/.claude/skills/healthflow-data-refresh
Command: npx skills add https://github.com/saikamara59/health-insurance-agent --skill healthflow-data-refresh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It standardizes how real public health datasets are fetched, cached, validated, and loaded into healthflow_data.db so updates don’t break the platform or silently corrupt cached results.

Core Features & Use Cases

  • Layered fetch → cache → seed fallback: Implements a reliable ladder that logs degraded states and falls back to SEED_X when downloads fail.
  • Deterministic fetcher contract: Enforces that download_x returns None on any failure (no raising), guards missing env tokens, and uses controlled httpx timeouts.
  • Cache correctness for JSON round-trips: Prevents tuple/set semantic bugs by explicitly handling rehydrated list/tuple/set behavior after cache load.
  • Atomic database builds: Writes via a temporary SQLite path and final os.replace to avoid partial-update corruption.

Quick Start

Ask the AI to review a new public-data fetcher you added to scripts/refresh_data.py and verify it follows the SEED, download_x, cache TTL, fallback, JSON round-trip, and atomic build rules.

Frequently Asked Questions about healthflow-data-refresh

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refresh health data from public APIs without corrupting the SQLite database?▼

To safely refresh health data, implement atomic database writes using a temporary SQLite path and os.replace, preventing partial-update corruption. Combine this with a layered fetch, cache, and seed fallback strategy for reliable ETL pipelines.

What is the best way to handle HTTP fetch failures in a Python ETL pipeline?▼

The best way to handle HTTP fetch failures in an ETL pipeline is enforcing a deterministic fetcher contract where download functions return None on any failure. This is paired with guarded environment tokens, controlled httpx timeouts, and a SEED fallback mechanism.

Why does my cached JSON data change types when reloaded in Python?▼

Cached JSON data changes types because JSON serialization loses tuple and set semantics, converting them to lists. Ensuring cache correctness requires explicitly handling JSON round-trips to restore the intended list, tuple, or set behavior upon data rehydration.

Can I use httpx to fetch public health datasets with a seed fallback?▼

Yes, you can use httpx to fetch public health datasets by configuring controlled timeouts and a layered fallback strategy. If the httpx download fails, the pipeline logs the degraded state and safely loads SEED data to maintain operations.

How do I implement TTL caching for public health API responses?▼

To implement TTL caching for API responses, use a load-or-fetch mechanism that checks cache age before making HTTP requests. This reduces external API calls and provides a valid cached layer when network fetches fail before falling back to seeds.

What are the limitations of using atomic writes with SQLite for health data ingestion?▼

A limitation of atomic writes with SQLite is the requirement for temporary file handling and sufficient disk space for the .tmp file. This approach prevents partial database updates but requires careful path management during the os.replace operation.