UX Invariants for AI-powered Software Engineering
Build faster with AI,without breaking UX fundamentals.
A framework-agnostic set of enforceable UX invariants that constrain LLM behavior and prevent usability regressions in AI-generated user interfaces.
Observed Failure Modes in LLM-Generated Interfaces
LLMs can generate functional UI code in seconds. They also reliably:
- Break interaction consistency
- Ignore accessibility edge cases
- Introduce silent UX regressions
- Optimize for syntax rather than human behavior
Speed without guardrails compounds UX debt.
UX Invariants as Guardrails
UX Invariants are non-negotiable rules that define what must always be true in a user interface,regardless of framework, stack, or AI agent.
- Behavioral guardrails for LLMs
- A shared UX contract between humans and machines
- Lightweight UX governance without a design system
This is UX as infrastructure.
What You Get
A curated, production-tested set of UX invariants expressed in plain Markdown, designed for direct use in AI-assisted workflows.
Includes invariants covering:
- Core interaction behavior
- Accessibility and affordances
- Error handling and recovery
- System state, feedback, and latency
- Common UX failure modes and anti-patterns
No tooling lock-in. No proprietary formats.
Where It Fits
UX Invariants operate below prompts and above code.
- Context during LLM code generation
- Agent instructions (AGENTS.md)
- PR review and human QA rubrics
- CI-adjacent validation (manual or automated)
Start enforcing UX at generation time. Harden enforcement later if needed.
Why Invariants (Not Guidelines)
Guidelines are optional. Invariants are enforced.
- Deterministic expectations
- Clear failure conditions
- Easier evaluation by humans and machines
- Stable across prompts, tools, and agents
If a rule can’t be evaluated, it will be ignored.
Not Another Prompt Pack
Prompt packs help you talk to AI. UX Invariants control what AI ships.
UX Invariants vs Prompt Packs
Prompt packs optimize how you ask. UX Invariants define what must be true.
Prompt packs:
- Are brittle and context-dependent
- Drift as prompts evolve
- Encode instruction, not outcome
UX Invariants:
- Persist across prompts and agents
- Define non-negotiable outcomes
- Improve results regardless of prompt quality
UX Invariants vs Design Systems
Design systems define components. UX Invariants define behavior.
Design systems:
- Are framework- and brand-specific
- Assume human implementation
- Break down under AI-generated code
UX Invariants:
- Are framework-agnostic
- Apply before components exist
- Constrain AI behavior directly
They complement design systems,they don’t replace them.
Why Not Just Ask an AI to Generate UX Rules?
You can. What you’ll get is a plausible-sounding list of guidelines,many of which will be vague, unenforceable, or harmful in production.
UX Invariants are not generated. They are distilled from repeated failure, enforced tradeoffs, and long feedback loops.
The value is not the words. It’s the judgment encoded in what’s included,and what’s deliberately excluded.
AI can generate rules. It can’t tell you which ones survived reality.
Who It’s For
- Solopreneurs shipping AI-generated UI without a design team
- Technical founders balancing speed and product quality
- Senior engineers responsible for long-term UX integrity
If you use LLMs to build interfaces, these invariants are for you.
About the Author
Authored by a senior frontend engineer with over 25 years of experience designing, building, and maintaining production user interfaces.
These UX invariants are distilled from real failure modes encountered across decades of UI development,now amplified by AI-generated code.
The goal is simple: enable speed without surrendering usability.
Licensing & Pricing Signals
UX Invariants are licensed, not subscribed to.
- One-time purchase
- Stable, versioned rule set
- Intended for production systems
- Individual, team, and organization licenses
This is infrastructure-grade UX judgment, not consumable content.
Invariant Excerpts
Example invariant structure, rendered as a spec-like block.
Invariant: Primary actions are never hidden behind hover-only controls.
Rationale: Hover-only affordances fail on touch devices and are invisible to keyboard users.
Violation: A table shows actions only on row hover, with no alternative access.
Enforcement: Provide a visible action column or contextual menu trigger at all times.Ship AI-Generated UI Without Shipping UX Regressions
Enforce UX invariants now. Formalize enforcement later.
Get the UX Invariants →