Scales a recipe by servings, a factor, or pan size (square, rectangle, round, loaf), converts between US cups and spoons, metric volume and grams with an ingredient density table, rounds to measurable amounts, and flags baking caveats such as fractional eggs, leavening at large factors, batter depth and bake time when the pan changes, tiny amounts, seasoning and cooking time. Includes a stdlib…
--- name: recipe-scaling-and-unit-converter description: Scales a recipe by servings, a factor, or pan size (square, rectangle, round, loaf), converts between US cups and spoons, metric volume and grams with an ingredient density table, rounds to measurable amounts, and flags baking caveats such as fractional eggs, leavening at large factors, batter depth and bake time when the pan changes, tiny amounts, seasoning and cooking time. Includes a stdlib Python scaler with --self-test. --- # Recipe Scaling and Unit Converter You help home cooks and bakers make a recipe bigger, smaller or fit a different pan, in the units they actually use. You give amounts they can measure, show the factor and the conversions behind them, and warn about the things that do not scale in a straight line: eggs, leavening, pan depth, bake time, seasoning and cooking time. ## Files in this skill - `scripts/scale_recipe.py` - reads an ingredients CSV, scales by servings, factor or pan area, converts to US, metric or grams, rounds to kitchen measures and lists caveats (Python 3 standard library only) - `references/conversions-and-densities.md` - US/metric volume and weight, grams per cup for about 30 common ingredients, egg sizes, oven temperatures with fan and gas mark, and pan areas - `references/baking-scaling-caveats.md` - what scales linearly, eggs, leavening, pan size and bake time, cooking (non-baking) caveats and rounding rules - `templates/scaled-recipe.md` - the scaled recipe to hand back - `examples/fudgy-brownies-8x8.csv` - brownies for an 8x8 pan (16 pieces), used in the example ## Workflow ### 1. Get the recipe and the goal Ask for the ingredient list with amounts and units, the original yield or pan, and the target: servings, a factor, or a different pan. Ask whether it is baking, which units they want (cups, grams, or as written), and where the recipe is from if cup, tablespoon or egg sizes could differ (US, UK, Australia). Put the ingredients in a CSV with columns `quantity,unit,ingredient,note`. ### 2. Run the scaler ``` python3 scripts/scale_recipe.py examples/fudgy-brownies-8x8.csv --from-pan 8x8 --to-pan 9x13 --to weight --baking --oven 350F --time 20-25 python3 scripts/scale_recipe.py stew.csv --servings 4 10 --to metric python3 scripts/scale_recipe.py cake.csv --factor 2 --from-pan round8 --to-pan round9 --baking python3 scripts/scale_recipe.py --self-test ``` Pans: `8x8`, `9x13`, `20x30cm`, `round9`, `round23cm`, `loaf9x5`. With only pans, the factor is the area ratio. With a factor or servings plus pans, the script checks how the batter depth changes. Exit 1 means a HIGH caveat (batter depth changes by more than 1.5x), 2 means bad input. ### 3. Check and adjust - Read every caveat and turn it into a concrete instruction (see `references/baking-scaling-caveats.md`): weigh the partial egg, bake in batches, change the pan, lower the oven, taste before adding all the salt. - For ingredients without a density (NO_DENSITY), keep the volume or look the weight up; never guess for salt brands or leavening. - Sanity-check the result: does the pan hold it (2/3 full for cakes)? Did rounding move a key ingredient by more than 5 %? If yes, give grams. ### 4. Deliver Fill `templates/scaled-recipe.md`: factor, yield, pan, oven in °F and °C (fan), ingredients in the cook's units with the alternative in brackets, method changes, caveats and a doneness test instead of a fixed time. ## Example result `examples/fudgy-brownies-8x8.csv` moved from an 8x8 to a 9x13 pan: factor x1.83 (64 to 117 sq in), same batter depth, so bake 350°F / 180°C (fan 160°C) and start checking at 20 minutes. In grams: butter 205 g, sugar 365 g, cocoa 52 g, flour 115 g, chocolate chips 235 g, salt 2.5 g, baking powder 2 g, vanilla 7.5 g. Eggs scale to 3.66 (MEDIUM EGG_FRACTION): use 3 eggs plus 33 g beaten egg. Doubling the recipe but baking it in a 9 in round pan (about the same area as 8x8) doubles the batter depth (HIGH DEPTH_CHANGE, exit 1). ## Rules - Show the factor and how you got it (servings ratio or pan areas) before the amounts. - Never multiply bake or cooking times by the factor; give a doneness test and an early check time. - Keep salt and leavening ratios in baking; in cooking add about three quarters of scaled strong seasonings and taste. - Prefer grams for baking and say that densities are averages; trust the author's grams when they exist. - Ask before assuming US cups or egg sizes for recipes from other countries. - Mention food safety for large batches (cool quickly in shallow containers) when scaling cooked dishes up a lot. FILE:references/conversions-and-densities.md # Conversions and densities ## Volume (US customary) | Unit | ml | Also | |---|---|---| | 1 tsp | 4.93 | 1/3 tbsp | | 1 tbsp | 14.79 | 3 tsp | | 1 fl oz | 29.57 | 2 tbsp | | 1 cup | 236.59 | 16 tbsp, 8 fl oz | | 1 pint | 473.18 | 2 cups | | 1 quart | 946.35 | 4 cups | Other cups: metric cup (Australia, NZ, Canada recipes) = 250 ml; UK imperial pint = 568 ml; Australian tablespoon = 20 ml (4 tsp). Ask where a recipe is from when the cup or tablespoon size matters (baking, salt, leavening). ## Weight | Unit | g | |---|---| | 1 oz | 28.35 | | 1 lb | 453.6 (16 oz) | | 1 stick butter (US) | 113 (1/2 cup, 8 tbsp) | "oz" in a recipe is weight unless it says "fl oz". For water and milk 8 fl oz weighs about 8 oz; for flour it is about 4.4 oz. ## Grams per US cup (spoon-and-level, used by the script) | Ingredient | g/cup | g/tbsp | g/tsp | |---|---|---|---| | All-purpose (plain) flour | 125 | 7.8 | 2.6 | | Bread flour | 127 | 7.9 | | | Cake flour | 114 | 7.1 | | | Whole wheat flour | 113 | 7.1 | | | Almond flour | 96 | 6 | | | Cornstarch (cornflour) | 112 | 7 | | | Granulated or caster sugar | 200 | 12.5 | 4.2 | | Brown sugar, packed | 213 | 13.3 | | | Powdered (icing) sugar | 120 | 7.5 | | | Butter | 227 | 14.2 | | | Water | 237 | 14.8 | 4.9 | | Milk, buttermilk, sour cream | 242 | 15.1 | | | Heavy cream | 238 | 14.9 | | | Yogurt | 245 | 15.3 | | | Vegetable or canola oil | 218 | 13.6 | | | Olive oil | 216 | 13.5 | | | Honey, golden syrup | 340 | 21 | 7 | | Maple syrup | 322 | 20 | | | Cocoa powder | 85 | 5.3 | | | Rolled oats | 90 | | | | Chocolate chips | 170 | | | | Raw white rice | 185 | | | | Chopped nuts / walnuts | 120 | | | | Pecans | 110 | | | | Raisins | 150 | | | | Peanut butter | 270 | 17 | | | Table (fine) salt | 288 | 18 | 6 | | Baking soda | 230 | | 4.8 | | Baking powder | 192 | | 4 | | Instant or active dry yeast | 149 | | 3.1 | | Vanilla extract | 202 | | 4.2 | | Ground cinnamon | 125 | | 2.6 | Notes: - Flour scooped straight from the bag can weigh 140 to 150 g per cup. If a recipe author gives grams, trust the grams. - Kosher salt depends on the brand: Diamond Crystal about 2.8 g/tsp, Morton about 5 g/tsp, table salt about 6 g/tsp. Swapping brands by volume can double the salt. The script leaves "kosher salt" in volume and says so. - The table is a practical average; published tables differ by about 5 %. That is fine for cooking and most baking; for macarons, bread and candy, weigh. ## Eggs | Size (US) | Out of shell | |---|---| | Large | 50 g (yolk 18 g, white 32 g), about 3 tbsp beaten | | Medium | 44 g | | Extra large | 56 g | | Jumbo | 63 g | UK/EU "large" (63 to 73 g in shell) is about 58 g out of the shell: a UK large is closer to a US extra large. ## Oven temperatures | °F | °C | Fan °C | Gas mark | |---|---|---|---| | 300 | 150 | 130 | 2 | | 325 | 160 | 140 | 3 | | 350 | 180 | 160 | 4 | | 375 | 190 | 170 | 5 | | 400 | 200 | 180 | 6 | | 425 | 220 | 200 | 7 | | 450 | 230 | 210 | 8 | Fan (convection) ovens: lower about 20 °C / 25 °F, or keep the temperature and check earlier. ## Pan areas | Pan | Area (sq in) | Area (cm²) | |---|---|---| | 8x8 square | 64 | 413 | | 9x9 square | 81 | 523 | | 9x13 rectangle | 117 | 755 | | 10x15 jelly roll | 150 | 968 | | 8 in round | 50 | 324 | | 9 in round | 64 | 410 | | 10 in round | 79 | 507 | | 9x5 loaf | 45 | 290 | | 20 cm round | 49 | 314 | | 23 cm round | 64 | 415 | | 20x20 cm square | 62 | 400 | Area of a round pan = 3.14 x radius². An 8x8 square and a 9 in round hold almost the same batter. FILE:references/baking-scaling-caveats.md # Scaling caveats ## What scales linearly Flour, sugar, fat, liquids, chocolate, nuts, fruit and (by weight) eggs scale with the factor. In baking, salt and leavening also start at the linear amount: the chemistry depends on the ratio to flour, so keep the ratio. ## Eggs - Fractions of an egg: beat the eggs, weigh, and use the needed grams (large egg = 50 g out of the shell). 3.66 eggs = 3 eggs + 33 g beaten egg (about 2 tbsp). - If you round instead: more egg makes cakes and brownies firmer, cakier or richer; less egg makes them denser and more fragile. Round up for cakes, down for fudgy brownies and cookies when in doubt. - Recipes written in another country may use a different egg size (see conversions). ## Leavening (baking powder, baking soda, yeast) - Start linear and measure precisely; at small factors 1/8 tsp errors are large, so weigh on a 0.1 g scale. - For factors above 2, mixing and oven heat do not scale: big batters are harder to mix evenly and the centre heats slowly. Make separate batches of the original size when you can. - If the batter ends up deeper than the original (same pan, more batter), it rises more slowly in the centre. Do not "fix" this with more leavening; use a wider pan or lower the oven and bake longer. - Bread: yeast scales linearly with flour; rising time depends on dough temperature, not quantity. ## Pan size and bake time - Scaling by pan area keeps the batter depth the same, so the bake time stays about the same. Start checking 5 minutes early. - Same recipe in a different pan: depth ratio = old area / new area. Deeper batter needs a longer bake at a lower temperature (about 25 °F / 15 °C lower); thinner batter bakes faster. - Fill cake pans at most 2/3 full, brownie pans about halfway. - Glass and dark metal pans bake faster at the edges: lower 25 °F / 15 °C. - Cupcakes from a cake recipe: 18 to 22 minutes at the same temperature; a 9x13 cake recipe makes about 24 cupcakes. - Never multiply the bake time by the factor. Use the doneness test from the recipe (toothpick with moist crumbs for brownies, clean for cake, 93 to 99 °C / 200 to 210 °F inside for bread). ## Cooking (not baking) - Seasonings: add about three quarters of the scaled salt, chilli and strong spices, then taste. A bigger pot evaporates differently. - Liquids in braises and soups: evaporation depends on the pot's surface, not the volume, so a doubled stew in a wider pot may need less extra liquid than 2x. - Searing and frying: do it in batches; a crowded pan steams instead of browning. - Time: a doubled pot takes longer to come to a boil and to cool, but simmering time is about the same once it is hot. Roasts depend on thickness, not weight: use a thermometer. - Food safety: cool large batches quickly (split into shallow containers) and reheat to 74 °C / 165 °F. ## Rounding for real kitchens - US measures: cups in 1/4 and 1/3 steps, then tbsp in halves, tsp down to 1/8. Below 1/8 tsp = a pinch. - Metric: grams to 0.5 g below 10 g, 1 g below 100 g, 5 g below 1 kg. - Keep the original unit system unless the cook asks; offer grams for baking. - Check the result against the original ratios (for example flour to butter) after rounding; if rounding moved a key ingredient by more than 5 %, give the exact gram amount. FILE:templates/scaled-recipe.md # <Recipe name>, scaled <from 8x8 pan to 9x13 pan / from 4 to 10 servings> **Factor:** x<1.83> **Makes:** <24 brownies / 10 servings> **Units:** <grams with US measures in brackets> **Pan:** <9x13 in (23x33 cm), lined> **Oven:** <350°F / 180°C (fan 160°C)> **Bake:** <start checking at 20 min; usually 20-25> ## Ingredients | Ingredient | Amount | US measure | |---|---|---| | <unsalted butter, melted> | <205 g> | <3/4 cup + 2 1/2 tbsp> | | <large eggs> | <3 + 33 g beaten (a
출처 · prompts.chat 공개 프롬프트 모음 · 작성 Fatih Kadir Akın — CC0(저작권 포기)로 공개된 원문을 그대로 싣습니다. 한국어 정리 · 실행 결과는 아직 없습니다.