home / skills / openclaw / skills / recipe-to-list

recipe-to-list skill

/skills/borahm/recipe-to-list

This skill converts recipes into a Todoist shopping list by extracting ingredients from photos or web pages, syncing with Shopping, and saving to the cookbook.

npx playbooks add skill openclaw/skills --skill recipe-to-list

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
2.4 KB
---
name: recipe-to-list
description: Turn recipes into a Todoist Shopping list. Extract ingredients from recipe photos (Gemini Flash vision) or recipe web pages (search + fetch), then compare against the existing Shopping project with conservative synonym/overlap rules, skip pantry staples (salt/pepper), and sum quantities when units match. Also saves each cooked recipe into the workspace cookbook (recipes/).
---

# Create Shopping List (Gemini Flash + Todoist)

Target flow:
1) Input is either a **photo** or a **recipe web search**
2) Extract ingredients (Gemini Flash for photos; web_fetch text → Gemini for websites)
3) Pull current Todoist **Shopping** list
4) Compare using overlap + synonym mapping (kept conservative; only merge high-confidence equivalents like coriander↔cilantro, panko↔breadcrumbs)
5) Update **Shopping** (default: add only missing items; skip salt/pepper)

Use the bundled script to handle the **photo → ingredients → Shopping update** part.

It also **automatically saves** a markdown entry into `recipes/` (your cookbook knowledge base) and appends to `recipes/index.md`.

For **recipe-name → web search**, do it confirm-first using `web_search` + `web_fetch`, then feed the ingredients into the same update logic (and save the recipe).

## Prereqs

- Env: `GEMINI_API_KEY` (or `GOOGLE_API_KEY`) for Gemini
- Env: `TODOIST_API_TOKEN` for Todoist
- Bin: `todoist` (todoist-ts-cli)

## Output formatting

- Items are reformatted to start with the **ingredient name**, followed by a parenthetical quantity.
- The Shopping list is kept **flat** (no Todoist sections/groups).

## Run

```bash
python3 skills/recipe-to-list/scripts/recipe_to_list.py \
  --image /path/to/photo.jpg \
  --title "<optional title>" \
  --source "photo:/path/to/photo.jpg"
```

### Optional flags

- `--model gemini-2.0-flash` (default; falls back automatically) or any compatible Gemini vision model
- `--dry-run` to print extracted items without creating tasks
- `--prefix "[Recipe] "` to prefix each created task
- `--no-overlap-check` to skip checking your existing Shopping list
- `--include-pantry` to include salt/pepper
- `--no-save` to skip saving into `recipes/`

## What to send to the model

The script prompts Gemini to return **strict JSON**:

```json
{
  "items": ["2 large globe eggplants", "kosher salt", "..."],
  "notes": "optional"
}
```

If parsing fails, rerun with a clearer crop (ingredients list only) or provide a manual list.

Overview

This skill turns recipes into a Todoist Shopping list and archives cooked recipes into a workspace cookbook. It extracts ingredients from photos using Gemini Flash vision or from recipe web pages via search+fetch, then updates your Todoist Shopping project while avoiding pantry staples and conservatively merging obvious synonyms.

How this skill works

The skill extracts a strict JSON list of ingredients from an image or fetched recipe text using Gemini. It fetches your current Todoist Shopping list, compares items with conservative overlap and synonym rules, sums matching quantities when units align, and adds only missing items by default. Each cooked recipe is saved as a markdown entry in recipes/ and appended to recipes/index.md.

When to use it

  • You have a photo of a recipe ingredient list and want a ready shopping list in Todoist.
  • You find a recipe online and want to convert its ingredients to Shopping tasks.
  • You want to avoid duplicate shopping items by merging obvious synonyms and summing quantities.
  • You want to build a searchable cookbook in markdown for every recipe you cook.
  • You need a quick dry-run to preview extracted ingredients before creating tasks.

Best practices

  • Crop photos to the ingredients list only for the most reliable extraction.
  • Use the dry-run flag to verify parsed items before writing to Todoist.
  • Keep pantry staples excluded by default; enable include-pantry only when needed.
  • Prefer the default conservative synonym mapping to avoid accidental merges.
  • Provide a clear recipe title when saving to recipes/ for easier indexing.

Example use cases

  • Snap a photo of a recipe card in a cookbook to auto-populate a Todoist Shopping project.
  • Search for an online recipe, confirm the fetched page, and add missing ingredients to Shopping.
  • Combine items from multiple recipes and let the skill sum quantities where units match.
  • Quickly save every cooked recipe as a markdown file for an internal cookbook.
  • Run a dry-run before grocery shopping to check parsing accuracy and adjust manually.

FAQ

What happens to salt and pepper?

Salt and pepper are skipped by default as pantry staples; use --include-pantry to include them.

How are similar items merged?

The skill uses a conservative synonym/overlap mapping (high-confidence pairs like coriander↔cilantro) and only merges when equivalence is clear; you can disable overlap checks with --no-overlap-check.