All articles
AI Workflow

Integrating Optimistic With Claude

JUN 20, 2026 · 6 min read · Subin

An AI agent is only as good as the context it is given. A design system is unusually good context: a bounded vocabulary of tokens, a known set of components, and explicit rules about how they combine.

Why a system beats a blank page for AI

Ask a model to build UI with no constraints and it invents: new colors, new spacing, a fourth kind of button. That is drift, generated at machine speed. Give it a design system and the space of valid answers collapses to the ones you actually want.

The tokens tell it which values are allowed. The components tell it which parts exist. The rules tell it how they fit. Generation stops being invention and becomes assembly.

Describe
Prompt in plain words
"A pricing card using our tokens and Button."
Generate
System-aware code
Real components, real tokens, no invented values.
Review
Diff and merge
Lint blocks any raw hex that slipped in.
The context you feed it, tokens, components, and rules, is what keeps every generation on-system.
Describe, generate, review. The context you provide is what keeps each generation inside the system.

Make the context machine-readable

Point the agent at the real artifacts: the tokens file, the component source, and a short rules document (style with semantic tokens, compose don't fork, never hardcode a value). Because Optimistic ships as code you own, the agent can read the actual implementations, not a summary of them.

The clearer and more structured that context, the less the model guesses. A good rules file is worth more than a long prompt.

Keep the guardrails in the pipelineAI speeds up the common case; it does not remove the need for verification. Keep the same lint that fails a raw hex in review, and it will catch a stray value whether a human or a model typed it.

The loop, not the one-shot

The value is not a single perfect generation; it is a fast loop. Describe a screen, get system-aware code, review the diff, and refine. Each pass stays on-system because the context does not change between passes.

Run that loop inside a real design system and an agent becomes what it should be: a very fast, very literal teammate who already read your styleguide.

What good context actually contains

Three things earn their place in the context you give an agent. The token vocabulary, so it knows which values are legal. The component inventory with real signatures, so it composes what exists instead of inventing look-alikes. And a short rules file that states the non-negotiables in plain language: semantic tokens only, compose don't fork, never hardcode.

Everything else is noise that dilutes the signal. A tight, current context beats an exhaustive one, because the model weighs what you show it, and showing it stale examples teaches it stale habits.

Constraints are not what slow a model down. They are what make its output usable.On AI and design systems