Multi-service nutrition comparison
Use this reference when a persisted nutrition item should be analyzed through the multi-service comparison workflow.
Current rule (hard - no exceptions)
Every live athlete nutrition intake item must go through scripts/process_nutrition_intake.py. This applies to every item regardless of complexity, photo presence, or estimated effort. Do not selectively skip a configured service. Do not manually write comparison blocks.
Shared prompt rule
The local analysis path and the Claude CLI path should both use:
team/nutrition/nutrition-analysis-prompt.md
That prompt is the shared contract for:
- food identification
- observed evidence
- portion estimates
- total calories, protein, carbohydrate, and fat
- assumptions
- uncertainty notes
The purpose is to keep the local and Claude outputs structurally aligned so the comparison table reflects service differences rather than prompt-format differences.
Raw output archive
Store raw multi-service artifacts under:
athlete/data/nutrition-analysis/raw/YYYY-MM-DD/
Recommended file set per item:
item-XX-local.mditem-XX-claude-cli.mditem-XX-normalized.jsonitem-XX-comparison.md
Current helper script
Use:
scripts/nutrition_multi_service_pipeline.py
Configuration lives in:
team/nutrition/nutrition-analysis-config.json
The script should be configured through workspace-relative config values or explicit CLI arguments, not machine-specific hard-coded paths.
It currently supports:
- reading a local prompt-format markdown analysis
- running Claude CLI with the shared prompt and optional local image path
- normalizing the returned outputs
- producing a comparison block and aggregate estimate
Example command
python3 scripts/nutrition_multi_service_pipeline.py \
--text "Bagel with peanut butter and jam" \
--image athlete/logs/media/2026-04-22/item-01.jpg \
--photo-description "bagel halves with peanut butter and jam on a plate" \
--local-markdown athlete/data/nutrition-analysis/raw/2026-04-22/item-01/item-01-local.md \
--raw-dir athlete/data/nutrition-analysis/raw/2026-04-22/item-01 \
--output-json athlete/data/nutrition-analysis/raw/2026-04-22/item-01/item-01-normalized.json \
--output-markdown athlete/data/nutrition-analysis/raw/2026-04-22/item-01/item-01-comparison.md
Daily-log write rule
When multi-service analysis exists, add these fields to the nutrition item in the canonical daily log:
Photo descriptionAnalysis services used#### Macro comparison#### Service notes#### Aggregate estimate
Keep the main item template intact, then append the comparison block below the base item table.