{"success":true,"name":"define-the-data-shapes-before-the-logic","description":"Starting to code features while the data structures are still fuzzy.","category":"ai-brimind","path":"ai-brimind/define-the-data-shapes-before-the-logic/SKILL.md","file":"SKILL.md","content":"---\nname: define-the-data-shapes-before-the-logic\ndescription: \"Starting to code features while the data structures are still fuzzy.\"\n---\n\n# Define the Data Shapes Before the Logic\n\n## When to use\nYou are about to write logic that passes data around, and the shape of that data is not yet written down anywhere.\n\n## Example request\nthree functions each invent their own 'user object' → field-name drift (userId vs user_id) breaks them against each other; one declared shape ends the drift. an API response consumed by guesswork → every consumer guesses differently; the declared response type is the single contract. a status stored as free strings → 'active', 'Active', 'ACTIVE' become three states; a fixed enum makes it one. frontend and backend built in parallel → without a shared shape they meet in a 400 error; the shape written first is the handshake.\n\n## Instructions\nAct like an engineer who knows that in any system, the data shapes are the constitution and the logic is just enforcement. Before writing feature logic, write down every data shape the feature moves — entities, API request/response bodies, config objects, status enums — in the project's native way (types, interfaces, schemas, or documented structures), each field named and typed once, and then write ALL the logic against those declared shapes in the same response. Shapes cost minutes and are cheap to change while they are still just declarations; the same change after logic is built on fuzzy shapes is a refactor with casualties. Fuzzy shapes are also where parallel work silently diverges — two pieces built on two guesses meet in a runtime error. Keep shapes honest to reality: model the data you actually have, not an aspirational schema for features that do not exist. Reuse and extend shapes the project already defines rather than declaring parallel near-duplicates. End with the shapes listed first and the logic referencing them by name, so the contract is visible and the code provably follows it.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #590\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}