Files
mop-skills/skills/datastore-nutrition-logging/SKILL.md
T

23 lines
1.6 KiB
Markdown

---
name: "datastore-nutrition-logging"
description: "Log nutrition intake via datastore CLI; verify kind and repair mis-parsed events."
---
# Datastore Nutrition Logging
Log consumed food to the datastore CLI and repair events that landed under the wrong kind.
## Steps
1. Log an item: run
`uv run /home/node/mop-skills/mop-skills/skills/datastore/scripts/datastore.py add nutrition.intake --subject <person> --actor agent:koch --payload '{"item": "...", "qty": 250, "unit": "g", "protein_g": 7.5, "carbs_g": 87.5, "fat_g": 27.5, "kcal": 625.0}' --estimated`
Pass `nutrition.intake` as the positional argument and `--estimated` as a bare flag with no value. Done when the response contains `feedback.day_total_formatted`.
2. Verify the kind: run
`... datastore.py query "SELECT id, kind, start, payload FROM events WHERE subject='<person>' AND start >= '<YYYY-MM-DD>'"`.
Done when the new event shows `kind = "nutrition.intake"`. If it shows another kind (e.g. `"true"`), a flag value was parsed as the positional kind.
3. Repair a mis-kinded event: delete its line from `/home/node/.openclaw/wiki/main/data/events/<wrong-kind>/YYYY-MM.jsonl`, remove the now-empty `<wrong-kind>/` directory, then re-run step 1. Done when step 2 passes.
4. Refresh the read-only views: run
`PYTHONPATH=/home/node/mop-skills/mop-skills/skills/datastore/scripts uv run /home/node/mop-skills/mop-skills/skills/datastore/scripts/render_views.py`.
Done when it prints the rendered nutrition-log paths.
5. Report the day total from `feedback.day_total_formatted`; never compute macros by hand.