← Back to patterns
build

The Stateless AI Generation Trap

TRIGGER

AI prototyping tools were generating code that violated design system standards—using wrong components, ignoring design tokens, and misinterpreting complex UI requirements—because each prompt started from scratch without awareness of existing design constraints.

APPROACH

Atlassian's design team created instruction files (text files with explicit override rules) and template pages with pre-coded elements that AI cannot modify. When prototyping, they feed a Figma page containing locked design system components alongside open areas for AI interpretation. The instruction file specifies rules like 'use only these design components in navigation areas' even when the AI's default framework (Tailwind) would suggest alternatives. They copy-paste reusable prompt fragments ('recipes') for common patterns like dark mode switches. Input: Figma template with locked regions + instruction file + designer prompt. Output: Functional prototype that respects design system constraints.

PATTERN

Each prompt starts fresh—the AI forgets your design system exists. Prompt engineering has diminishing returns when the real issue is statelessness. Create instruction files and template pages with locked components that inject your constraints into every generation.

WORKS WHEN

  • Design system has documented, reusable components that can be expressed as code snippets or references
  • Team builds similar UI patterns repeatedly (dashboards, forms, settings pages) where templates amortize setup cost
  • Prototypes need to match production design closely enough for screenshot-to-code workflows
  • Organization has 5+ designers who need consistent AI output without per-person prompt tuning

FAILS WHEN

  • Exploratory design phase where constraints should be loose and creativity prioritized over consistency
  • Design system is still evolving rapidly, making template maintenance overhead exceed time savings
  • One-off prototypes where template setup time exceeds manual coding time
  • AI tool doesn't support instruction file injection or template locking mechanisms

Stage

build

From

January 2026

Want patterns like this in your inbox?

3 patterns weekly. No fluff.