[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-92367":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":10,"languages":10,"totalLinesOfCode":10,"stars":11,"forks":12,"watchers":11,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":13,"stars30d":13,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":14,"rankGlobal":10,"rankLanguage":10,"license":15,"archived":16,"fork":16,"defaultBranch":17,"hasWiki":18,"hasPages":16,"topics":19,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":13,"starSnapshotCount":13,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},92367,"healthcare-ai-agent-vault","h1papc11\u002Fhealthcare-ai-agent-vault","h1papc11","ai agent healthcare vault for family that combines Obsidian templates, AI prompt workflows, and a TypeScript preprocessing pipeline for Apple Health exports","",null,152,1165,0,49.2,"MIT License",false,"main",true,[20,21,22,23,24,25,26,27,28,29],"agent-vault","ai-agent","ai-healthcare","health-agent","health-ai-agent","health-vault","health-vault-agent","healthcare-agent","healthcare-vault","healthcare-vault-agent","2026-07-22 04:02:05","# AI Health Vault\n\nA local-first family health archive that combines Obsidian templates, AI prompt workflows, and a TypeScript preprocessing pipeline for Apple Health exports.\n\nYour health data stays on your machine. AI assists with structuring and analysis — you control what leaves your device.\n\n---\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Features](#features)\n- [Architecture](#architecture)\n- [Workflows](#workflows)\n- [Project Structure](#project-structure)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Development](#development)\n- [Testing](#testing)\n- [Troubleshooting](#troubleshooting)\n- [Contributing](#contributing)\n- [FAQ](#faq)\n- [License](#license)\n\n---\n\n## Overview\n\nAI Health Vault is designed for families who want structured health records without surrendering privacy to commercial apps. Clone the repository, open the Obsidian vault, and use included prompts or Claude Code skills to transform photos, PDFs, and wearable exports into organized Markdown and CSV files.\n\nVersion 2 adds a production TypeScript runtime with strict typing, optional Redis-backed export job caching, structured logging, and a full build\u002Flint\u002Ftest pipeline.\n\n---\n\n## Features\n\n| Capability | Description |\n|------------|-------------|\n| **Obsidian vault templates** | Hub pages, member archives, tracking CSVs, and field standards |\n| **Eight AI workflows** | Checkup extraction, medication recognition, trend analysis, visit prep, Apple Watch analysis, family-friendly summaries, follow-up calendar, daily health plan |\n| **Claude Code skills** | Auto-loaded skill definitions mirroring the prompt library |\n| **Apple Health preprocessor** | Streaming XML\u002FZIP parser that splits large exports into typed CSV files |\n| **Optional Redis cache** | Persists export job metadata for repeated preprocessing runs |\n| **Strict TypeScript** | Typed services, validated configuration, and comprehensive unit tests |\n\n---\n\n## Architecture\n\n```mermaid\nflowchart TB\n    subgraph Inputs\n        A[Photos \u002F PDFs]\n        B[Apple Health Export]\n        C[Manual Notes]\n    end\n\n    subgraph Processing\n        D[AI Prompts & Skills]\n        E[Apple Health CLI]\n        F[(Redis Cache)]\n    end\n\n    subgraph Storage\n        G[Obsidian Vault]\n        H[CSV Tracking Files]\n    end\n\n    A --> D\n    B --> E\n    C --> G\n    D --> G\n    E --> H\n    E -. optional .-> F\n    G --> H\n```\n\n### Component Layers\n\n```mermaid\nflowchart LR\n    subgraph Application\n        CLI[CLI Entry Point]\n        SVC[Apple Health Service]\n        CFG[Config Module]\n        LOG[Structured Logger]\n    end\n\n    subgraph Persistence\n        REDIS[Connection Manager]\n        CACHE[Export Job Cache]\n    end\n\n    CLI --> CFG\n    CLI --> SVC\n    CLI --> REDIS\n    SVC --> LOG\n    REDIS --> CACHE\n    SVC --> CACHE\n```\n\n---\n\n## Workflows\n\n### New user setup\n\n```mermaid\nflowchart TD\n    A[Clone repository] --> B[Open vault\u002F in Obsidian]\n    B --> C[Add family members to hub page]\n    C --> D[Capture health document]\n    D --> E[Send to AI with prompt or skill]\n    E --> F[Paste structured output into vault]\n    F --> G{More records?}\n    G -->|Yes| D\n    G -->|No| H[Review trends in tracking CSVs]\n```\n\n### Apple Health import\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant CLI as Preprocessor CLI\n    participant Parser as SAX Parser\n    participant Redis as Redis Cache\n    participant Vault as Obsidian Vault\n\n    User->>CLI: export.zip + output directory\n    CLI->>Redis: Check cached job (optional)\n    alt Cache hit\n        Redis-->>CLI: Completed job metadata\n    else Cache miss\n        CLI->>Parser: Stream XML records\n        Parser-->>CLI: Typed CSV files\n        CLI->>Redis: Store job result (optional)\n    end\n    User->>Vault: Attach CSV summaries to member archive\n```\n\n---\n\n## Project Structure\n\n```\nai-health-vault\u002F\n├── src\u002F\n│   ├── cli\u002F                  # Command-line entry points\n│   ├── config\u002F               # Environment configuration (Zod-validated)\n│   ├── errors\u002F               # Typed application errors\n│   ├── logging\u002F              # Structured JSON logger\n│   ├── redis\u002F                # Connection manager and export job cache\n│   └── services\u002F\n│       └── apple-health\u002F     # Streaming preprocessor implementation\n├── tests\u002F\n│   ├── fixtures\u002F             # Sample Apple Health XML\n│   └── unit\u002F                 # Vitest unit tests\n├── vault\u002F                    # Obsidian vault template\n├── prompts\u002F                  # Portable AI prompt library\n├── .claude\u002Fskills\u002F           # Claude Code skill definitions\n├── guides\u002F                   # Setup guides and FAQ\n└── docs\u002Finternal\u002F            # Engineering audit notes\n```\n\n**Design decisions**\n\n- `src\u002Fservices\u002F` holds domain logic; infrastructure lives in `src\u002Fredis\u002F`, `src\u002Fconfig\u002F`, and `src\u002Flogging\u002F`.\n- Content assets (`vault\u002F`, `prompts\u002F`, `.claude\u002F`) remain separate from application code.\n- Tests mirror the `src\u002F` layout under `tests\u002Funit\u002F`.\n\n---\n\n## Installation\n\n### Prerequisites\n\n- [Node.js](https:\u002F\u002Fnodejs.org\u002F) 20 or later\n- [Obsidian](https:\u002F\u002Fobsidian.md\u002F) (recommended for vault management)\n- [Redis](https:\u002F\u002Fredis.io\u002F) 6+ (optional, for export job caching)\n\n### Setup\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Frunesleo\u002Fai-health-vault.git\ncd ai-health-vault\nnpm install\ncp .env.example .env\n```\n\nBuild and verify:\n\n```bash\nnpm run validate\n```\n\nOpen the vault:\n\n1. Launch Obsidian → **Open folder as vault**\n2. Select the `vault\u002F` directory\n3. Edit `健康管理中心.md` with your family member names\n\n---\n\n## Configuration\n\nCopy `.env.example` to `.env` and adjust values:\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `LOG_LEVEL` | `info` | Logging verbosity: `debug`, `info`, `warn`, `error` |\n| `REDIS_ENABLED` | `false` | Enable Redis-backed export job caching |\n| `REDIS_URL` | — | Redis connection URL (required when enabled) |\n| `REDIS_KEY_PREFIX` | `ai-health-vault:` | Key namespace prefix |\n| `REDIS_MAX_RETRIES` | `10` | Maximum connection retry attempts |\n| `REDIS_CONNECT_TIMEOUT_MS` | `10000` | Connection timeout in milliseconds |\n| `REDIS_JOB_TTL_SECONDS` | `86400` | Export job cache TTL (24 hours) |\n\n### Apple Health preprocessor\n\n```bash\n# Development (tsx)\nnpm run preprocess -- --input \u002Fpath\u002Fto\u002Fexport.xml --output .\u002Fcsv-output\n\n# Production build\nnpm run build\nnpx apple-health-preprocess --input export.zip --output .\u002Fcsv-output --types heart_rate,step_count\n```\n\nSupported output types: `heart_rate`, `resting_heart_rate`, `walking_heart_rate_average`, `heart_rate_variability_sdnn`, `oxygen_saturation`, `vo2max`, `step_count`, `sleep_analysis`, `workouts`.\n\n---\n\n## Development\n\n```bash\n# Type check\nnpm run typecheck\n\n# Lint\nnpm run lint\nnpm run lint:fix\n\n# Format\nnpm run format:fix\n\n# Run tests in watch mode\nnpm run test:watch\n\n# Full validation pipeline\nnpm run validate\n```\n\n### Adding a new health workflow\n\n1. Create a prompt file in `prompts\u002F`\n2. Add a matching skill in `.claude\u002Fskills\u002F`\n3. Update the vault hub page with workflow instructions\n4. Document field mappings in `vault\u002F知识库\u002F推荐字段标准.md`\n\n---\n\n## Testing\n\n```bash\nnpm test\n```\n\nTest suites cover:\n\n- Apple Health type parsing and CSV generation\n- Output directory safety checks\n- Redis export job cache read\u002Fwrite operations\n- Redis connection manager configuration guards\n\nRun the full pipeline before submitting changes:\n\n```bash\nnpm run validate\n```\n\n---\n\n## Troubleshooting\n\n### Preprocessor reports \"Output directory must be empty\"\n\nThe CLI refuses to write into a directory that already contains files. Provide a new path or clear the target directory first.\n\n### Redis connection failures\n\n1. Confirm Redis is running: `redis-cli ping` should return `PONG`\n2. Verify `REDIS_URL` matches your instance\n3. Set `REDIS_ENABLED=false` to run without caching\n\n### TypeScript build errors after dependency updates\n\n```bash\nrm -rf node_modules dist\nnpm install\nnpm run validate\n```\n\n### AI output does not match vault field standards\n\nRefer to `vault\u002F知识库\u002F推荐字段标准.md` and include it as context when prompting your AI assistant.\n\n### Windows path issues\n\nUse forward slashes or quoted paths:\n\n```bash\nnpm run preprocess -- --input \"D:\u002Fexports\u002Fexport.xml\" --output \".\u002Foutput\"\n```\n\n---\n\n## Contributing\n\n1. Fork the repository and create a feature branch\n2. Run `npm run validate` before committing\n3. Keep commits focused and write descriptive messages\n4. Update documentation when changing user-facing behavior\n5. Open a pull request with a clear summary and test plan\n\nSee [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) and [SECURITY.md](SECURITY.md) for community and security guidelines.\n\n---\n\n## FAQ\n\n**Do I need Redis?**\nNo. Redis is optional and only caches export job metadata.\n\n**Which AI tools work?**\nAny model that accepts text prompts: Claude, ChatGPT, Gemini, or local models via Ollama or LM Studio.\n\n**Is my data sent to the cloud?**\nOnly if you paste it into a cloud AI service. The vault itself is local Markdown and CSV.\n\n**Can I use this without Obsidian?**\nYes. Prompts, skills, and CSV outputs work with any editor.\n\n**Where is the detailed setup guide?**\nSee [guides\u002F快速开始.md](guides\u002F快速开始.md) and [guides\u002FFAQ.md](guides\u002FFAQ.md).\n\n---\n\n## License\n\n[MIT](LICENSE) — Copyright (c) Leo ([@runes_leo](https:\u002F\u002Fx.com\u002Frunes_leo))\n","AI Health Vault 是一个面向家庭的本地化健康数据管理工具，将 Apple Health 导出数据、手动健康记录与 AI 辅助分析整合到 Obsidian 知识库中。核心功能包括：基于 TypeScript 的 Apple Health XML\u002FZIP 流式解析与结构化 CSV 转换、8 类预置 AI 工作流（如用药识别、体检报告提取、趋势分析）、Obsidian 模板驱动的家庭成员档案与跟踪看板，以及可选 Redis 缓存支持。所有处理均在本地完成，保障隐私安全。适用于注重数据主权的家庭健康归档、慢性病日常管理、多成员健康协同跟踪等场景。",2,"2026-07-08 04:30:11","CREATED_QUERY"]