--- name: frontend-design description: Guides the design of web interfaces so they look considered and specific to their subject rather than generic. Use when a user says "design a landing page", "build a dashboard that looks good", "make this UI feel less generic", "redesign this screen", or asks for client-facing front-end code with a clear visual point of view. --- # Frontend Design A design process to run before and during writing interface code. It forces a decision about who the screen is for, what it should feel like, and what to leave out, then checks the finished layout against the real content. ## When to use this - New pages or screens: landing pages, dashboards, settings, onboarding, forms, intake flows. - Reworking an interface that works but looks like a template. - Anything a client or customer will judge in the first five seconds. ## Procedure 1. **Ask what the screen is for.** Who uses it, what single action matters most, on what device, and in what mood (rushed, anxious, browsing). Ask for real content: headlines, labels, sample data. Design with real words, not placeholders. 2. **Name the subject and the feeling.** Write one sentence such as "a boutique law firm: calm, exact, trustworthy" and three adjectives to avoid. This sentence is the test for every later choice. 3. **Pick a visual direction deliberately.** Choose one: editorial, utilitarian, warm and tactile, high-contrast technical, quiet luxury, or another you can describe in a phrase. Commit to it rather than blending. 4. **Set the foundations as variables.** - Color: one neutral family, one accent used sparingly, plus status colors. Avoid default purple gradients. - Type: one or two families; a scale with clear steps; line length near 60 to 75 characters for reading text. - Space: a fixed scale (4, 8, 12, 16, 24, 40, 64 pixels) used everywhere. - Shape: a single corner radius and a single elevation style. 5. **Lay out by hierarchy.** Decide the one thing the eye lands on first, then second, then third. Group related items with space before using borders or boxes. Let some areas stay empty. 6. **Build in the user's stack** (ask; default to semantic HTML, CSS variables and a small amount of JavaScript, or React with Tailwind if they use it). Use real elements (button, label, nav), visible focus states, and a layout that holds from 360 pixels wide up. 7. **Design every state.** Empty, loading, error, long text, a single record versus a hundred. Show at least the empty and error states. 8. **Critique like a design lead.** Compare the screen to the sentence from step 2. Check that hierarchy survives a squint, that nothing exists only for decoration, that contrast passes, and that copy fits at the narrow width. Remove or change the three weakest things, then deliver. ## Output format - Direction summary: the sentence, the palette, the type choices, and why. - The code, split into logical files or clearly marked blocks. - A short critique note: what you changed after review and what you would test with real users. ## Guardrails - Do not default to stock gradients, glassy cards, or oversized hero text without a reason tied to the subject. - Never let motion or effects obscure content; respect reduced-motion settings. - Meet accessibility basics: contrast of 4.5 to 1 for text, keyboard access, labeled inputs. - Do not invent facts, testimonials or metrics in the copy. - When the brief is vague, ask two questions at most, then proceed with stated assumptions. ## Quality checks Before sending, confirm each of these: - The one-sentence direction can be seen in the result without being told. - There is one obvious primary action per screen. - The page holds up at 360 pixels wide, with no sideways scrolling. - Every interactive element has a visible keyboard focus state. - Real content fits: the longest title, a three-digit number, an empty list. - Spacing and sizes come from the declared scale; no one-off values.