From 1c52e3ea3f71739a03e802b0d49f916757b74d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?n=CE=B9c=D0=BDola=D1=95=20w=CE=B9lde?= Date: Sun, 14 Jun 2026 12:25:28 -0700 Subject: [PATCH] docs(agents): Add recipe-image-validation.md skill and format AGENTS.md --- .agents/AGENTS.md | 30 +++++--- .agents/skills/recipe-image-validation.md | 88 +++++++++++++++++++++++ .markdownlintignore | 2 + 3 files changed, 111 insertions(+), 9 deletions(-) create mode 100644 .agents/skills/recipe-image-validation.md diff --git a/.agents/AGENTS.md b/.agents/AGENTS.md index d31bb4d6..aac29f66 100644 --- a/.agents/AGENTS.md +++ b/.agents/AGENTS.md @@ -1,3 +1,5 @@ +# Agent Memory + - I have imported the Butternut Squash Tahini Curry recipe (Issue #1344). - I have imported the Classic White Sandwich Bread recipe (King Arthur Baking). - I have imported the Beautiful Burger Buns recipe (Ellen Dorsey). @@ -12,16 +14,26 @@ - I have imported the Lemon Poppy Seed Pound Cake (Melissa Clark) recipe (Issue #1348). - I have imported the Key Lime Pound Cake recipe (Issue #1346). - I have updated the Butternut Squash Tahini Curry recipe with a new image and source (Practically Vegan book). -- I have created a new Gemini command `/zensical fix` in `.gemini/commands/zensical-fix.toml` to validate the project and fix build issues. +- I have created a new Gemini command `/zensical fix` in `.gemini/commands/zensical-fix.toml` to validate the + project and fix build issues. - I have imported the `liteparse` skill into `.agents/skills/liteparse.md`. -- I have imported Stella Parks' BraveTart Brownies recipe, updated zensical.toml, includes/emoji.yaml, and dictionary.txt, and downloaded the recipe's hero image. -- I have removed the Peanut Butter Stuffed Brownies recipe, including its CookLang, Markdown, image files, and menu configurations. -- Always consult and filter out terms in `.agents/author_whitelist.txt` when listing recipes containing author names in their titles to respect whitelisted names (e.g. "Tante Myrna Seccia"). -- When importing a recipe that calls for **terasi** (shrimp paste / belacan), always substitute it with a markdown link to the Vegetarian Terasi recipe (`[Vegetarian Terasi](../ingredients/vegetarian-terasi.md)`, adjusting the relative path as needed) in both the ingredients list and the instructions. Do not list terasi as a plain ingredient. -- When importing a recipe that calls for **sambal oelek** (or sambal ulek), always substitute it with a markdown link to the Sambal Oelek recipe (`[Sambal Oelek](../sauces-and-dressings/gravy-and-savory-sauces/sambal-oelek.md)`, adjusting the relative path as needed) in both the ingredients list and the instructions. Do not list sambal oelek as a plain ingredient. -- Always use the GitHub CLI (`gh`) to view, monitor, and debug remote GitHub Actions workflow runs when verifying the status of CI pipelines or investigating deployment failures. +- I have imported Stella Parks' BraveTart Brownies recipe, updated zensical.toml, includes/emoji.yaml, and + dictionary.txt, and downloaded the recipe's hero image. +- I have removed the Peanut Butter Stuffed Brownies recipe, including its CookLang, Markdown, image files, and menu + configurations. +- Always consult and filter out terms in `.agents/author_whitelist.txt` when listing recipes containing author + names in their titles to respect whitelisted names (e.g. "Tante Myrna Seccia"). +- When importing a recipe that calls for **terasi** (shrimp paste / belacan), always substitute it with a markdown + link to the Vegetarian Terasi recipe (`[Vegetarian Terasi](../ingredients/vegetarian-terasi.md)`, adjusting the + relative path as needed) in both the ingredients list and the instructions. Do not list terasi as a plain + ingredient. +- When importing a recipe that calls for **sambal oelek** (or sambal ulek), always substitute it with a markdown + link to the Sambal Oelek recipe (`[Sambal Oelek](../sauces-and-dressings/gravy-and-savory-sauces/sambal-oelek.md)`, + adjusting the relative path as needed) in both the ingredients list and the instructions. Do not list sambal oelek + as a plain ingredient. +- Always use the GitHub CLI (`gh`) to view, monitor, and debug remote GitHub Actions workflow runs when verifying + the status of CI pipelines or investigating deployment failures. - I have imported the Date Brownies recipe (Issue #1355). - I have added the recipe servings and batch tab conversion skill to `.agents/skills/recipe-servings-tabs.md`. - I have added a skill to monitor and fix GitHub Actions workflow runs in `.agents/skills/review-actions.md`. - - +- I have added the recipe image validation skill to `.agents/skills/recipe-image-validation.md`. diff --git a/.agents/skills/recipe-image-validation.md b/.agents/skills/recipe-image-validation.md new file mode 100644 index 00000000..282855db --- /dev/null +++ b/.agents/skills/recipe-image-validation.md @@ -0,0 +1,88 @@ +# Recipe Image Validation Skill + +This skill documents how to identify and resolve missing or corrupted images in recipe files, ensuring all recipes have +proper hero images and body embeds. + +## Description + +Recipes require both a `hero:` field in their frontmatter and a matching image embed in the body of the markdown +document (in the format `![Title][1]{ loading=lazy }` with `[1]: `). This skill guides the user through +running the checker, resolving corrupted link syntax, adding missing frontmatter/embeds, and generating new image +assets. + +## Protocol + +### 1. Identify Image Issues + +Run the image checker command using the Taskfile runner: + +```bash +task check-missing-images +``` + +This checks all recipe files for: + +- Missing hero frontmatter (`NO_HERO`) +- Missing body image embeds (`NO_EMBED`) +- Nonexistent image files (`HERO_MISSING`) +- Link-corrupted frontmatter fields (`HERO_CORRUPT`) + +--- + +### 2. Fix Corrupted Hero Paths + +If frontmatter paths contain markdown links (e.g. `hero: assets/images/[ricotta]...`), strip the link and square +brackets, keeping only the raw text (e.g. `hero: assets/images/ricotta-fritters.webp`). Ensure the casing matches +the actual filename on disk (filenames are typically lowercase). + +--- + +### 3. Resolve Missing Properties & Embeds + +For recipes missing properties or body embeds: + +- **Missing Hero Frontmatter**: Extract the image name from the body link and add the property to the frontmatter: + + ```yaml + hero: assets/images/. + ``` + +- **Missing Body Image Embeds**: Insert the embed below the main title (H1) and append the reference link to the + bottom of the file: + + ```markdown + ![Recipe Name][3]{ loading=lazy } + + ... + + [3]: <../assets/images/.> + ``` + + *Note*: Ensure the link reference index (e.g., `[3]`) does not conflict with existing references in the document + (like ingredient markdown links). + +--- + +### 4. Generate Missing Images + +For recipes missing an image asset entirely: + +1. Propose image generation using the `generate_image` tool with a descriptive prompt. +2. Save the image in `docs/assets/images/` using the hyphenated recipe slug. +3. Optimize and convert it using the image optimizer: + + ```bash + ./scripts/optimize-images.sh + ``` + +--- + +### 5. Validate & Lint + +Before committing, ensure all tests, linters, and spellcheckers pass: + +```bash +task lint-changed +task spellcheck-file FILE=docs/.md +task build +``` diff --git a/.markdownlintignore b/.markdownlintignore index 0f6d48b4..393f90ee 100644 --- a/.markdownlintignore +++ b/.markdownlintignore @@ -1,3 +1,5 @@ cook/** docs/reference/charts.md conductor/** +.agents/AGENTS.md +