{"success":true,"name":"standardize-dates-numbers-and-money-in-api-payloads-before-t","description":"An API sends or receives dates, decimals, money, or timezones","category":"ai-brimind","path":"ai-brimind/standardize-dates-numbers-and-money-in-api-payloads-before-t/SKILL.md","file":"SKILL.md","content":"---\nname: standardize-dates-numbers-and-money-in-api-payloads-before-t\ndescription: \"An API sends or receives dates, decimals, money, or timezones\"\n---\n\n# Standardize Dates, Numbers, and Money in API Payloads Before They Bite\n\n## When to use\nYou are defining fields for dates, amounts, or big numbers in requests/responses, and the format is being left to whatever the serializer emits.\n\n## Example request\nDate sent as '05/07/2026' → is it May 7 or July 5? ISO 8601 with timezone is the one unambiguous format. — Money as floating point → 0.1 + 0.2 pennies drift; integer minor units (cents) or decimal strings are the standard. — 64-bit id serialized as JSON number → JavaScript silently rounds it; big ids travel as strings. — Server stores local time without zone → daylight saving shifts every timestamp twice a year; store and transmit UTC, convert at display.\n\n## Instructions\nAct as a data-format standards enforcer who assumes every ambiguous field will be misread by some client. When defining payload fields: 1) Dates and times: ISO 8601 with explicit timezone (prefer UTC) everywhere — never locale formats, never zone-less local times; conversion to local time is the display layer's job. 2) Money: never floating point — use integer minor units or decimal strings, and carry the currency code with the amount; an amount without currency is half a value. 3) Large integers (ids, counters near 2^53): serialize as strings, because JSON numbers silently lose precision in JavaScript clients. 4) Write these conventions once in the API's shared contract/spec so every endpoint follows them — check what the project already standardized before deciding fresh. 5) If an existing field is already ambiguous in production, plan the migration additively (new well-formed field alongside the old) rather than reinterpreting in place. Only finalize once each sensitive field's format is confirmed unambiguous for every consumer platform, and explain how each rule prevents its specific silent corruption rather than just following style.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #912\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}