---
name: metrition-recipe-creator
description: |
  Use when you want to convert a recipe, dish description, or ingredient list into a downloadable native .metrition file (or a ZIP archive).
  
---
# MeTrition Recipe Creator

Create a downloadable native MeTrition file with the `.metrition` extension, named after the dish. Important: a `.metrition` file is a ZIP archive with its filename extension changed to `.metrition`; it is not a different compression format. Build a valid ZIP archive containing exactly one file at the archive root: `data.json`, then save/rename the completed ZIP to `<dish-name>.metrition`. The file bytes remain a standard ZIP archive; only the outer filename extension is `.metrition`. Do not deliver only `.zip` unless the user explicitly asks for it. Never merely change the extension of an unrelated or invalid file, and never give raw JSON as a workaround instead of the downloadable `.metrition` file. If the current environment cannot create and attach a downloadable ZIP, say so plainly and tell the user to use a different AI assistant or app that can create files.

## 1. Gather the recipe; do not invent details

Extract from the user's input:
- dish title;
- number of portions;
- ingredients and amounts;
- optional total cooking time in minutes and preparation steps.

Use only what the user supplied. If the title, number of portions, or ingredient amounts are missing or ambiguous, ask for the missing information before creating the archive. Do not silently assume amounts, portion counts, ingredients, or cooking steps. Only generate a recipe when the user explicitly asks you to invent/create one; clearly state that the recipe was generated by you.

## 2. Load the correct ingredient catalog

Use the language the user writes in:
- Polish: bundled `ingredients_pl.txt` in this skill folder; canonical source: `https://metrition.withme.com.ua/ai/ingredients_pl.txt`
- Ukrainian: bundled `ingredients_uk.txt` in this skill folder; canonical source: `https://metrition.withme.com.ua/ai/ingredients_uk.txt`
- English: bundled `ingredients_en.txt` in this skill folder; canonical source: `https://metrition.withme.com.ua/ai/ingredients_en.txt`
- Any other language: translate ingredient names into English for catalog matching; keep dish title and instructions in the user's language.

The bundled Polish, English, and Ukrainian catalogs are snapshots of the supplied MeTrition catalog files. Prefer the bundled catalog for the user's language; if network access is available, the canonical URL may be checked for updates. Never replace a bundled catalog with incomplete or unverified data. If a catalog cannot be read, do not fabricate or reconstruct its entries; tell the user and ask whether they want to continue using English matching. Retrieve and inspect the relevant catalog before mapping ingredients. Each line is `id | name`, optionally followed by `| units`. For catalog matches, copy the exact `id` and exact `name`. Prefer a generic ingredient unless the recipe clearly requires a specific variant. Never invent catalog IDs. If a match is uncertain, select the closest defensible entry and disclose that choice in the summary.

## 3. Match ingredients and units

Weight units (`g`, `kg`, `oz`, `lb`) always work. Volume units (`ml`, `l`, `ts`, `tbs`, `glass_200`, `glass_250`, `flOz`, `us_cup`, `pt`, `qt`, `gal`) work only when the catalog line says `volume` or specifies the relevant unit conversion. Count units (`pc`, `pcSmall`, `pcBig`, `clove`, `pinch`) work only when explicitly supported by the catalog's `unit=grams` data.

Use the unit from the user's input when supported. If unsupported, convert to grams using a reasonable standard conversion, and clearly mention the conversion in the summary. Never emit an unsupported unit. Use edible ingredient weight (e.g. peeled vegetables and boneless meat). Do not convert quantities unnecessarily.

Catalog line examples:
- `id | Butter | volume`: volume units supported.
- `id | Egg | pc=50; pcBig=60`: `pc` weighs 50 g and `pcBig` weighs 60 g.
- no third column: weight units only.
- `volume; tbs=8`: all volume units work, but one tablespoon is 8 g for this ingredient.

## 4. Custom ingredients

If an ingredient is absent from the selected catalog, create a custom ingredient. Find nutrition per 100 g (kcal, protein, fat, carbohydrate) from a reliable food composition database or the product label. Use web search if available; otherwise use reliable standard food-composition values and label them as standard values. Record the source and disclose each custom ingredient, the values used, and the source to the user. For liquids, include `density` (g/ml) when a reliable value is available; add `unitToGram` only when a supported count-unit weight is known. Never invent product-label values or imply a source was verified if it was not.

Each custom ingredient needs a newly generated UUID v4. Its UUID must be used both as the top-level custom ingredient `id` and the matching dish ingredient line's `ingredientId`. Custom ingredients have `isCustom: true`.

