Expert soap recipe formulation, troubleshooting, and educational guidance for cold process (CP), hot process (HP), bar soap (NaOH), and liquid soap (KOH). Use when the user asks to: (1) formulate or generate a soap recipe, (2) troubleshoot soap problems ("why is my soap soft/crumbly/not lathering/getting DOS"), (3) substitute or compare oils, (4) review or improve an existing recipe, (5) get formulation advice on fatty acid balance, superfat levels, or additive choices, or (6) learn about soap making chemistry and techniques. Do NOT use for melt-and-pour soap, syndet bars, or cosmetic regulatory questions.
If the user's request involves formulation, chemistry, fatty acid selection, additive choices, or troubleshooting soap behavior, read references/soap-formulation-expert-reference.md first. It contains condensed expert knowledge on fatty acid profiles, additive interactions, and formulation archetypes.
If the request specifically involves superfat oil selection, HP post-cook additions, DOS/rancidity prevention, or oxidation stability, also read references/superfat-guide.md. It covers superfat tradeoffs (stability vs. sensory vs. lather), base-superfat interactions, and stabilization strategies in depth.
Skip the reference files for simple requests like "make me a soap label" or "write product descriptions for my soap line."
soap-calc PackageThis project contains a full-featured soap calculator. Use the package tools instead of doing manual calculations. The package handles SAP values, lye calculations, property estimation, and validation — all from its built-in oil database.
data/oils.json — built-in library of common oils with SAP values and fatty acid profilesdata/additives.json — common soap additives with usage rates and notesexamples/ — reference recipe filesschemas/ — validation schemas for recipes (recipe.schema.json), oils (oils.schema.json), and additives (additives.schema.json)~/.soap_calc/oils.jsonThe soap-calc command is available after installing the package (pip install -e .).
| Command | Usage | Purpose |
|---|---|---|
calculate | soap-calc calculate recipe.yaml | Calculate lye, water, and measurements; display results |
export | soap-calc export recipe.yaml -o report.md | Generate a detailed Markdown recipe sheet |
validate | soap-calc validate recipe.yaml | Check recipe for warnings and issues |
list-oils | soap-calc list-oils "coconut" | Search/list oils in the built-in database |
scale | soap-calc scale recipe.yaml 1000 -o scaled.yaml | Resize recipe to a target oil weight |
--oil-weight {grams} with calculate or export to override the recipe's default oil weight.-o {path} with export and scale to write output to a file.For Python API usage and writing recipe files, consult references/api-guide.md. It includes a schema-driven workflow for generating valid recipe JSON/YAML from schemas/recipe.schema.json.
When a user asks you to formulate a recipe, follow this workflow:
soap-calc list-oils or use search_oils() to confirm oil names and verify SAP values are available.references/api-guide.md. Save to the examples/ directory or the user's requested location.soap-calc validate {file} to check for issues.soap-calc calculate {file} to get exact lye, water, and oil amounts.soap-calc export {file} -o report.md to generate a printable recipe sheet.Never manually calculate lye amounts when the package is available. The oil database has verified SAP values. Use calculate() or the CLI to get exact, safe lye figures.
When generating a soap recipe, always include:
soap-calc package for all lye calculations. The built-in oil database has verified SAP values.~/.soap_calc/oils.json or verify with an external calculator (SoapCalc, Soapee).Always include safety notes when generating recipes or process instructions:
"Help me formulate a soap for [goal]" → Read reference file. Start from the closest archetype recipe, then adjust fatty acid targets to match the goal. Write a recipe file, validate it, and calculate it with the package. Explain tradeoffs.
"Why is my soap [problem]?" → Read reference file. Map the symptom to likely causes (e.g., soft bar → too much oleic/not enough palmitic/stearic, or insufficient cure time; DOS → high polyunsaturates + no chelator/antioxidant). For DOS/rancidity specifically, also read references/superfat-guide.md for oxidation system analysis. If the user provides a recipe file, run soap-calc validate and soap-calc calculate to get concrete data.
"What should I use for superfat?" / "Which oil for post-cook HP?" → Read references/superfat-guide.md. Match recommendation to the user's base oil profile (high-lauric, high-stearic, high-oleic, or high-PUFA) using the base-superfat strategy table. Recommend from Bucket 1 (high-impact, stable) by default. Flag stability concerns for PUFA-heavy picks.
"What oil can I substitute for [oil]?" → Use soap-calc list-oils to look up fatty acid profiles. Match by fatty acid profile, not by oil name. Two oils with similar fatty acid breakdowns are interchangeable.
"Review my recipe" → Run soap-calc validate and soap-calc calculate on the recipe file. Check fatty acid balance against the targets in the reference file. Flag if cleansing is too high (>20% lauric+myristic without high superfat), if polyunsaturates are risky (>15% linoleic+linolenic without chelator), or if the bar will be too soft or too hard.
references/soap-formulation-expert-reference.md — select the "gentle face/baby" archetype as starting point, adjust toward a more balanced everyday bar.soap-calc list-oils "olive" and soap-calc list-oils "coconut" to confirm exact database names.references/api-guide.md (read schema, reference example, generate, validate).soap-calc validate recipe.json — fix any warnings.soap-calc calculate recipe.json — present lye/water/oil weights.soap-calc export recipe.json -o report.md.references/soap-formulation-expert-reference.md — identify DOS (Dreaded Orange Spots) as rancidity from high polyunsaturates.references/superfat-guide.md — analyze both layers of oxidation risk (superfat pool + soap matrix) and base-superfat combo stability.soap-calc calculate and check linoleic + linolenic totals.data/additives.json.soap-calc list-oils "palm" to get the fatty acid profile of Palm Oil.soap-calc list-oils "tallow" etc. to confirm database names and compare SAP values.The project includes an Inventory Management skill (skills/inventory/SKILL.md) that saves a validated inventory.md file listing the user's available oils and additives.
Only use the inventory when the user explicitly asks. Look for phrases like:
When inventory is requested:
./inventory.md (current directory) first~/.soap_calc/inventory.md (user default)If the user does NOT mention their inventory, ignore inventory.md entirely and formulate from the full database as usual.
For these topics, answer from general knowledge or recommend the user consult specialized resources.