{"id":"ops-weekly-report-kpis-to-json","audience":"analysts","category":"operations-work","track":"operations","technique":"format","level":"intermediate","title":"Pull weekly KPIs from a narrative report into typed JSON with nulls","free":false,"task":"Write a prompt for exactly one code block holding a JSON object with these keys in this order: week, otif, dock_to_stock_minutes, overtime_hours, inventory_accuracy, safety_recordables. week is the string \"W12\". otif is a fraction (0.94, not 94). dock_to_stock_minutes converts hours to minutes. Other numbers are plain numbers, not strings. Use null for anything the report does not give. No text outside the block.","materialLabel":"Your material (attached to your prompt automatically)","material":"OPS WEEKLY - Week 12 (Mar 17 to Mar 23)\n\nSummary from the dock manager:\nOn-time-in-full came in at 94 percent, which is our best week this quarter. Dock-to-stock time averaged 5.8 hours. Overtime was 176 hours across the building, mostly from the Monday carrier delay.\n\nInventory accuracy is still being counted by the cycle count team; the number will arrive on Tuesday.\n\nSafety: no recordable injuries this week, and one near miss in aisle 7 that is being reviewed. The safety coordinator will send her own report.\n\nLast week was week 11 with OTIF of 91 percent and overtime of 150 hours, included here only for comparison.","rules":[{"type":"codeBlocks","count":1},{"type":"maxCodeLines","max":10},{"type":"maxProseWords","max":5}],"promptHints":[{"label":"Lists the exact keys","patterns":["otif","dock_to_stock_minutes","inventory_accuracy","safety_recordables"]},{"label":"Gives the conversions","patterns":["fraction","0\\.94","x 60","minutes"]},{"label":"Uses null for missing","patterns":["null","not stated","missing"]},{"label":"Asks for one JSON block","patterns":["json","code block","one code block"]}],"mistakes":[{"title":"Guessing the missing value","why":"The AI fills in inventory accuracy with a plausible number.","fix":"Say: \"Use null for anything the report does not state.\"","checks":["r2"]},{"title":"Not converting units","why":"The AI writes 94 and 5.8 as in the report.","fix":"Say: \"otif is a fraction (0.94); convert hours to minutes (5.8 x 60 = 348).\"","checks":["r1","r0"]},{"title":"Using last week's figures","why":"The AI picks up 91 or 150 from the comparison.","fix":"Say: \"Use week 12 figures only.\"","checks":["r2"]},{"title":"Extra text around the code","why":"The AI adds explanations, extra blocks or comments around the output.","fix":"Say \"exactly one code block, nothing else\" and cap the rows.","checks":["codeBlocks","maxCodeLines","maxProseWords"]}],"hint":"List the keys in order, give the unit conversions, and say what to do when a value is missing.","mission":"Capture the weekly ops KPIs in comparable units.","musts":["One JSON object","OTIF as fraction","Hours become minutes"],"rubricLabels":["The output is one code block with a JSON object containing exactly the keys week, otif, dock_to_stock_minutes, overtime_hours, inventory_accuracy and safety_recordables in that order","week is the string \"W12\", otif is 0.94, dock_to_stock_minutes is 348 (5.8 hours x 60), overtime_hours is 176 and safety_recordables is 0, with the numbers written as numbers rather than strings","inventory_accuracy is null because the report does not give it, and none of the week 11 figures (91 or 150) are used"]}