## 5. Generate identifiers and build the JSON

Generate a new random UUID v4 for `dish.id` and a different new UUID v4 for each custom ingredient. Use lowercase canonical format `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`; ensure every ID is unique within this dish. Generate UUIDs programmatically when possible. Never reuse IDs from examples or earlier dishes.

Use this structure:

```json
{
  "dish": {
    "id": "NEW-UUID-V4",
    "title": "Dish title in user's language",
    "inputOption": "ingredients",
    "numberOfPortions": 2,
    "mediumSize": 250,
    "ingredients": [
      { "ingredientId": "CATALOG-ID-OR-CUSTOM-UUID", "ingredientName": "Exact catalog name or custom title", "amount": 100, "uom": "g" }
    ],
    "cookingTime": 30,
    "cookingInstructions": [
      { "index": 0, "text": "Step in user's language" }
    ],
    "isCustom": true,
    "isFavorite": false
  },
  "subdishes": [],
  "ingredients": []
}
```

Rules:
- `dish.id`: new UUID v4.
- `title`: user's language.
- `inputOption`: always `ingredients`.
- `numberOfPortions`: provided number; may be decimal.
- `mediumSize`: total mass of all ingredient quantities expressed in grams divided by number of portions, rounded to a whole gram. Convert volume/count measures to mass using the same known conversions where possible; if a mass conversion is unknown, use a defensible estimate and disclose it. Do not simply add incompatible units.
- `ingredients`: exact catalog names/IDs or the matching custom ingredient name/UUID.
- `cookingTime`: include only if provided or explicitly generated as part of a user-requested generated recipe; whole minutes.
- `cookingInstructions`: include only if supplied or explicitly generated at the user's request. Index starts at 0 and increments by 1.
- `isCustom`: always `true`.
- `isFavorite`: always `false`.
- Do not add a `nutrition` field to `dish`.
- top-level `subdishes`: always `[]`.
- top-level `ingredients`: custom ingredients only; use `[]` if every ingredient matched the catalog.

Each custom ingredient object should use:

```json
{
  "id": "NEW-UUID-V4",
  "title": "Custom ingredient name in user's language",
  "nutrition": { "calories": 100, "proteins": 5, "fats": 2, "carbs": 10 },
  "informationSource": "Verified source or standard values",
  "isCustom": true
}
```

Nutrition is per 100 g. Include `sugars`, `fiber`, `salt`, and `saturatedFats` only if known. Include `dietaryType` only when confidently known (`vegan`, `vegetarian`, `meat`, `fish`). Include `density` for liquids when known, and `unitToGram` for known count conversions. Do not calculate the dish's total calories/macros; MeTrition does that itself.

## 6. Create and validate the native `.metrition` file

Use a file-generation/runtime tool to write UTF-8 `data.json`, create a standard ZIP archive named after the dish with `data.json` at the ZIP root and no other files, then change the final filename extension from `.zip` to `.metrition`. The `.metrition` output is the same ZIP archive format with MeTritionтАЩs custom extension. Escape strings correctly and serialize valid JSON. Do not expose raw JSON as a substitute for the file.

Before attaching the archive, verify:
1. The `.metrition` file opens as a ZIP archive and contains `data.json` at root.
2. `data.json` parses as valid UTF-8 JSON.
3. `dish.id` and every custom ingredient ID are valid, newly generated UUID v4 strings and unique.
4. Every `ingredientId` refers either to an exact catalog ingredient ID or to an ID in top-level `ingredients`.
5. Every unit is supported by the ingredient catalog entry or custom ingredient metadata.
6. `mediumSize` is a reasonable per-portion gram estimate.
7. No `dish.nutrition` field exists; `subdishes` is exactly `[]`.
8. No placeholders, invented catalog IDs, extra files, or stale IDs remain.

If any check fails, fix and re-validate before returning the file.

## 7. Response after creating the file

Attach the actual downloadable `.metrition` file first. If the environment cannot attach this extension, state that limitation honestly; do not silently substitute `.zip` unless the user agrees. Then give a concise summary containing:
- dish title and number of portions;
- every ingredient and amount, marking custom ingredients;
- any unit conversions and uncertain catalog matches;
- each custom ingredient's kcal/protein/fat/carbohydrate values per 100 g and its source;
- reminder to verify ingredients and amounts in MeTrition before saving.

Be transparent about any estimates. Never claim a ZIP was created, validated, a catalog was checked, or a source was consulted unless that actually happened.



