Initial meal-suggestion skill (logic + template; live data git-ignored)

This commit is contained in:
jp
2026-08-26 02:55:33 +01:00
commit 72ce56edeb
10 changed files with 464 additions and 0 deletions

View File

@ -0,0 +1,32 @@
# Where to Shop — Eastbourne (value research, 2026)
User is in Eastbourne. Local options: Lidl, Sainsbury's, Co-op, Tesco Express
(closest), and a local Londis (milk 2L £1.40). Memberships: Tesco Clubcard, Co-op member.
## Price index (Which? 2026, ~93-item standard basket; Lidl = £160.70 baseline)
| Supermarket | Basket | vs Lidl | Notes |
|---|---|---|---|
| Lidl | £160.70 | 1.00x | Cheapest discounter; furthest from user |
| Tesco (Clubcard) | £188.45 | 1.17x | Clubcard Prices = real discount |
| Sainsbury's (Nectar) | £187.86 | 1.17x | Mid; Nectar needed for this price |
| Tesco Express | ~£196203 | ~1.221.26x | Superstore + convenience premium; Clubcard applies |
| Co-op | ~£209+ | ~1.30x | Membership = annual dividend, not instant |
| Londis | varies | ~1.251.35x | Milk cheap (£1.40/2L); full basket pricier |
## Multipliers used for per-store estimates in the weekly email
- Lidl: 1.00
- Tesco Express (Clubcard): 1.22
- Sainsbury's (Nectar): 1.17
- Co-op (member): 1.30 (dividend softens over the year, not at till)
- Londis: 1.30 indicative, flagged rough
## Recommendation logic (single shop)
- Default: **Tesco Express** — closest to user + Clubcard Prices narrow the gap.
Pragmatic given limited mobility during burns recovery.
- If user prioritises price over proximity: **Lidl** (~£6 cheaper on a ~£28 list).
- Co-op only if already there for something else; Londis for milk/top-ups.
## Why proximity matters here
User is a recovering burns victim — a long trip to Lidl may not be feasible daily/weekly.
The ~1722% price premium of Tesco Express is often worth the saved trip. The email
states this trade-off explicitly so he can choose.

View File

@ -0,0 +1,44 @@
# HTML Email Template (inline CSS, mobile-friendly)
Copy this scaffold, fill the meal sections, and save to `/tmp/meal_today.html`
(or `/tmp/meal_shop.html` for the weekly list) before sending.
```html
<!DOCTYPE html>
<html lang="en">
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"></head>
<body style="margin:0;padding:0;background:#f4f6f8;font-family:-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;color:#1f2933;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:#f4f6f8;padding:16px 0;">
<tr><td align="center">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="max-width:600px;background:#ffffff;border-radius:12px;overflow:hidden;box-shadow:0 1px 4px rgba(0,0,0,0.08);">
<tr><td style="background:#0f766e;padding:20px 24px;color:#ffffff;">
<h1 style="margin:0;font-size:20px;">Your Meals for Today</h1>
<p style="margin:4px 0 0;font-size:13px;opacity:0.9;">Tuesday, 25 August 2026 · high-protein · no red meat</p>
</td></tr>
<tr><td style="padding:20px 24px;">
<!-- MEAL 1 -->
<div style="border:1px solid #e4e7eb;border-radius:10px;padding:16px;margin-bottom:16px;">
<h2 style="margin:0 0 6px;font-size:17px;color:#0f766e;">🍽 Lunch — Meal Name</h2>
<p style="margin:0 0 8px;font-size:14px;color:#52606d;"><strong>Ingredients:</strong> 3 eggs, 100g spinach, 1 tbsp olive oil</p>
<p style="margin:0;font-size:14px;color:#3e4c59;line-height:1.5;"><strong>Method:</strong> 1) … 2) … 3) …</p>
</div>
<!-- MEAL 2 -->
<div style="border:1px solid #e4e7eb;border-radius:10px;padding:16px;margin-bottom:16px;">
<h2 style="margin:0 0 6px;font-size:17px;color:#0f766e;">🍽 Dinner — Meal Name</h2>
<p style="margin:0 0 8px;font-size:14px;color:#52606d;"><strong>Ingredients:</strong></p>
<p style="margin:0;font-size:14px;color:#3e4c59;line-height:1.5;"><strong>Method:</strong> 1) … 2) …</p>
</div>
</td></tr>
<tr><td style="background:#fafbfc;padding:14px 24px;border-top:1px solid #e4e7eb;font-size:12px;color:#7b8794;">
Reply to tell me what you used and I'll update the inventory. — your meal agent
</td></tr>
</table>
</td></tr>
</table>
</body>
</html>
```
For the **weekly shopping list**, replace the meal cards with a table:
`Item | Est. price | Running total`, a `Total: £XX.XX` row, and a one-line note on
what it covers (protein-first). Keep the same header/footer style.

View File

