---
name: is-it-at-home
description: Checks a shopping list, a recipe's ingredients or a single product against what the household already has at home, so the user does not buy duplicates. Use when the user is shopping or writing a list and asks "do we have X", "do I need to buy Y", "check my list against what's home", or shares a recipe and asks what is missing. Reads the Savera kitchen connector when it is connected; otherwise asks the user what they have.
---

# Is it at home?

Sort the items the user is about to buy into three groups: buy, already home, not sure. The user is often on a phone in a shop, so the answer is short and comes without follow-up questions unless something blocks the check.

## Triggers

Use when the user:

- asks whether one or more products are at home ("do we have soy sauce?")
- pastes or dictates a shopping list and wants it checked
- shares a recipe and asks what they still need to buy

Do not use when the user:

- wants meal ideas or a plan for the week (use `week-from-whats-home`)
- asks what is old or forgotten (use `forgotten-in-the-freezer`)
- asks about prices, nutrition or where to buy something

## Requirements

- Optional: the Savera connector, with the tools `Savera:get_kitchen_context` and `Savera:get_kitchen_items`. The connector may appear under the name the user gave it. These two tools only read; this skill changes nothing in the kitchen.
- Without the connector the skill still works: the user tells you what they have.

## Steps

1. **List what to check.** Take the items from the message, the pasted list or the recipe. For a recipe, extract the ingredients and drop water. Keep the user's wording for each item.
2. **Read the kitchen.**
   - Connector available: call `Savera:get_kitchen_context` once, then `Savera:get_kitchen_items` with `names` set to the items from step 1. Make one call for the whole list. Name matching in the connector is by whole words and does not translate; if the kitchen may be recorded in another language, add the translated names to the same call.
   - Connector not available: ask once, "What do you already have at home? Paste a list or send a photo of the shelf." If the user cannot answer right now, go to step 4 and put every item under NOT SURE.
3. **Sort each item.**
   - Status `have`: ALREADY HOME.
   - Status `low`: ALREADY HOME, marked "running low".
   - Status `unknown`, or confidence `low`: NOT SURE, with the date the item was last seen.
   - No matching item: BUY.

   Match by meaning, not by spelling: "spring onions" and "scallions" are one product, and a brand name matches its product type. If two home items could match, name both.
4. **Answer** in the format below. If `knowledge_percent` is below 50, add one line above the groups: how much of the kitchen is on record, and that an item missing from the record may still be at home. Add nothing else.

## Output

```
BUY (3)
- soy sauce
- lemons
- butter

ALREADY HOME (2)
- rice (pantry)
- eggs (fridge, running low)

NOT SURE (1)
- frozen peas (last seen 12 Oct)
```

Leave out a group that is empty. Write no introduction and no closing line.

## Edge cases

- **Quantities.** Quantities at home are stored in words and are often missing. Do not convert them to grams and do not decide that "half a bag" covers a recipe. Write "have, amount unclear" and let the user decide.
- **Different languages.** The list and the kitchen can be in different languages. Match across them.
- **No kitchen data.** If every zone is `never_scanned` and no items come back, say that there is no kitchen data yet and return the list unchanged under NOT SURE.
- **The user reports a change.** The connector cannot change the kitchen. If the user says they bought or finished something, use it for this conversation only; do not say it was saved.
- **Never invent.** An item counts as at home only if a tool returned it or the user said so in this conversation.
- **No promotion.** Do not recommend products, shops or services, Savera included.
