Join Nostr
2026-06-17 05:18:58 UTC
in reply to

chadlupkes on Nostr: --- name: recipe-converter description: Convert recipe files of any format into ...

---
name: recipe-converter
description: Convert recipe files of any format into clean, polished, consistently styled HTML. Use this skill whenever the user uploads a recipe file and asks to convert it, clean it up, or save it — regardless of source format (.htm, .shtml, .html, .doc, .txt, .eml, .pdf, Google Doc, etc.). Also trigger when the user says "please convert this recipe", "clean up this recipe", "process this recipe", or pastes recipe text and wants a formatted version. Works for individual recipes or batches. The output is a warm, elegantly styled HTML file ready to save and share.
---

# Recipe Converter

Convert recipe files of any format into clean, polished HTML — stripping away all cruft (navigation, ads, FrontPage artifacts, SSI includes, copyright boilerplate, branding) and leaving only the actual recipe content, beautifully formatted.

## When this skill applies

- User uploads any file and asks to convert or clean up a recipe
- User says "please convert this recipe", "process this recipe", "clean this up"
- User pastes raw recipe text and wants formatted output
- User is working through a batch of recipe files folder by folder
- Source may be: .htm, .shtml, .html, .doc, .txt, .eml, .mht, .pdf, Google Doc link, or plain pasted text

## Step 1: Read the source

Use the appropriate method for the file type:
- `.htm`, `.shtml`, `.html`, `.txt`: `view` the file directly
- `.doc`, `.docx`: use the docx skill or `bash_tool` with python-docx
- `.eml`: `view` as text, extract body content
- `.pdf`: use the pdf-reading skill
- Google Doc URL: use `google_drive_fetch`
- Pasted text: use as-is from the conversation

## Step 2: Extract and clean

Read with comprehension. Identify and keep:
- Recipe title
- Yield / servings / timing (prep, cook, total)
- Description or headnote (if present)
- Ingredient list(s) — may be grouped into sub-sections (dough, filling, icing, etc.)
- Instructions / steps
- Make-ahead notes, tips, or technique callouts
- Source attribution (author, publication, date)
- Nutrition info (if present — format as a single clean line)
- Dietary tags (Dairy Free, Vegetarian, Gluten Free, etc.)

Discard everything else:
- Navigation bars, headers, footers
- SSI includes (`<!--#include ...-->`)
- FrontPage/Dreamweaver metadata
- Ads, promotional copy, brand trademarks (® ™)
- "Rate this recipe", share buttons, comment sections
- Unrelated page content

## Step 3: Editorial improvements

Apply these consistently — this is where the skill adds real value:

**Ingredients:**
- Convert fractions to proper Unicode characters: ½ ¼ ¾ ⅓ ⅔ ⅛ ⅜ ⅝ ⅞
- Standardize abbreviations: tablespoon → Tbsp, teaspoon → tsp, ounce → oz, pound → lb
- Remove brand names where generic terms work (e.g. "McCormick® Italian Seasoning" → "Italian seasoning")
- Move equipment items out of ingredient lists (e.g. "12 muffin cups" → mention in instructions)
- If an ingredient is used in two stages, note "divided" after it
- If water or another liquid is listed only in instructions but not ingredients, add it to the list
- Group into sub-sections when the recipe has distinct components (dough / filling / topping / sauce)

**Instructions:**
- Break dense paragraphs into individual numbered steps — one clear action per step
- Pull "preheat oven" out as its own first step if it's buried in a paragraph
- Fix vague references like "add next 7 ingredients" — name the actual ingredients
- Preserve technique tips inline where they're most useful
- Fix encoding artifacts: `\xb0` → °, `\xe9` → é, `\xfc` → ü, `\x97` → —, `\x99` → (remove), etc.

**Special callout blocks** (use when content warrants):
- Overnight/advance warning → highlighted note at top
- Braiding, rolling, or technique tips → tip block
- Make-ahead instructions → make-ahead block
- Dietary tags → pill tags under the title

## Step 4: Generate the HTML

Use this exact template and CSS. Do not deviate from the visual style — consistency across all recipes is the goal.

