{"id":"data2-phone-numbers-to-e164-csv","audience":"small-business","category":"data","track":"data","technique":"examples","level":"beginner","title":"Clean US phone numbers into one format in a CSV block","free":false,"task":"Your customer list has phone numbers typed many ways and your texting tool wants +1 followed by 10 digits. Write one CSV block (one code block) with the header original,clean and one row per number in the same order. Only US numbers with a 10-digit local part are valid; write INVALID for anything else, without guessing missing digits. At most 12 words outside the code.","materialLabel":"Phone numbers as typed (attached to your prompt automatically)","material":"Customer phone column - Bayview Plant Shop (8 values)\n\n1. (415) 555-0132\n2. 415.555.0198\n3. +1 415 555 0144\n4. 4155550107\n5. 555-0123\n6. 1-415-555-0166\n7. +44 20 7946 0958\n8. 415 555 01\n\nContext:\n- The shop is in San Francisco and all customers are in the United States, but one customer lives in London.\n- The texting tool rejects any number that does not look like +1 and then exactly 10 digits.\n- Row 5 has no area code. Row 8 stopped typing early.\n- Keep the row order so the clean numbers can be pasted back beside the originals.\n- Do not use the shop's own area code (415) to fill in a missing area code.","rules":[{"type":"codeBlocks","count":1},{"type":"maxProseWords","max":12}],"mistakes":[{"title":"Filling in the area code","why":"The AI turns 555-0123 into +14155550123.","fix":"Add: \"No area code means INVALID. Don't fill in digits.\"","checks":["r0"]},{"title":"Keeping the UK number","why":"The AI reformats the London number as valid.","fix":"Add: \"Non-US numbers are INVALID.\"","checks":["r1"]},{"title":"Wrong CSV shape","why":"The AI drops the header or reorders rows.","fix":"Add: \"Header original,clean, then 8 rows in the same order.\"","checks":["r2"]},{"title":"Leaving the format to chance","why":"The AI picks its own length and layout unless told the exact shape.","fix":"Add: \"Put the code in exactly 1 code block. Keep the writing outside the code under 12 words.\"","checks":["codeBlocks","maxProseWords"]}],"promptHints":[{"label":"Gives the target format","patterns":["\\+1","10 digits"]},{"label":"Says invalid","patterns":["invalid"]},{"label":"Rules out guessing","patterns":["don.t (fill|guess)","no guess"]},{"label":"Names the header","patterns":["original,clean","header"]},{"label":"Keeps the order","patterns":["same order","8 rows"]}],"hint":"Cleaning rules include what's invalid. Without that the AI repairs numbers it should reject.","mission":"Clean up these phone numbers.","musts":["One CSV block","Format +1 and 10 digits","INVALID, no guessing"],"rubricLabels":["Rows 1, 2, 3, 4 and 6 become +14155550132, +14155550198, +14155550144, +14155550107 and +14155550166","Rows 5, 7 and 8 are INVALID, with no guessed area code or digits","The code block is CSV with the header original,clean and 8 rows in the original order, with the original text copied exactly"]}