Integrate new recipes into the LaTeX cookbook. Use this skill whenever the user wants to add a new recipe to the cookbook — from a URL, pasted text, or a photo of a cookbook page. Also use when the user says "add recipe", "new recipe", "import recipe", "integrate recipe", or shares a cooking website link or photo of a recipe. This skill handles extraction, formatting, prose rewriting, nutrition calculation, integrity verification, and insertion into main.tex.
This skill automates adding new recipes to "The Siobhan and Alex Recipe Book" — a LaTeX cookbook. It takes a recipe from any source (URL, text, photo) and produces a properly formatted, verified .tex file integrated into the cookbook.
main.texUse web fetch tools to retrieve the page content. Extract:
Recipe websites often have structured data. Look for the recipe content and ignore ads, navigation, and comments.
Parse the text directly. Identify ingredient lines (they have quantities and units) vs instruction paragraphs.
Use vision capabilities to read the photo. Transcribe the recipe accurately, paying close attention to quantities, fractions, and unit abbreviations. If anything is unclear or illegible, flag it and ask the user.
Read the full style guide before formatting:
Read: .claude/skills/recipe-integration/references/style-guide.md
The style guide has the complete formatting rules. Here's a quick summary of the most important ones:
thai_green_curry.texrecipes/ directory\begin{recipe}[
title = {Recipe Title},
servings = {N servings},
calories = {X calories},
source = {Source Name},
]
\\quantity unit item, state \\tbsp (not tbs/tablespoon), tsp (not teaspoon), g, ml, cup, oz\sfrac{1}{2} — mixed numbers: 1\sfrac{1}{2} (no space)\inggroup{Name} for multi-component recipes-- (e.g., 1--2 tbsp)This is critical. The source recipe's instructions will come in many different voices — chatty blog posts, terse reference cards, old-fashioned cookbook prose. All must be rewritten into one consistent cookbook voice.
The voice is concise, imperative, warm but efficient. Think of a confident home cook giving clear directions — not a food blogger telling a story, not a chemistry textbook.
Principles:
\recipenotes: Storage instructions, make-ahead notes, substitution ideas, and serving suggestions that aren't essential to the cooking process go in \recipenotes at the end — not mixed into the instructions{\bfseries Section Name} headers. Simple one-pot recipes don't need headers.Before (rambling, conversational):
Stir well and begin to cook on a low flame stirring often. You will need to add half cup water each time the dal thickens. Stir and continue to cook on the lowest possible heat. You can use about 1 to 2 cups water and simmer for 60 to 90 mins on a very low flame or as long as 4 to 6 hours for a more authentic taste. Remember to keep stirring and add water whenever needed. Once it is thick and creamy, you can add cream and turn off. It tastes good even without the addition of cream. If having it the next day or later, you can refrigerate.
After (concise, imperative, well-paragraphed):
Pour in the cooked dal with its stock and stir well. Reduce heat to the lowest setting and simmer, stirring often and adding water ½ cup at a time as the dal thickens. Cook for 60 to 90 minutes for a good result, or up to 4 to 6 hours for deeper flavour.
Stir in cream just before serving. Serve topped with butter, garnished with cilantro and ginger juliennes, alongside rice, naan, or roti.
\recipenotes Dal makhani improves overnight — make it a day ahead if you can. Reheat gently with a splash of water, stirring in cream once hot. Tastes great without cream as well.
\recipenotes\recipenotesIf the environment variables EDAMAM_APP_ID and EDAMAM_APP_KEY are set, use the nutrition script with --embed to calculate nutrition and store the full dataset as comments in the .tex file:
python .claude/skills/recipe-integration/scripts/nutrition.py \
--tex recipes/new_recipe.tex \
--embed
This submits the full recipe to the Edamam Nutrition Analysis API (POST /api/nutrition-details) in a single request, displays per-serving calories and macros, and embeds all 35+ nutrient fields (vitamins, minerals, fat breakdown, diet/health labels) as a JSON comment block in the .tex file. The embedded data is invisible in the compiled book but available for future use (e.g., a nutrition appendix). Servings are auto-detected from the .tex metadata. Optional ingredients (garnishes, "to taste", "if desired") are excluded.
The script converts LaTeX fractions to decimals before querying the API (e.g., 1\sfrac{1}{2} becomes 1.5, \sfrac{3}{4} becomes 0.75). This avoids ambiguous fraction strings like 11/2 being misread by the API.
Get API credentials at https://developer.edamam.com/admin/applications
If no API credentials are available, you have two options:
When you get the calorie result, update the recipe's calories metadata field.
This step is mandatory. After rewriting, spawn a separate verification agent that receives both the original source recipe and the new formatted version. The verifier is independent — it has not seen the rewriting process and checks with fresh eyes.
Send the following to a subagent (or, in environments without subagents, perform the verification as a clearly separated second pass):
You are a recipe verification agent. You have been given an ORIGINAL recipe and a
REWRITTEN version. Your job is to verify that the rewrite is faithful to the original.
Check the following:
1. INGREDIENTS ACCURACY
- Every ingredient in the original appears in the rewrite (same item, same quantity)
- No quantities have been changed (watch for unit conversions gone wrong)
- No ingredients have been added that weren't in the original
- No ingredients have been silently dropped
2. INSTRUCTIONS ACCURACY
- Every cooking step in the original is present in the rewrite
- Temperatures have not changed
- Cooking times have not changed
- The order of operations is preserved
- No steps have been silently dropped or merged incorrectly
- Technique details are preserved (e.g., "fold" not changed to "stir")
3. METADATA ACCURACY
- Title matches (or is a reasonable standardization)
- Servings count is preserved
- Source attribution is preserved
- Calorie count is preserved (if present in original)
Report:
- PASS if the rewrite is faithful
- FAIL with specific issues if anything was changed, dropped, or added incorrectly
- WARN for anything ambiguous that the user should review
Be strict. The rewrite should improve clarity and consistency, not change the recipe.
ORIGINAL:
[paste the full original .tex file or source text]
REWRITTEN:
[paste the full new .tex file]
In addition to the verification agent, run these automated checks:
For each ingredient, verify it appears (by name or synonym) in the instructions. Flag ingredients that are listed but never referenced — they might be garnishes (acceptable) or actually missing from instructions (problem).
\\\inggroup{} names match {\bfseries} section headers in instructions (if applicable)\sfrac{}{} not plain text fractions\textbf{} anywhere — only {\bfseries} for headers, \recipenotes for notesRun the automated verifier script:
python .claude/skills/recipe-integration/scripts/verify_recipe.py recipes/new_recipe.tex
The recipe index includes ingredient-based sub-categories. Recipes are tagged via the tags metadata key.
python .claude/skills/recipe-integration/scripts/add_tags.py --dry-run
Review the suggestions. The script uses keyword matching which can produce false positives. Apply these judgment rules:
{Lentils and Dal, Potatoes}) — each tag generates a separate index entryIf the auto-tagger's suggestions look correct, run without --dry-run to apply. Otherwise, set the tags manually in the recipe metadata:
\begin{recipe}[
...
tags = {Tofu, Potatoes},
]
.tex file to the recipes/ directorymain.tex:
\input{recipes/filename} in the appropriate position within that chapterAfter inserting the recipe, recompile the cookbook PDF. The cookbook uses fontspec for custom fonts, so it must be compiled with XeLaTeX (not pdfLaTeX):
latexmk -xelatex -interaction=nonstopmode main.tex
Verify the build succeeds and check the final page count in the output.
Before considering the task done, present a summary:
Ask the user to confirm or request changes.
chana_masala2.tex).\label{components:keyname}.source = {{\normalfont Book Title} by Author (p. N)}\pageref{} links.These component recipes exist in the cookbook and can be referenced:
\pageref{components:gingergarlicpaste} — Ginger Garlic Paste\pageref{components:taco_seasoning} — Taco Seasoning\pageref{components:paneer} — Paneer\pageref{components:paneer_spice_mix} — Paneer Spice MixIf a new recipe uses one of these components, reference it in the ingredient line:
4\sfrac{1}{2} tsp ginger garlic paste (p.~\pageref{components:gingergarlicpaste}) \\