This project is a Bayesian analysis of Garmin health data using Stan.
Use two complementary systems for tracking work:
Good for: task lists, progress tracking, user visibility
.claude-current-status file (supplementary) - Higher-resolution notes
Workflow: Start tasks with TodoWrite, always add detailed notes to .claude-current-status. When you add notes, re-assess and clean up old notes.
Status Management Commands:
- /continue - Efficiently resume work by extracting recent session context
- /condense [N] - Archive old content, keep last N lines (default: 200)
- scripts/status-helper.sh - Auto-cleanup helper for updates
Auto-Cleanup Pattern: When updating .claude-current-status, check if file exceeds 300 lines and consider running /condense.
Goal: Build a personal health analytics system with: 1. Bayesian models in Stan for analyzing Garmin data (weight, sleep, activity, etc.) 2. Interactive D3.js visualizations for exploring health relationships 3. A web interface for exploring model results and data trends
CRITICAL: Always use these tools for their respective domains:
uv for Python package management and executionuv add <package> - Add dependenciesuv run python script.py - Run Python scriptsuv sync - Sync dependenciespython or pip commandsNote: When running analysis scripts, you may see a warning about VIRTUAL_ENV mismatch if an external conda environment is active. This warning can be ignored as uv uses the project's .venv.
JavaScript/Node: Use npm for package management
npm install - Install dependenciesnpm run <script> - Run scripts
Stan: Use CmdStanPy for Stan model compilation and sampling
stan/ directory with .stan extensionGarmin export data is in data/DI_CONNECT/:
- DI-Connect-Wellness/ - Biometrics, sleep, heart rate, nutrition
- DI-Connect-Fitness/ - Activities, workouts, personal records
- DI-Connect-Aggregator/ - Daily summaries (UDS files), hydration
- DI-Connect-Metrics/ - VO2 max, training metrics
Important: The data/ directory contains personal health data and is gitignored.
garmin-analysis-v2/
├── data/ # Garmin export data (gitignored)
├── stan/ # Stan model files
├── src/ # Python analysis code
│ ├── data/ # Data loading utilities
│ ├── models/ # Model fitting code
│ └── analysis/ # Analysis scripts
├── web/ # D3.js visualization (future)
└── notebooks/ # Jupyter notebooks for exploration
RECOMMENDED: Use Test-Driven Development for new features
ALWAYS use date command for dates - Never assume or guess dates. Always run date "+%Y-%m-%d" when you need the current date for documentation, commits, or any other purpose.
CRITICAL: This is a Bayesian analysis project, not frequentist/NHST:
We do NOT do null hypothesis significance testing (NHST) - Avoid phrases like "statistically significant", "p-value", "reject the null", etc.
We work with posterior distributions - Report posterior means, credible intervals (e.g., 90% or 95% CI), and visualize full posterior distributions.
We interpret credible intervals - A 95% credible interval means there's a 95% probability the parameter lies within that interval given the data and prior.
We consider practical significance - Not just whether an interval excludes zero, but the magnitude and practical importance of effects.
We acknowledge uncertainty - Report full posterior distributions, not just point estimates.
We use priors transparently - Document priors and conduct sensitivity analyses when priors might influence results.
We compare models - Use tools like WAIC, LOO-CV, or Bayes factors for model comparison, not p-values.
Correct terminology: - Use "credible interval" not "confidence interval" - Use "posterior probability" not "p-value" - Use "model comparison" not "hypothesis testing" - Use "practical importance" not "statistical significance"
CRITICAL: Always provide honest, objective recommendations based on technical merit, not user bias.
/hygiene - Project health check/commit - Quality-checked commits/tdd - Test-driven development workflow/learn - Capture insights/docs - Update documentationCRITICAL: Follow these visualization guidelines:
Static plots: Use matplotlib/seaborn for Python-generated static images
Organization Principles:
docs/ subdirectoriesCRITICAL: All HTML pages MUST include Simple Analytics tracking.
The tracking script is configured in docs/convert_to_html.py HTML template:
<script async src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
When generating or modifying HTML:
- Always ensure this script is present in the <head> section of the template
- Run npm run generate-docs to rebuild all HTML files
- Verify tracking is present: grep -r "simpleanalyticscdn" docs/