Generating UI with AI feels magical until you copy the code into your repository and realize it takes forty minutes to untangle arbitrary hex codes, foreign spacing scales, and bespoke buttons. v0 by Vercel excels at assembling React and Tailwind layouts in seconds. But by default, v0 behaves like a freelancer who never read your brand guidelines: it defaults to literal utility classes (bg-blue-600, text-gray-900, rounded-xl) and reinvents baseline primitives instead of reusing your existing components.
At 365Finds, our stance is straightforward: if an AI code generation tool forces your engineering team to spend more time refactoring classes than writing logic, it is failing at its core commercial value proposition. To make v0 respect your design tokens and naming conventions, you cannot rely on casual conversational English. You must treat prompt architecture as an engineering interface.
Here is how we configure v0 to consistently adhere to existing design system tokens, CSS variables, and component conventions—and where the system still requires strict guardrails.
Why v0 Drifts Away from Your Design Tokens
To fix token drift, you have to understand what causes it.
v0 is tuned heavily on the standard shadcn/ui ecosystem, Next.js App Router patterns, and raw Tailwind CSS. When you give v0 a generic prompt like "Create a user profile billing card", its underlying model predicts tokens based on the vast sea of public Tailwind code. It picks bg-white, border-gray-200, and rounded-lg because those are statistically dominant in its training corpus.
If your design system uses semantic variables (such as bg-card, text-muted-foreground, or custom tokens like var(--brand-primary) and rounded-subtle), v0 will ignore them unless you explicitly:
- Strip away its default preference for literal color utilities.
- Provide a strict semantic dictionary directly in the context.
- Lock down component invocation syntax using existing primitives rather than raw HTML tags.
The Three-Tier Prompt Injection Architecture
Relying on a single massive prompt every time you ask for a component is exhausting and error-prone. At 365Finds, we structure prompt constraints across three distinct tiers:
┌────────────────────────────────────────────────────────┐
│ Tier 1: Persistent Workspace Rules │
│ (v0 Custom Instructions / Project Knowledge) │
├────────────────────────────────────────────────────────┤
│ Tier 2: Component & Token Contract │
│ (Semantic mapping, CSS variables, forbidden classes) │
├────────────────────────────────────────────────────────┤
│ Tier 3: Feature Task Prompt │
│ (Specific UI layout, mock data, interaction states) │
└────────────────────────────────────────────────────────┘
1. Tier 1: Workspace & Project Knowledge (Set Once)
Do not paste your whole tailwind.config.ts into every single prompt message. Instead, place persistent rules into v0's Custom Instructions (under Account Settings) or inside Project Knowledge (Project -> Knowledge):
- Enforce the stack: Specify Next.js (App Router), TypeScript, Tailwind CSS, Lucide React icons, and
shadcn/ui. - State the golden rule: "Never use literal color names (e.g.,
text-black,bg-gray-100,border-slate-200). Always use theme-based semantic tokens."
2. Tier 2: The Semantic Token and Primitive Contract
Before asking for a screen, define your project's design vocabulary. If you are using shadcn/ui or CSS variables in Tailwind, summarize your active tokens in a clean, tokenized contract block.
3. Tier 3: The Feature Task Prompt
This is where you describe the actual widget or screen. Because Tier 1 and Tier 2 provide the stylistic boundaries, your task prompt can focus cleanly on user flows, accessibility, and hierarchy.
The Master Production Prompt Template
Here is the exact prompt structure 365Finds recommends using when initiating a UI task where token fidelity is mandatory:
### System Context & Design System Contract
You are building production React (TypeScript) components. You must strictly adhere to our custom design system tokens and conventions.
#### 1. Forbidden Classes (Negative Rules)
- DO NOT use literal colors: `bg-white`, `bg-black`, `text-gray-*`, `border-slate-*`, `bg-blue-*`.
- DO NOT use hardcoded hex values or arbitrary Tailwind brackets (e.g., `bg-[#1a1a1a]`, `w-[320px]`).
- DO NOT write raw HTML `<button>`, `<input>`, or `<select>` tags when an existing UI primitive exists.
#### 2. Mandatory Semantic Tokens
Map all styling strictly to our CSS variable utility tokens:
- Canvas & Surfaces: `bg-background`, `bg-card`, `bg-muted`, `bg-popover`
- Typography: `text-foreground`, `text-muted-foreground`, `text-primary`, `text-card-foreground`
- Borders & Dividers: `border-border`, `divide-border`
- Interactive & Brand: `bg-primary text-primary-foreground`, `bg-secondary text-secondary-foreground`, `hover:bg-accent hover:text-accent-foreground`
- Form States: `border-input`, `ring-ring`, `focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`
- Radii: strictly adhere to `rounded-md` (cards) and `rounded-sm` (buttons/inputs). Never use `rounded-2xl` or `rounded-full` (except circular avatars).
#### 3. Component Reusability & Imports
Assume standard `@/components/ui/*` path aliases:
- Use `<Button variant="default | outline | secondary | ghost" size="sm | default | lg">`
- Use `<Badge variant="outline | secondary">`
- Use `<Card>`, `<CardHeader>`, `<CardTitle>`, `<CardContent>`, `<CardFooter>`
- Icons: Import strictly from `lucide-react` using `className="h-4 w-4"` or `className="size-4"`.
---
### UI Task Request
Build a responsive "API Usage & Billing Quota" card. It should show:
- Monthly plan name with an active badge.
- Progress bar displaying consumed API units versus total quota.
- Cost estimate calculation.
- An alert box warning the user if usage exceeds 85%.
- Upgrade CTA button and a secondary link to view raw usage logs.
Concrete Comparison: Good Prompting vs. Default Output
To see the real-world impact on code maintenance, compare the component code generated under default conditions versus our constrained contract:
| Dimension | Default Unconstrained v0 Prompt | Structured Token-Constrained v0 Prompt |
|---|---|---|
| Surface Styling | className="bg-white border border-gray-200 shadow-sm" | className="bg-card text-card-foreground border-border shadow-sm" |
| Text Hierarchy | className="text-gray-900 font-bold", text-gray-500 | className="text-foreground font-semibold", text-muted-foreground |
| Dark Mode Support | Broken. Requires manual addition of dark:bg-slate-900 | Native. Follows CSS variables automatically across themes |
| Button Implementation | <button className="bg-blue-600 px-4 py-2 text-white"> | <Button variant="default">Upgrade Plan</Button> |
| Maintenance Overhead | High; full manual regex or refactor required | Minimal; ready to paste directly into your Next.js repo |
Managing Multi-Turn Iteration Without "Token Drift"
One of v0's most frustrating habits is context regression. In prompt 1, it follows your tokens faithfully. By prompt 3 (e.g., "Make the card look a bit warmer and add a badge"), v0 forgets the negative constraints and introduces bg-amber-50 or text-amber-700.
To prevent this drift across chat revisions:
- Avoid purely visual descriptions: Never say "Make the button darker blue." Say "Switch the button variant to
defaultwithbg-primary." - Anchor the token constraint in your feedback: When requesting a revision, include a one-line reminder: "Ensure all additions continue to use exclusively semantic tokens (
border-border,bg-muted) without literal color utilities." - Use v0's Inline Editing / Selector Tool: Rather than asking the conversational model to rewrite the entire component tree, highlight the specific JSX block and prompt only on that fragment. This prevents the model from regenerating the entire file and re-introducing bad classes elsewhere.
The Realistic Limits: What v0 Still Cannot Do
365Finds does not believe in AI hype that ignores developer friction. While v0 can adhere remarkably well to Tailwind-based semantic tokens, it has clear structural limitations:
- No real runtime awareness of private npm packages: If your organization maintains a proprietary closed-source design system (e.g.,
@acme/design-systemhosted on a private registry), v0 cannot inspect the TypeScript types or bundle unless you configure team-level private registry access or provide complete component signature definitions inside Project Knowledge. - Complex CVA (Class Variance Authority) hallucinations: When asked to synthesize multi-variant components from scratch, v0 occasionally hallucinates non-existent variant prop names (e.g.,
variant="danger"instead ofvariant="destructive"). Always supply your exact variant enum values. - Animation token blind spots: v0 frequently defaults to arbitrary timing (
duration-300 ease-in-out) rather than honoring custom Framer Motion variants or design system motion tokens (transition-all duration-[var(--transition-duration)]).
365Finds Recommendation: Establish a Three-Step Workflow
If your engineering organization is adopting v0 to accelerate frontend delivery, here is our operational verdict:
- Document your design tokens in
llms.txtor a markdown cheat sheet: Keep a clean, 50-line summary of your theme tokens, radius scales, and core component signatures. Store this in your repository and copy it directly into v0 Project Knowledge. - Treat Negative Prompting as mandatory: AI models respond better to explicit exclusions than polite suggestions. Banning
bg-whiteand hardcoded colors is 80% of the battle. - Run automated linter gates upon export: Do not rely on human memory. Set up an ESLint rule (such as
no-restricted-syntaxor Tailwind CSS linting plugins) in your CI pipeline that fails the build if literal utility colors are committed to feature branches.
By treating v0 not as an autonomous designer, but as a rapid scaffolding engine governed by strict token contracts, you eliminate hours of wasted refactoring and keep your codebase consistent.