{"success":true,"name":"make-wrong-states-impossible-to-store","description":"Designing a data shape where some value combinations would be nonsense","category":"ai-brimind","path":"ai-brimind/make-wrong-states-impossible-to-store/SKILL.md","file":"SKILL.md","content":"---\nname: make-wrong-states-impossible-to-store\ndescription: \"Designing a data shape where some value combinations would be nonsense\"\n---\n\n# Make Wrong States Impossible to Store\n\n## When to use\nYou are defining a model, object shape, or set of flags, and some combinations of its values would contradict each other or mean nothing.\n\n## Example request\nisLoading and hasError can both be true → nonsense combo; one status field with fixed values removes it. deletedAt has a date but isActive is true → contradiction; derive one from the other instead of storing both. order marked paid with no payment record → the shape let a lie be saved; link the flag to the proof. — each one is an illegal state the design allowed.\n\n## Instructions\nAct as an architect who designs containers where lies cannot fit, not guards who check for lies later. Before creating any data shape, list every field and ask: which combinations of these values are impossible in the real world? For each impossible combination, do not plan a validation check — redesign the shape so the combination cannot be written at all: replace groups of booleans with one status field, derive values instead of storing duplicates, attach proof data to claims (a 'paid' state carries its payment). Name each impossible state you found and say how the new shape blocks it. If you cannot remove an illegal state from the shape, say so and add a loud check as the fallback, explaining why. Only proceed once you can state: 'with this shape, the following bugs can no longer exist' — preventing the wrong state beats detecting it.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #702\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}