```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>[RECIPE TITLE]</title>
<style>
body {
font-family: Georgia, 'Times New Roman', serif;
background: #FAF8F5;
color: #2C2A26;
margin: 0;
padding: 2rem 1rem;
}
.recipe {
max-width: 680px;
margin: 0 auto;
background: #fff;
border: 1px solid #E8E2D9;
border-radius: 8px;
padding: 2.5rem 3rem;
}
h1 {
font-family: Georgia, serif;
font-size: 2rem;
font-weight: normal;
color: #2C2A26;
margin: 0 0 0.25rem;
line-height: 1.2;
}
.yield {
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 0.85rem;
color: #9A8F82;
margin: 0 0 0.75rem;
letter-spacing: 0.04em;
}
.description {
font-size: 0.95rem;
color: #5C5448;
line-height: 1.7;
margin: 0 0 1.5rem;
font-style: italic;
}
/* Dietary/occasion tags */
.tags {
display: flex;
gap: 6px;
margin: 0 0 1.5rem;
flex-wrap: wrap;
}
.tag {
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 0.72rem;
letter-spacing: 0.06em;
text-transform: uppercase;
color: #C4622D;
border: 0.5px solid #C4622D;
border-radius: 20px;
padding: 2px 10px;
opacity: 0.7;
}
/* Advance warning note (overnight rises, day-before prep, etc.) */
.note {
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 0.85rem;
color: #7A6E64;
background: #FAF3EC;
border-left: 3px solid #C4622D;
padding: 0.6rem 1rem;
border-radius: 0 4px 4px 0;
margin: 0 0 1.5rem;
}
/* Technique tips, make-ahead notes */
.tip {
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 0.85rem;
color: #7A6E64;
background: #F5F3F0;
border-radius: 4px;
padding: 0.75rem 1rem;
margin: 0 0 1.5rem;
}
.tip strong {
display: block;
font-size: 0.7rem;
letter-spacing: 0.1em;
text-transform: uppercase;
color: #9A8F82;
margin-bottom: 4px;
}
.divider {
border: none;
border-top: 1px solid #C4622D;
margin: 0 0 1.5rem;
opacity: 0.3;
}
h2 {
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 0.75rem;
font-weight: 600;
letter-spacing: 0.12em;
text-transform: uppercase;
color: #C4622D;
margin: 0 0 1rem;
}
/* Ingredient sub-section labels (dough, filling, icing, etc.) */
h3 {
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 0.7rem;
font-weight: 600;
letter-spacing: 0.1em;
text-transform: uppercase;
color: #9A8F82;
margin: 1.25rem 0 0.5rem;
}
ul {
list-style: none;
padding: 0;
margin: 0 0 0.5rem;
}
ul li {
font-size: 0.95rem;
line-height: 1.8;
color: #2C2A26;
padding: 0.2rem 0;
border-bottom: 0.5px solid #F0EBE3;
}
ul li:last-child { border-bottom: none; }
.ingredients-block { margin-bottom: 2rem; }
ol {
padding-left: 1.25rem;
margin: 0 0 2rem;
}
ol li {
font-size: 0.95rem;
line-height: 1.8;
color: #2C2A26;
margin-bottom: 0.75rem;
}
.nutrition {
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 0.78rem;
color: #B0A898;
margin: 0 0 1rem;
line-height: 1.6;
}
.meta {
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 0.8rem;
color: #B0A898;
margin-top: 2rem;
padding-top: 1rem;
border-top: 1px solid #E8E2D9;
}
@media print {
body { background: white; padding: 0; }
.recipe { border: none; padding: 1rem; box-shadow: none; }
}
</style>
</head>
<body>
<div class="recipe">

<h1>[TITLE]</h1>
<p class="yield">[Serves N · X min prep · Y min cook]</p>

<!-- Include .description if headnote exists -->
<!-- Include .note if overnight/advance prep required -->
<!-- Include .tags if dietary info present -->

<hr class="divider">
<h2>Ingredients</h2>

<!-- Simple ingredient list: -->
<ul>
<li>[ingredient]</li>
</ul>

<!-- OR grouped ingredients: -->
<div class="ingredients-block">
<h3>[Group name]</h3>
<ul>
<li>[ingredient]</li>
</ul>
<h3>[Group name]</h3>
<ul>
<li>[ingredient]</li>
</ul>
</div>

<hr class="divider">
<h2>Instructions</h2>
<ol>
<li>[step]</li>
</ol>

<!-- Include .tip blocks for technique tips or make-ahead notes -->

<!-- Include .nutrition if present -->

<div class="meta">From Debi's recipe collection &mdash; [category] &nbsp;|&nbsp; [Author, Publication, Date if known]</div>

</div>
</body>
</html>
```

## Step 5: Save and present

Use `create_file` to write the output to `/mnt/user-data/outputs/[recipe-slug].html`, then call `present_files` so the user can download it directly.

**Always derive the output filename from the recipe title**, not the source filename. Convert the recipe title to a lowercase hyphenated slug, dropping common filler words (a, an, the, and, with, on, in, of) and punctuation:

- "Mango Salmon on a Bed of Wild Rice" → `mango-salmon-wild-rice.html`
- "Mom's Best Chocolate Chip Cookies" → `chocolate-chip-cookies.html`
- "Slow Cooker Chicken and Dumplings" → `slow-cooker-chicken-dumplings.html`

Source filenames — whether they include a site name, path prefix, or any other origin indicator — should be ignored when naming the output. The goal is a clean, recipe-focused filename that reflects what the dish actually is.

## Category footer values

Use the folder/category the user is currently working on. Current known categories:
`bread` · `Breakfast` · `casseroles` · `Chicken` · `dessert` · `drinks` · `greek` · `Kids` · `Main` · `Meat` · `Pasta` · `Salad` · `Seafood` · `sides` · `Soup` · `Spices_Dressings` · `Steak`

If converting from Google Drive or another source with no clear category, omit the category or ask the user.

## Quality checklist before saving

- [ ] All SSI includes and FrontPage artifacts removed
- [ ] Fractions converted to Unicode characters
- [ ] Encoding glitches fixed (°, é, ü, —, etc.)
- [ ] Brand trademarks stripped
- [ ] Equipment removed from ingredient list
- [ ] Dense paragraphs broken into numbered steps
- [ ] "Preheat oven" is step 1 if applicable
- [ ] Vague ingredient references ("next 7 ingredients") replaced with actual names
- [ ] Advance-prep warning shown as .note if needed
- [ ] Source attribution in footer if known
- [ ] File saved and presented for download