@ -0,0 +1,38 @@
# Meal-history logger (used by the daily job)
After composing the two meals (lunch + dinner) and BEFORE sending the email, the daily
job must record them into `meal-history.json` (same skill dir) so the user can later say
"remove <day>'s <meal> from inventory" and have precise items deducted.
## Entry shape
```json
{
"date": "2026-08-27",
"weekday": "Thursday",
"meal": "lunch" | "dinner",
"name": "Human-readable meal name",
"items": [ { "name": "Name as in inventory.json", "qty": 1, "unit": "count" }, ... ]
}
```
## Rules
- UPSERT: if an entry with the same `date`+`meal` already exists, replace it (don't
duplicate on re-runs).
- PRUNE: drop any entry whose `date` is more than 7 days before today (keep a true
rolling 7-day window).
- Log ONLY substantive food items actually used in that meal — enough to decrement
inventory accurately. Do NOT log pure condiments (olive oil, salt, pepper, spices,
garlic, soy sauce, miso, honey, etc.) and do NOT log the optional "third hit" snack.
- Item `name` values should match `inventory.json` names closely (case-insensitive match
on removal) so removal works: e.g. "Chicken breast", "Eggs", "Tinned tuna in veg oil",
"Dried red lentils", "Sweet potatoes", "Aubergine", "Red cabbage", "Green pesto",
"Leeks", "Orange bell pepper", "Cooked beetroot", "Microwave rice", "Cheese", etc.
- Use units consistent with inventory.json (count / g / can / portion / pieces / jar).
For a half-item use 0.5 (e.g. half a sweet potato = qty 0.5 unit "count").
- Bump the top-level file with no extra schema — keep the `entries` array only.
- This does NOT modify inventory.json (that only happens on explicit user removal).
## Example
Composed lunch "Chicken & Pesto Roast Veg Bowl" using chicken breast (1), sweet potato
(½), aubergine (½), red cabbage (150 g), green pesto (1 tbsp ≈ 0.1 jar) → record those
five items under meal "lunch" for today's date/weekday.

View File

@ -0,0 +1,43 @@
# Allowed Protein Sources (no red meat)
High-protein foods to favor, with rough protein density and typical cheap UK buys.
Use these when suggesting meals and when building the weekly shopping list.
## Animal (non-red-meat)
- Eggs — ~13g protein each; cheapest protein there is. Buy 1215 packs.
- Chicken breast / thigh — ~30g per 100g raw. Buy 500g1kg trays.
- Turkey breast / mince — lean, ~29g per 100g.
- White fish (cod, haddock, basa) — ~20g per 100g; frozen fillets are cheap.
- Salmon (fresh or tinned) — ~2025g per 100g; tinned in spring water is budget-friendly.
- Tinned tuna — ~25g per 100g drained; ~£1/can.
- Prawns — ~20g per 100g; frozen raw prawns often <£3/300g.
- Quark / cottage cheese — ~1214g per 100g; very cheap per gram.
- Greek yogurt (0%/low fat) — ~10g per 100g; buy large tubs.
- Skim milk / semi-skimmed — ~3.4g per 100ml.
- Whey protein powder — ~25g per scoop; good staple for hitting targets.
## Plant
- Tofu (firm) — ~1217g per 100g; ~£1.50/block.
- Tempeh — ~19g per 100g.
- Edamame (frozen) — ~11g per 100g.
- Lentils (dry or tinned) — ~9g per 100g cooked; very cheap.
- Chickpeas (tinned) — ~8g per 100g; ~50p/can.
- Beans (kidney/black/butter) — ~8g per 100g; ~50p/can.
- Peanut butter (no added sugar) — ~25g per 100g; cheap calorie+protein.
## Example pairings (per meal)
- Eggs + Greek yogurt + spinach/peppers (omelette + side).
- Chicken + lentils + veg (stir-fry / bowl).
- Tofu + edamame + rice/quinoa (buddha bowl).
- Tinned tuna + cottage cheese + salad.
- Salmon + boiled eggs + greens.
- Whey shake + banana + peanut butter (snack/breakfast).
- Prawns + chickpeas + tomato (stew).
- Turkey mince + beans + tinned tomatoes (chilli).
## Rough UK prices (guide for the £30 list)
Eggs (12) ~£2.20 · Chicken 1kg ~£4.50 · Greek yogurt 500g ~£1.50 ·
Cottage cheese 300g ~£1.20 · Tofu 396g ~£1.50 · Lentils 500g ~£1.00 ·
Tinned tuna x2 ~£2.00 · Frozen veg 1kg ~£1.20 · Eggs, milk 2L ~£1.50 ·
Whey 1kg ~£12 (occasional) · Bananas ~£0.90 · Chickpeas x2 ~£1.00 ·
Quark 250g ~£1.10 · Frozen edamame 300g ~£1.80.

View File

@ -0,0 +1,30 @@
# Protein Targets — Burns Recovery & Fat Loss
User profile this skill was tuned for: recovering burns victim, healing well,
~95100 kg, wants to lose ~15 kg fat while **preserving lean mass**.
## Target math
- Burns recovery + lean-mass preservation during a deficit: **2 g protein per kg
bodyweight per day**.
- At 95100 kg → **~190200 g/day**.
- Split across 2 main meals: aim **~90100 g per meal**; any remainder comes from a
third hit.
- **Recompute whenever the user reports a new weight:** target = weight_kg × 2.
Keep `diet.bodyweight_kg`, `diet.protein_per_kg`, and
`diet.protein_target_g_per_day` in inventory.json in sync with that.
## Fat-loss lever
- Fat loss = a MILD calorie deficit, NOT protein cutting. Bulk meals with veg; limit
oven chips / white bread / added oil; lead with lean protein.
## Closing the gap (third hit)
When 2 cooked meals fall short of the daily target, name one cheap, fast hit:
- Whey protein shake (1 scoop ≈ 25 g) — most cost-efficient per gram; ideal staple.
- Extra eggs (1 egg ≈ 13 g).
- Greek yogurt 150 g (≈ 15 g) or cottage cheese / quark.
- Tinned tuna (≈ 25 g) or skim milk.
## Why red meat is excluded from BUY lists
User prefers to stop buying red meat (lamb / pork / beef / bacon / gammon). Red meat
ALREADY in stock is still cooked and suggested so it isn't wasted — it is never
re-purchased. Encode this as: usable-if-in-stock, never-re-buy.