Enrich ingredient profiles from a book extract into wiki-ready JSON files. Claude Code does all enrichment inline — no external API key needed. Batched: up to 20 ingredients per LLM response. Prompts user for quality level first. Use when asked to "research", "enrich", "look up ingredient", or "generate profiles".
Generate enriched ingredient JSON profiles from book extract data.
data/book-extracts/ingredients-master.json — from /extract-book-knowledgedata/dedup/*-dedup-report.json — from /dedup-ingredients (to know which are new)data/ingredients/{slug}.json per ingredient, matching schemas/ingredient.schema.json
/research-ingredient # process all new ingredients from dedup report
/research-ingredient salmon # single ingredient
/research-ingredient salmon kale eggs # specific list
python3 << 'PYEOF'
import json, os, re, sys, glob
def slugify(s):
return re.sub(r'[^a-z0-9]+', '-', s.lower()).strip('-')
master = json.load(open('data/book-extracts/ingredients-master.json'))
slug_map = {i['slug']: i for i in master['ingredients']}
name_map = {i['name'].lower(): i for i in master['ingredients']}
NON_FOOD = {'igf-1','igfbp1','insulin','stem cells','mitochondria','ketone bodies',
'blood pressure','blood glucose','c-reactive protein','abdominal fat',
'glycerol','cholesterol','sugar','saturated fats','healthy fats',
'calories','protein','desserts'}
written = {f[:-5] for f in os.listdir('data/ingredients') if f.endswith('.json')}
args = sys.argv[1:]
if args:
targets = args