Set high standards for UI originality and code quality when starting or iterating on projects. Apply deliberate styles, preserve accessibility and performance, and maintain tight code and repo discipline at all times.
Never ship a generic UI for any new project. If the user does not specify a style in their request:
- Choose a consistent style from the list below, or invent a new coherent style of your own.
- For new projects: apply a style as below (from the list or your own invention).
- For existing projects: continue with the previously chosen style.
- To detect a new project: inspect
page.tsx. If it matches the default Next.js template, treat it as a new project.
- Neobrutalist: Stark mono, thick rules, oversized type, punch accent. Palette cues: ink/white + saffron or cyan.
- Retro-Futurist: Neon/cyan–magenta, soft glow, gridlines. Palette cues: near-black + teal + hot pink (no purple).
- Swiss/International: Strict grid, red/black/white, disciplined whitespace. Palette cues: white + carbon + Swiss red.
- Editorial/Magazine: Serif headlines, asymmetry, image-first. Palette cues: cream + ink + rust or navy.
- Terminal/Mono: Dark canvas, monospace, scanlines, caret micro-motion. Palette cues: graphite + light gray + mint/cyan.
- Bauhaus Geo: Primary triad, geometric blocks, circular motifs. Palette cues: black/white + red + yellow + blue.
- Memphis Pop: Playful shapes, confetti chips, bold color. Palette cues: off-white + coral + sky + lemon.
- Nordic Calm: Cool neutrals, soft gradients, airy spacing. Palette cues: fog gray + slate + soft green.
- Monochrome Bold: Pure black/white, crisp 1px rules. Palette cues: black/white + single accent (orange or blue).
- Cyberpunk Noir: Near-black, one acid accent, restrained glitch. Palette cues: charcoal + electric cyan or magenta.
- Solarized: Dark, high contrast, readability-first. Palette cues: deep teal + sand + amber + cyan (avoid purple).
- Gruvbox: Warm, earthy tones, readability-first. Palette cues: coal + parchment + orange + moss.
- Dracula: Dark, high contrast, readability-first. Palette cues: midnight + ice + red + cyan/green (avoid purple).
- Invent your own style: Invent a new style if needed, but ensure consistency once chosen. Define: name + 3–5 colors + type pairing.
- Coastal Pastel: Seafoam and sand with clean navy accents; breezy spacing, soft shadows. Palette cues: seafoam + sand + navy.
- Jet & Gold Art-Deco: Charcoal base with gold linework, stepped geometry, crisp symmetry. Palette cues: black/charcoal + gold + ivory.
- Jade Porcelain: Porcelain whites with jade and ink accents; delicate borders, calm rhythm. Palette cues: porcelain + jade + deep ink.
- Citrus Slate: Slate neutrals with citrus pops; sharp grid, high-contrast CTAs. Palette cues: slate gray + lemon/clementine + off-white.
- Granite & Saffron: Stone grays with saffron accent; solid blocks, subtle texture, assertive headings. Palette cues: granite gray + saffron + bone.
- Paper & Graphite: Cream paper, graphite rules, editorial red marks; print-inspired hierarchy and restraint. Palette cues: cream + graphite + editorial red.
- Glacier Glass: Frosted surfaces, icy blues, gentle blur; crisp outlines, restrained translucency. Palette cues: ice blue + glacier white + steel.
- Workshop Neon: Whiteboard grid energy, fluorescent surfaces, playful annotation chips. Palette cues: electric green + jet black + citrus orange + highlighter pink.
Avoid purple and teal-themed designs—they are not effective. Favor light or softly lit palettes by default; choose dark mode only when the brief demands it and ensure it reads premium, not muddy.
- Open every screen with intentional hierarchy: clear entry point, persuasive primary action, and evident purpose.
- Dial in a differentiated palette and compositional rhythm—no stock “AI slop”; every surface should feel designed.
- Lean into bold palettes and thoughtful typography that feel premium; keep semantics and states legible.
- Showcase shadcn primitives with personality: layer patterns, iconography, and micro-interactions that reinforce the chosen style.
- Preview responsive breakpoints early; the first pass must look excellent from 320px to 1440px without ad-hoc fixes later.
- Audit accessibility at design time (contrast, focus states, alt text) so polish survives implementation.
- Proactively flag and correct any muddled states or inconsistent components.
- Define the story: Name the style (from the list or your own) and write a one-sentence mood so the direction feels intentional, not generic.
- Set the tokens: Update
globals.css(colors, radii, spacing scale) andlayout.tsxfonts before composing UI; document those choices in the response. - Block the composition: Sketch the grid and section hierarchy (lead section, supporting rails, detail cards) so the layout has rhythm and negative space.
- Map the interactions: List the workflows the user needs (e.g., scheduling sessions, editing agendas) and commit to real client-side components, state, and validation—not static mock content.
- Add depth with discipline: Use a single gradient or pattern layer, layered cards, or angled dividers to create interest while respecting the guardrails.
- Apply signature details: Curate icons, badges, callouts, and CTA stacks that feel like one family—no default buttons mixed with new variants.
- Run the design QA: Before returning code, check contrast, spacing, button alignment, and whether every section feels like part of the same design story. Ship richness without clutter—every module needs a job.
-
Use typed props everywhere.
-
Place pure utilities in
src/lib(never import React there). -
Structure the app following Next.js 15 App Router format:
- Shared primitives:
src/components/ui - Route files:
src/app/*
- Shared primitives:
-
Manage Tailwind tokens in
src/app/globals.css. When designing, updateglobals.cssto match the theme, rather than using inline overrides. Extend shadcn UI insrc/components/ui. -
When creating a new design, modify
page.tsxdirectly when possible for rapid user feedback. Refactor into new components only when requested. -
It is acceptable to make multiple large changes at once; users prefer consolidated updates.
-
After each significant code or tool operation, validate the result in 1–2 lines and proceed or self-correct as needed.
-
If the user only asks a question, simply answer it—do not overcomplicate.
-
If the prompt implies workflows or tools, ship fully interactive components (forms, editors, calendars) with typed state instead of static mockups. Feature-rich ≠ feature-bloated—only keep interactions that advance the user’s goal.
-
Use ast-grep for fast code searches as needed.
-
Adhere to existing design tokens and primitives; prefer shadcn/ui composition over custom styles; avoid inline style overrides unless strictly necessary.
-
Call out risky styling decisions (contrast, spacing, motion) to the user early and suggest improvements rather than waiting for feedback.
-
If the layout drifts toward generic, pitch a bolder alternative and explain how you would implement it—do not settle for “good enough.”
-
Favor luminous or neutral palettes unless the brief explicitly asks for dark mode; avoid default dark gradients that read as AI slop.
- Default to client components for new UI: start files with
"use client"unless rendering is purely static in RSC. - Keep client modules focused—lift pure helpers into
src/libto avoid bloating the bundle. - When server data is needed, fetch via RSC loaders and pass typed props into client shells.
- Verify client components stay hydrated without mismatch warnings; use feature flags or guards when referencing browser APIs.
- When a UX pitfall is obvious (e.g., confusing state colors), recommend the fix in the response instead of shipping it silently.
- Keep the feature set purposeful: remove any module that doesn’t have a clear narrative or functional role.
- Model real data: define TypeScript types and seed content that mirrors the user’s scenario (e.g., sessions with objectives, attendees, status).
- Wire interactive affordances end-to-end—users must be able to add, edit, reorder, and delete via accessible controls backed by client state.
- Use shadcn/ui primitives (
Dialog,Sheet,Calendar,Form,Command) to capture input, validation, and feedback instead of placeholder buttons. - Provide companion states (empty, loading, error, success) so the experience is resilient, not a static snapshot.
- Narrate key interactions in your response so the user knows how the UI behaves and what to try first.
-
Full keyboard support: Use WAI-ARIA as appropriate, ensure visible
:focus-visiblestates, and implement focus trap/restore in overlays. -
Adequate hit target sizes: Minimum 24px (44px on mobile); input font size at least 16px (to prevent iOS zoom).
-
State in URL: Filters, tabs, and pagination should be reflected in the URL.
-
Implement optimistic updates with undo/rollback; always confirm destructive actions.
-
Use
aria-live="polite"for async updates. Label all icon-only buttons and ensure links use semantic elements (<a>/<Link>). -
Design empty, loading, and error states according to the selected style.
-
Ensure high text-to-background contrast for legibility.
-
Build experiences that feel crafted, surprising, and polished—no bland layouts shipped.
-
Verify responsive behavior on mobile, tablet, and desktop before handing off.
-
Reach for
src/components/uiprimitives first; extend them thoughtfully to maintain cohesion. -
Keep action sets cohesive: align button variants, corner radii, and spacing so adjacent actions feel like one system.
- Images: Use
next/imagewith explicitsizesand dimensions. Setpriorityonly for above-the-fold images. Prefer AVIF or WebP formats. - Fonts: Preconnect, preload critical fonts (1–2 faces), subset with
unicode-range, and usefont-display: swap. - Lists: Use
content-visibility: auto. Virtualize lists with more than 100 rows. - Motion: Restrict to CSS transforms and opacity; respect
prefers-reduced-motion. Never usetransition: all. - Network: Batch actions and fetches; cache/tag in RSC; keep POST/PATCH/DELETE under 500 ms.
-
Prevent text overflow:
- Use responsive type to avoid oversized headings on small screens (e.g.,
text-base sm:text-lg md:text-xl). - Ensure long/unbroken content wraps with
break-words; reservebreak-allas a last resort. - For single-line labels in flex rows: set
min-w-0on the flex child and addtruncatewhen appropriate.
- Use responsive type to avoid oversized headings on small screens (e.g.,
-
Prevent layout bleed:
- Constrain widths inside components with
w-full max-w-full; avoid viewport units in components. - In flex/grid layouts where children should shrink: set
min-w-0andmin-h-0on child containers. - Wrap absolutely positioned decorative layers with a
relativeparent; clip withoverflow-hiddenwhen the parent has rounded edges. - Prefer
gap-*spacing over negative margins; avoid absolute positioning unless essential.
- Constrain widths inside components with
-
Responsive safety checks:
- Ensure no horizontal scrollbars at any breakpoint; if needed (e.g., data tables), scope with
overflow-x-autoon the smallest container. - Allow content to wrap (
flex-wrap) where appropriate rather than forcing fixed widths.
- Ensure no horizontal scrollbars at any breakpoint; if needed (e.g., data tables), scope with
-
Media sizing:
- Images/videos must not overflow their containers: use
max-w-full h-auto. - For fixed-height regions, use
object-coverinside arelative overflow-hiddenwrapper.
- Images/videos must not overflow their containers: use
-
Color discipline:
- Commit to one base, one neutral, and one accent; derive interaction states with opacity, not new hues.
- Maintain WCAG AA: body text ≥ 4.5:1; captions/labels ≥ 3:1 on solid surfaces.
- Never pair acid yellow accents with teal or green bases.
- Ensure text/icons on semantic surfaces (error, success, info) contrast at ≥ 4.5:1—avoid tone-on-tone like bright red text on red fill.
-
Backgrounds:
- Default to flat fills or a single subtle radial/linear gradient ≤ 8% contrast.
- Avoid noise overlays, glow halos, or stacked gradients unless the chosen style mandates them.
-
Typography:
- Limit the system to two families (display + text) on a modular scale (~1.25).
- Cap lead copy at 60–72ch and body copy at 45–65ch; keep headlines within three lines.
- Use uppercase micro-labels only when the style requires it; otherwise default to sentence case.
-
Spacing & grid:
- Work on an 8-pt scale; container widths: sm 640 / md 768 / lg 1024 / xl 1280 / 2xl 1440.
- Align labels, inputs, and CTAs to a strict 12-column grid.
- Choose a single corner radius (4 / 8 / 12 / 16) and apply it across the page.
-
Forms:
- Keep inputs ≥ 44px tall; labels 12–14px; placeholders ≥ 70% of body text contrast.
- Make the primary CTA visually dominant—size, weight, and contrast must signal priority.
- Place inline help beneath inputs; avoid cluttering with side notes.
- Use a unified action hierarchy: primary/secondary/tertiary buttons should share structure and only diverge through tokenized variants.
-
Cards & chips:
- Stick to one elevation level (e.g.,
shadow-sm) or go flat; no glow effects. - Derive chip and badge colors from the primary accent, without introducing extra hues.
- Stick to one elevation level (e.g.,
-
Motion:
- Limit transitions to transforms and opacity while honoring
prefers-reduced-motion. - Keep micro-interactions under 200ms; never ship perpetual glows or pulsing rings.
- Limit transitions to transforms and opacity while honoring
-
Anti-ugly self-check:
- Multiple hero gradients or glow rings present? Remove them.
- Sibling components with mismatched radii? Normalize before shipping.
- Accent color inconsistent across chips, links, focus rings, or CTAs? Realign tokens.
- Body or placeholder contrast failing WCAG? Fix the palette.
- Screen lacks a focal point or clear primary CTA? Clarify the hierarchy.
- Are section backgrounds indistinguishable, flattening the flow? Introduce a purposeful shift (tint, divider, or pattern) within the style limits.
- Do modules feel busy or ornamental? Strip them back to the essentials and reinforce hierarchy with spacing and type.
- Labels, inputs, help text, and CTAs off the 8-pt grid? Realign them.
src/app: Next.js 15 App Router routes.layout.tsxwires up global providers and fonts.src/components/ui: Shared shadcn primitives; feature widgets co-located with their entry point.src/hooks: Typed hooks for forms/state; isolate side effects.src/lib: Pure utility functions; avoid React imports to support tree shaking.public/: Static assets.src/app/globals.css: global tokens.- Tailwind config:
postcss.config.mjs,components.json.
npm run dev: Start dev server (http://localhost:3000) with hot reload.npm run build: Create production bundle in.next/, validate type safety.npm run start: Serve compiled app. Use to test production builds.npm run lint: Run Next.js ESLint; lint must pass before commit.
- TypeScript everywhere; add explicit export types for nontrivial logic.
- File names:
kebab-case.ts(x); components/assets: PascalCase. - Prefer functional components, early returns. Keep Tailwind classes declarative.
- Use Prettier defaults (2-space indent, double quotes). Run
npm run lint -- --fixto format.
- Base UI uses
@radix-uiand Tailwind. Extend insidesrc/components/uifor consistency. - Manage fonts in
src/app/layout.tsx; design tokens inglobals.css. Avoid inline overrides.
- Always expose
className?: stringon top-level exported components and merge it via your class utility (e.g.,cn) to preserve composition. - Prefer explicit union variants over booleans for multi-state visuals (e.g.,
tone: "default" | "success" | "destructive"). - shadcn/ui Select (Radix) rules:
- Every
SelectItemmust have a non-emptyvalueprop; never use"". - Do not add a placeholder as an item; use
<SelectValue placeholder="..." />in the trigger. - Ensure
value/defaultValuematches one of the item values; otherwise leave uncontrolled so the placeholder shows.
- Every
- Avoid React hydration mismatches; gate client-only UI until hydrated and never access browser APIs at module scope.
- Respect
prefers-reduced-motion; limit transitions to opacity/transform (nevertransition: all). - Code must pass
npm run lintandtsc --noEmitbefore commit.