You ask your AI model to generate a user interface. It spits out a generic, chaotic, completely unbranded mess. You tweak the prompt, you switch to a smarter model, and it still looks like a disjointed Frankenstein monster. You blame the AI for being dumb.
You’re looking in the wrong place.
The bottleneck isn’t the AI’s intelligence; it’s your design system’s blindness.
Traditional design specs are written for humans. They live in Figma files, PDFs, and Notion docs filled with vibes, hex codes, and subjective adjectives. A machine cannot consume a Figma file’s aura. When an LLM looks at your design system, it sees noise. Without a formalized ‘design intent ID card,’ even the most advanced model will produce visually inconsistent and semantically wrong interfaces.
The tension every product manager and designer feels right now is real: you want to leverage AI’s speed, but you’re terrified of losing control of your brand. Give the AI too much freedom, and it breaks your design consistency. Give it too many rigid rules, and it kills adaptability.
So, what’s the fix? It’s not a better prompt. It’s a constitutional upgrade.
You don’t handcuff the AI; you hand it a constitution.
The solution is Schema-As-Code. Specifically, YAML contracts. Instead of writing design rules in natural language that only humans understand, you translate your design intent into machine-readable semantic boundaries. You create a YAML file that acts as the strict, enforceable boundary between your design system and any LLM.
Think of this YAML contract as a ‘design intent ID card.’ It forces you to answer seven brutal questions about every component you build:
1. Who am I? (intent_id) – A structured ID like ERR-001, not a vague title like ‘error stuff’.
2. What problem do I solve? (description) – The symptom, root cause, and user consequence.
3. What version am I? (version) – Semantic versioning for your design logic.
4. Where do I apply? (applicable_products) – Does this rule apply to ChatGPT, Claude, or your internal tools?
5. What semantics do I define? (semantic_tokens) – The core logic.
6. What are my red lines? (immutable_boundaries) – The absolute blockers.
7. What are my hard demands on the AI? (llm_constraints) – Non-negotiable rules.
Let’s look at error states. If you just tell an AI to ‘design an error message,’ it will guess. It might use a calm blue for a fatal system crash, or a terrifying red pulse for a simple network hiccup. It doesn’t know the difference.
A YAML contract changes the game. It defines semantic tokens. A fatal error isn’t just ‘#EF4444’. It’s a semantic token mapped to ‘status.critical’, which mandates a red pulse, an octagon icon, and specific user actions like ‘Refresh’ or ‘Export History’. A transient network error maps to ‘status.neutral’, mandating a spinner and a ‘Wait’ action.
A hex code is a color. A semantic token is a decision.
By defining these tokens, you give the AI the freedom to generate diverse layouts, but you lock the semantic meaning in place. The AI knows exactly when to use urgency and when to use patience.
Then come the immutable boundaries. These are the hard stops. If the AI generates code for a destructive action without a secondary confirmation, the system blocks it. If the AI tries to render a fatal error in static gray, it gets blocked. These aren’t suggestions; they are machine-enforceable laws.
Finally, you set the LLM constraints. You don’t write ‘be friendly.’ You write: ‘Must explicitly inform the user that context may be lost’ and ‘Prohibit displaying vague text like an error occurred.’ These are rules a machine can actually validate.
The role of the designer is shifting. You are no longer just a spec creator. You are a semantic translator. You are the one who builds the bridge between human intent and machine execution.
If your design rules can’t be compiled into code, they are just opinions. And AI doesn’t care about your opinions.
Stop fighting the models. Start writing the rules they are forced to live by.
FAQ
Q: Isn't this just another layer of unnecessary bureaucracy for designers?
A: It's the opposite. It eliminates the endless back-and-forth of 'the AI got it wrong.' By formalizing intent into code, you automate the enforcement. You spend time building the constitution, not policing every single output.
Q: Doesn't this stifle the AI's creativity?
A: It channels it. You lock the semantic boundaries (what the UI must communicate), but leave the layout and micro-interactions open. The AI can explore infinite visual paths as long as it doesn't cross the red lines.
Q: If the AI is so smart, why can't it just read a Figma file and figure it out?
A: Because Figma files are full of human context, vibes, and implicit rules. LLMs don't have your implicit context. Without explicit, machine-readable constraints, the AI is just guessing—and guessing is what causes brand chaos.