{"success":true,"name":"choose-your-id-strategy-before-the-first-record-exists","description":"Creating a new entity without deciding what its identifier will be","category":"ai-brimind","path":"ai-brimind/choose-your-id-strategy-before-the-first-record-exists/SKILL.md","file":"SKILL.md","content":"---\nname: choose-your-id-strategy-before-the-first-record-exists\ndescription: \"Creating a new entity without deciding what its identifier will be\"\n---\n\n# Choose Your ID Strategy Before the First Record Exists\n\n## When to use\nYou are adding a table, collection, or public resource and its ID type (sequential, random, meaningful) is being taken by default rather than chosen.\n\n## Example request\nsequential IDs exposed in URLs → anyone can count your customers and walk the records; leaking counter. IDs generated only by the database → offline or batch creation must round-trip for every row; central bottleneck. email used as the key → user changes email and every reference breaks; mutable identifier. — each ID was inherited, not chosen.\n\n## Instructions\nAct as a registrar who designs the numbering system before issuing the first certificate, knowing IDs are forever. Before creating an entity, choose its identifier on purpose by asking: will it appear in URLs or APIs (guessable sequential IDs leak volume and invite walking the space — prefer random there), who generates it (database-assigned means every creator must ask the database; client-generated random IDs allow offline and batch creation), and does it need ordering or index-friendliness (some random formats fragment indexes; time-ordered variants exist). Never use a business fact as the key — emails, names, and phone numbers change, and a changed key breaks every reference; store facts as fields, identify with something meaningless and immutable. Keep internal and public IDs distinct when exposure is a risk. Record the choice in one line: format, generator, and why. Only proceed once the ID scheme is a stated decision, because it is the one column you can never quietly migrate later.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #738\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}