{"skills":[{"name":"Calculate trim yield and complete portions","description":"Use actual weighed prep losses to estimate how much to buy and how many full portions a delivery will serve.","content":"# Calculate trim yield and complete portions\n\nUse actual weighed prep losses to estimate how much to buy and how many full portions a delivery will serve.\n\n## When to use this skill\n\n- A chef has weighed a delivery before and after trimming, peeling, boning or cooking and wants the yield percentage.\n- Someone asks how many 160 g cooked portions a 10 kg delivery will give.\n- Someone needs to know how much raw product, or how many packs, to order for a set number of portions.\n\n## When not to use it\n\n- Costing the portion. Use the cost-a-portion-from-pack-prices skill once the yield is known.\n- Promising a future delivery's yield. A measured yield applies to that product, supplier and preparation; re-weigh when any of them changes.\n- Nutrition or allergen declarations, which need the recipe and ingredient specifications rather than a weight yield.\n\n## What you need\n\n- Purchased weight, trim and cooking losses or measured usable weight, with units and preparation stage.\n- Required portion weight at that same stage, target portion count and supplier pack size if ordering.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- What did the product weigh as delivered, and was it weighed in a tub or on a tray? The container's weight comes off before the yield is calculated.\n- At which stage is the portion weight given: raw trimmed, cooked or as served? The yield has to run from purchase to that same stage.\n- If there are several losses, is each a share of the original purchase weight or of what was left after the previous step?\n- What pack size do you buy, and how many portions do you need?\n\n## Method\n\n1. Name the stages: as purchased, after trimming or peeling, after cooking, as served. Note which stage the portion weight refers to and convert every weight to grams.\n2. Get a net weight at each stage. Subtract the container's tare when the product was weighed in it. A figure already recorded as net or tared needs no further deduction.\n3. Apply percentage losses in the order they happen. A loss stated as a share of the previous stage applies to what remains; a loss stated as a share of the purchase weight applies to the original weight.\n4. Yield % = usable weight at the served stage \u00f7 purchased weight \u00d7 100. If the record stops before the served stage, for example a peeled raw weight when portions are cooked, leave yield, portions and order unresolved rather than borrowing a factor. Treat a zero purchase weight the same way.\n5. Full portions = usable weight \u00f7 portion weight, rounded down. Remainder = usable weight minus full portions \u00d7 portion weight, to one decimal gram.\n6. For an order, required served weight = target portions \u00d7 portion weight, and required purchase weight = that \u00f7 (yield % \u00f7 100). Divide by the pack size and round up to whole packs only at the end, using the unrounded yield.\n7. Report the yield as specific to this product, supplier and preparation, and suggest repeating the test when any of them changes.\n\n## Checks before you deliver\n\n- A raw trimmed yield does not answer a cooked-portion question unless the cooking loss is also known.\n- Rounding partial portions upwards promises more meals than the kitchen can plate.\n- Adding a 20% trim loss and a 25% cooking loss of the trimmed weight as 45% gives 55% instead of 60%.\n- Leaving the tub in: 2.3 kg gross with a 300 g tub is 2 kg of carrots, so 1.5 kg trimmed is a 75% yield, not 65%.\n- Multiplying the served weight needed by the yield instead of dividing by it under-orders: 8 kg cooked at 60% needs about 13.3 kg raw, not 4.8 kg.\n\n## How to present the result\n\nLead with the answer in kitchen terms: 'This delivery gives 37 full 160 g portions with 80 g over; order seven 2 kg packs for 50.' Then show a short table of the weight at each stage with its loss and running yield, the portion arithmetic and the order calculation. Say which stage the yield covers and that it applies to this product and preparation.\n\n## Worked example\n\n**Request:** How many portions do we get and how many packs for 50?\n\n**Supplied material:**\n\n```text\n10,000 g purchased. Trim 20% of purchase weight. Cooking removes 25% of the trimmed weight. Serve 160 g cooked portions. Target 50 portions, purchased packs 2,000 g.\n```\n\n**Answer:** Today\u2019s 10 kg delivery gave 6 kg cooked, enough for 37 full 160 g portions with 80 g left. For 50 portions at that yield, order seven 2 kg packs.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nReturn yield_pct (purchased to served stage), full_portions, remainder_g and buy_packs_for_target. Use null where the served-stage yield or pack size is unknown. Round percentages to two decimals and residual grams to one decimal.\n\n## Sources\n\n- [USDA Food Buying Guide, Appendix B: using the yield column](https:\/\/foodbuyingguide.fns.usda.gov\/Content\/TablesFBG\/USDA_FBG_Appendix_B.pdf): Shows how to work from the edible quantity a recipe needs back to the as-purchased quantity by dividing by the yield per pound, then rounding the purchase up so enough food is bought. The skill's ordering step follows this method.\n- [NIST: weighing and scales FAQs](https:\/\/www.nist.gov\/pml\/owm\/faqs\/weighing-and-scales-faqs): Defines tare as the packaging and the gross load as tare plus the net product, and describes a tare operation as finding the net weight. This is why the container's weight is removed before any yield is calculated.\n- [Institute of Child Nutrition: Basic Culinary Math participant's workbook](https:\/\/theicn.org\/resources\/118\/basic-culinary-math-for-school-nutrition-professionals\/106918\/basic-culinary-math-participants-workbook.pdf): Lesson IV explains the difference between as-purchased and edible-portion weights and why buying and costing must use the right one for the stage being served.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/calculate-kitchen-trim-yield\n","scope":"contextual","trigger_keywords":["Calculate trim yield and complete portions","calculate-kitchen-trim-yield","calculate kitchen trim yield","After trimming, how many portions do we get from this delivery?","After trimming, how many portions do we get from this delivery","trim yield","edible yield","kitchen prep yield"],"is_private":true,"is_active":true,"scripts":[{"name":"calculate-kitchen-trim-yield-check","description":"Compare a saved JSON answer with a published test. Pass tests\/case-1\/expected.json (or another case) and the path to your answer.","language":"python","filename":"calculate-kitchen-trim-yield-check.py","content":"from pathlib import Path\nimport runpy\n\nrunpy.run_path(str(Path(__file__).parent \/ 'tests' \/ 'check.py'), run_name='__main__')\n","supporting_files":[{"path":"SKILL.md","content":"---\nname: calculate-kitchen-trim-yield\ndescription: \"Work out edible or cooked yield from weighed prep and cooking losses, how many full portions a delivery gives, and how many packs to order for a target. Use when a kitchen asks about trim yield, edible yield, cooked yield, prep loss or how much raw product to buy for a number of portions.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/calculate-kitchen-trim-yield\n---\n\n# Calculate trim yield and complete portions\n\nUse actual weighed prep losses to estimate how much to buy and how many full portions a delivery will serve.\n\n## When to use this skill\n\n- A chef has weighed a delivery before and after trimming, peeling, boning or cooking and wants the yield percentage.\n- Someone asks how many 160 g cooked portions a 10 kg delivery will give.\n- Someone needs to know how much raw product, or how many packs, to order for a set number of portions.\n\n## When not to use it\n\n- Costing the portion. Use the cost-a-portion-from-pack-prices skill once the yield is known.\n- Promising a future delivery's yield. A measured yield applies to that product, supplier and preparation; re-weigh when any of them changes.\n- Nutrition or allergen declarations, which need the recipe and ingredient specifications rather than a weight yield.\n\n## What you need\n\n- Purchased weight, trim and cooking losses or measured usable weight, with units and preparation stage.\n- Required portion weight at that same stage, target portion count and supplier pack size if ordering.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- What did the product weigh as delivered, and was it weighed in a tub or on a tray? The container's weight comes off before the yield is calculated.\n- At which stage is the portion weight given: raw trimmed, cooked or as served? The yield has to run from purchase to that same stage.\n- If there are several losses, is each a share of the original purchase weight or of what was left after the previous step?\n- What pack size do you buy, and how many portions do you need?\n\n## Method\n\n1. Name the stages: as purchased, after trimming or peeling, after cooking, as served. Note which stage the portion weight refers to and convert every weight to grams.\n2. Get a net weight at each stage. Subtract the container's tare when the product was weighed in it. A figure already recorded as net or tared needs no further deduction.\n3. Apply percentage losses in the order they happen. A loss stated as a share of the previous stage applies to what remains; a loss stated as a share of the purchase weight applies to the original weight.\n4. Yield % = usable weight at the served stage \u00f7 purchased weight \u00d7 100. If the record stops before the served stage, for example a peeled raw weight when portions are cooked, leave yield, portions and order unresolved rather than borrowing a factor. Treat a zero purchase weight the same way.\n5. Full portions = usable weight \u00f7 portion weight, rounded down. Remainder = usable weight minus full portions \u00d7 portion weight, to one decimal gram.\n6. For an order, required served weight = target portions \u00d7 portion weight, and required purchase weight = that \u00f7 (yield % \u00f7 100). Divide by the pack size and round up to whole packs only at the end, using the unrounded yield.\n7. Report the yield as specific to this product, supplier and preparation, and suggest repeating the test when any of them changes.\n\n## Checks before you deliver\n\n- A raw trimmed yield does not answer a cooked-portion question unless the cooking loss is also known.\n- Rounding partial portions upwards promises more meals than the kitchen can plate.\n- Adding a 20% trim loss and a 25% cooking loss of the trimmed weight as 45% gives 55% instead of 60%.\n- Leaving the tub in: 2.3 kg gross with a 300 g tub is 2 kg of carrots, so 1.5 kg trimmed is a 75% yield, not 65%.\n- Multiplying the served weight needed by the yield instead of dividing by it under-orders: 8 kg cooked at 60% needs about 13.3 kg raw, not 4.8 kg.\n\n## How to present the result\n\nLead with the answer in kitchen terms: 'This delivery gives 37 full 160 g portions with 80 g over; order seven 2 kg packs for 50.' Then show a short table of the weight at each stage with its loss and running yield, the portion arithmetic and the order calculation. Say which stage the yield covers and that it applies to this product and preparation.\n\n## Worked example\n\n**Request:** How many portions do we get and how many packs for 50?\n\n**Supplied material:**\n\n```text\n10,000 g purchased. Trim 20% of purchase weight. Cooking removes 25% of the trimmed weight. Serve 160 g cooked portions. Target 50 portions, purchased packs 2,000 g.\n```\n\n**Answer:** Today\u2019s 10 kg delivery gave 6 kg cooked, enough for 37 full 160 g portions with 80 g left. For 50 portions at that yield, order seven 2 kg packs.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nReturn yield_pct (purchased to served stage), full_portions, remainder_g and buy_packs_for_target. Use null where the served-stage yield or pack size is unknown. Round percentages to two decimals and residual grams to one decimal.\n\n## Sources\n\n- [USDA Food Buying Guide, Appendix B: using the yield column](https:\/\/foodbuyingguide.fns.usda.gov\/Content\/TablesFBG\/USDA_FBG_Appendix_B.pdf): Shows how to work from the edible quantity a recipe needs back to the as-purchased quantity by dividing by the yield per pound, then rounding the purchase up so enough food is bought. The skill's ordering step follows this method.\n- [NIST: weighing and scales FAQs](https:\/\/www.nist.gov\/pml\/owm\/faqs\/weighing-and-scales-faqs): Defines tare as the packaging and the gross load as tare plus the net product, and describes a tare operation as finding the net weight. This is why the container's weight is removed before any yield is calculated.\n- [Institute of Child Nutrition: Basic Culinary Math participant's workbook](https:\/\/theicn.org\/resources\/118\/basic-culinary-math-for-school-nutrition-professionals\/106918\/basic-culinary-math-participants-workbook.pdf): Lesson IV explains the difference between as-purchased and edible-portion weights and why buying and costing must use the right one for the stage being served.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/calculate-kitchen-trim-yield\n"},{"path":"LICENSE.txt","content":"Original Raq.com instructions and synthetic examples: CC BY 4.0.\nhttps:\/\/creativecommons.org\/licenses\/by\/4.0\/\nAttribution: Raq.com, https:\/\/skills.raq.com\/skills\/calculate-kitchen-trim-yield\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# Trim and cooking loss\n\nHow many portions do we get and how many packs for 50?\n\n## Supplied material\n\n10,000 g purchased. Trim 20% of purchase weight. Cooking removes 25% of the trimmed weight. Serve 160 g cooked portions. Target 50 portions, purchased packs 2,000 g.\n\n## Worked answer\n\nToday\u2019s 10 kg delivery gave 6 kg cooked, enough for 37 full 160 g portions with 80 g left. For 50 portions at that yield, order seven 2 kg packs.\n\n## Reasoning\n\nTwo successive losses leave 6 kg. The remaining 80 g is not a complete portion.\n"},{"path":"tests\/check.py","content":"\"\"\"Check a saved agent answer locally with Python 3 (standard library only).\"\"\"\nimport json\nimport math\nimport sys\nfrom pathlib import Path\n\n\ndef compare(expected, actual, path=\"$\", accepted=None):\n    if isinstance(expected, bool) or isinstance(actual, bool):\n        if expected is not actual:\n            yield path\n    elif isinstance(expected, (int, float)) and isinstance(actual, (int, float)):\n        if not math.isclose(expected, actual, rel_tol=0, abs_tol=1e-8):\n            yield path\n    elif isinstance(expected, dict) and isinstance(actual, dict):\n        for key in sorted(set(expected) | set(actual)):\n            if key not in expected or key not in actual:\n                yield f\"{path}.{key}\"\n            elif not any(\n                not list(compare(option, actual[key]))\n                for option in (accepted or {}).get(key, [])\n            ):\n                yield from compare(expected[key], actual[key], f\"{path}.{key}\")\n    elif isinstance(expected, list) and isinstance(actual, list):\n        if len(expected) != len(actual):\n            yield f\"{path} (length)\"\n        for i, (left, right) in enumerate(zip(expected, actual)):\n            yield from compare(left, right, f\"{path}[{i}]\")\n    elif type(expected) != type(actual) or expected != actual:\n        yield path\n\n\ndef main():\n    if len(sys.argv) != 3:\n        raise SystemExit(\"Usage: python3 check.py expected.json answer.json\")\n    try:\n        expected, actual = [json.loads(Path(p).read_text(encoding=\"utf-8\")) for p in sys.argv[1:]]\n        alternatives = Path(sys.argv[1]).with_name(\"accepted.json\")\n        accepted = json.loads(alternatives.read_text(encoding=\"utf-8\")) if alternatives.is_file() else {}\n    except (ValueError, OSError) as error:\n        raise SystemExit(str(error))\n    differences = list(compare(expected, actual, accepted=accepted))\n    if differences:\n        raise SystemExit(\"Different fields: \" + \", \".join(differences))\n    print(\"Pass\")\n\n\nif __name__ == \"__main__\":\n    main()\n"},{"path":"tests\/README.md","content":"Give your agent SKILL.md and one request.txt in a fresh session. Keep the expected answer aside. Save the reply as answer.json, then run this from the tests folder:\n\n    python3 check.py case-1\/expected.json answer.json\n\nEach case also has an explanation. Where accepted.json exists, the checker accepts the alternatives listed there.\n"},{"path":"tests\/case-1\/request.txt","content":"How many portions do we get and how many packs for 50?\nReturn only the JSON specified in SKILL.md for this test.\n\n10,000 g purchased. Trim 20% of purchase weight. Cooking removes 25% of the trimmed weight. Serve 160 g cooked portions. Target 50 portions, purchased packs 2,000 g.\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"yield_pct\": 60,\n    \"full_portions\": 37,\n    \"remainder_g\": 80,\n    \"buy_packs_for_target\": 7\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"Two successive losses leave 6 kg. The remaining 80 g is not a complete portion.\n"},{"path":"tests\/case-2\/request.txt","content":"I need the cooked yield and full cooked portions.\nReturn only the JSON specified in SKILL.md for this test.\n\n5 kg bought raw. 4.3 kg left after peeling. No cooked weight or cooking loss recorded. Portions 150 g cooked, target 35, 1 kg packs.\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"yield_pct\": null,\n    \"full_portions\": null,\n    \"remainder_g\": null,\n    \"buy_packs_for_target\": null\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"The observed peeling yield cannot serve as a cooked yield.\n"},{"path":"tests\/case-3\/request.txt","content":"How much trimmed carrot did I get and how many bags for thirty portions?\nReturn only the JSON specified in SKILL.md for this test.\n\nCarrots plus tub 2.3 kg; empty tub 300 g. After trimming, net carrots 1.5 kg. Portion 90 g trimmed. Buy 1 kg bags, target 30 portions.\n"},{"path":"tests\/case-3\/expected.json","content":"{\n    \"yield_pct\": 75,\n    \"full_portions\": 16,\n    \"remainder_g\": 60,\n    \"buy_packs_for_target\": 4\n}\n"},{"path":"tests\/case-3\/explanation.txt","content":"The carrots weighed 2 kg before trimming. At 75% yield the order needs 3.6 kg raw, which requires four bags.\n"}],"is_active":true,"is_approved":false}]}]}