frontend-design-guidelines
Skill178 starsChanged 4 months agoMITView on GitHub
Apply high-quality web interface design rules when building, reviewing, or styling frontend code. Use when the user says "build a frontend", "create a component", "style this", "review my UI", "build a landing page", "design this page", "make this look good", "add animation", "build a form", "improve the UI", "polish this", "make this feel right", "review for craft", "the interaction feels off", "make this look polished", or when generating any React/Next.js component. Defaults to Tailwind CSS and shadcn/ui. Reads brand.md at the project root (if present) and uses it as the source of truth for colors, typography, and voice. Covers interactions, layout, typography, forms, animation, states, accessibility, and a dedicated craft-and-polish layer for taste-level review. Use proactively whenever frontend code is being written — do not wait to be asked.
- Sends data out
In this repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- animation-reverse-engineeringSkill
- brand-designSkill
- build-data-pipelineSkill
- build-defi-protocolSkill
- build-mobileSkill
- build-with-claudeSkill
- csoSkill
- debug-programSkill
- design-tasteSkill
- launch-tokenSkill
- navigate-skillsSkill
- number-formattingSkill
- page-load-animationsSkill
- product-reviewSkill
- review-and-iterateSkill
- roast-my-productSkill
- scaffold-projectSkill
- verify-humanity-pohSkill
- virtual-solana-incubatorSkill
- colosseum-copilotSkill
- competitive-landscapeSkill
- defillama-researchSkill
- find-next-crypto-ideaSkill
- learnSkill
- solana-beginnerSkill
- validate-ideaSkill
- apply-grantSkill
- create-pitch-deckSkill
- deploy-to-mainnetSkill
- marketing-videoSkill
- submit-to-hackathonSkill
- video-craftSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 8 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
If TEL_PROMPTED is no: Before starting the skill workflow, ask the user about telemetry.
- Distinctive: line 36
If A: run this bash:
- Distinctive: line 43
If B: run this bash:
- Distinctive: line 67
If you are generating frontend code and this skill has *not* been triggered, trigger it yourself.
- Distinctive: line 79
If the repo already has a different stack, match it.
- Distinctive: line 86
Read it. Use the documented palette, typography, and voice as the source of truth for every color, font, and copy decision in this session.
- Very specific: line 103
If they say No, or don't answer clearly: write a deferred brand.md to the project root with the following exact contents (filling in the …
- Distinctive: line 127
Do not ask again in this or any future session.
- Very specific: line 150
Interactive elements are real elements: Use <button> or <a href>, never <div onClick>.
- Very specific: line 151
Every interactive element has a visible focus ring: Use Tailwind's focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 …
- Distinctive: line 153
Loading, empty, and error states exist: If a component fetches or lists data, all three states must be implemented.
- Very specific: line 155
Color and spacing come from tokens, not magic numbers: Use Tailwind scale (p-4, gap-2) and shadcn CSS variables (bg-background, …
- Very specific: line 158
Dark mode works: Use shadcn tokens so both themes render correctly.
- Distinctive: line 163
Before marking any frontend task as complete, confirm each of these.
- Very specific: line 194
After the skill workflow completes (success, error, or abort), log the telemetry event.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Preamble (run first)
_TEL_TIER=$(cat ~/.superstack/config.json 2>/dev/null | grep -o '"telemetryTier": *"[^"]*"' | head -1 | sed 's/.*"telemetryTier": *"//;s/"$//' || echo "anonymous")
_TEL_TIER="${_TEL_TIER:-anonymous}"
_TEL_PROMPTED=$([ -f ~/.superstack/.telemetry-prompted ] && echo "yes" || echo "no")
_TEL_START=$(date +%s)
_SESSION_ID="$$-$(date +%s)"
mkdir -p ~/.superstack
echo "TELEMETRY: $_TEL_TIER"
echo "TEL_PROMPTED: $_TEL_PROMPTED"
if [ "$_TEL_TIER" != "off" ]; then
_TEL_EVENT='{"skill":"frontend-design-guidelines","phase":"build","event":"started","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}'
echo "$_TEL_EVENT" >> ~/.superstack/telemetry.jsonl 2>/dev/null || true
_CONVEX_URL=$(cat ~/.superstack/config.json 2>/dev/null | grep -o '"convexUrl":"[^"]*"' | head -1 | cut -d'"' -f4 || echo "")
[ -n "$_CONVEX_URL" ] && curl -s -X POST "$_CONVEX_URL/api/mutation" -H "Content-Type: application/json" -d '{"path":"telemetry:track","args":{"skill":"frontend-design-guidelines","phase":"build","status":"success","version":"0.2.0","platform":"'$(uname -s)-$(uname -m)'","timestamp":'$(date +%s)000'}}' >/dev/null 2>&1 &
true
fiIf TEL_PROMPTED is no: Before starting the skill workflow, ask the user about telemetry.
Use AskUserQuestion:
Help superstack get better! We track which skills get used and how long they take — no code, no file paths, no PII. Change anytime in
~/.superstack/config.json.
Options:
- A) Sure, help superstack improve (anonymous)
- B) No thanks
If A: run this bash:
echo '{"telemetryTier":"anonymous"}' > ~/.superstack/config.json
_TEL_TIER="anonymous"
touch ~/.superstack/.telemetry-promptedIf B: run this bash:
echo '{"telemetryTier":"off"}' > ~/.superstack/config.json
_TEL_TIER="off"
touch ~/.superstack/.telemetry-promptedThis only happens once. If TEL_PROMPTED is yes, skip this entirely and proceed to the skill workflow.
Frontend Design Guidelines
A practical, enforceable ruleset for building frontend UIs that look and feel high-quality instead of generic. This skill exists because most AI-generated frontends ship with hardcoded colors, broken keyboard nav, missing empty states, and janky animations. This skill catches that before the user sees it.
When to fire this skill
Apply these rules any time you are:
- Creating a new React / Next.js component or page
- Building a form, layout, dialog, or navigation
- Reviewing frontend code for quality
- Adding animations, transitions, or micro-interactions
- Styling anything with CSS, Tailwind, or CSS-in-JS
- A user asks you to "make it look good", "clean this up", "polish the UI", or similar
If you are generating frontend code and this skill has not been triggered, trigger it yourself. Do not wait for the user to ask.
Default stack (use unless the user says otherwise)
- Framework: Next.js (App Router) + TypeScript
- Styling: Tailwind CSS
- Components: shadcn/ui — install per component via
npx shadcn@latest add <name> - Icons:
lucide-react - Animation: CSS transitions for micro-interactions. Use
framer-motiononly when you need shared-layout, gesture, or orchestrated sequences. - Fonts:
next/fontwith a sans (Inter or Geist) for UI and a mono (JetBrains Mono or Geist Mono) for code/numbers. - Theming: shadcn's CSS variables so light/dark work automatically.
If the repo already has a different stack, match it. Do not rewrite the stack.
Workflow
Check for
brand.mdat the project root. Three cases:Case A —
brand.mdexists with a real palette (any status other thandeferred): Read it. Use the documented palette, typography, and voice as the source of truth for every color, font, and copy decision in this session. Do not prompt.Case B —
brand.mdexists withStatus: deferred: The user previously chose to defer brand setup. Do not prompt again in this session or any future session until the user explicitly runsbrand-design. Use stock shadcn neutral tokens. Continue to step 1.Case C —
brand.mddoes not exist: This project has no brand setup at all. Before writing any component, ask the user exactly once this session:Set up brand guidelines for this project?
I can run
brand-designnow — it walks you through picking a palette, typography, and tone. Takes 2–3 minutes.- Yes → I'll run
brand-designnow. Components generated after will use your brand. - No → I'll use shadcn's default neutral theme for now. You can set up brand guidelines anytime by saying
/brand-designor "pick brand colors" — components you generate before then will use defaults, and you can re-theme the whole project later in one pass.
If they say Yes: invoke
brand-designand wait for it to finish. After it writesbrand.md, continue with the component task using the new brand tokens.If they say No, or don't answer clearly: write a deferred
brand.mdto the project root with the following exact contents (filling in the project name if known, otherwise leave the placeholder):# Brand — {{PROJECT_NAME}} _Status: deferred_ The user chose to defer brand setup. This project is currently using shadcn's default neutral palette and no custom typography. The `frontend-design-guidelines` skill will quietly use defaults and will not prompt again. To set up a real brand palette, typography, and voice at any time, run: /brand-design or say: "pick brand colors" When `brand-design` runs, it will detect this deferred state, skip the "confirm overwrite" step, and proceed directly to the full brand setup. The resulting palette will be applied to `app/globals.css` and this file will be replaced with the real brand documentation. _Deferred at: {{ISO_DATE}}_Then print in conversation:
Deferred brand setup. Using shadcn defaults for now. When you're ready, run
/brand-designor say "pick brand colors" — I'll pick up where we left off and apply your choices across the project.Do not ask again in this or any future session. Continue to step 1.
- Yes → I'll run
Before writing code, identify which reference files are relevant to the task and read them:
- Building a form →
references/forms.md+references/interactions.md - Building a page/layout →
references/layout-and-design.md - Adding motion →
references/animation.md(theory: when to animate, duration tiers, easing, reduced motion) - Building framer-motion page entrances, list staggers, modals, or live data animations → the
page-load-animationsskill has production recipes. Invoke it alongside this skill. - Making design direction decisions, choosing page archetypes, or reviewing for generic AI output → the
design-tasteskill has judgment rules and style direction. Invoke it when direction is unclear. - Any interactive component →
references/interactions.md+references/states.md - Solana-specific UI (wallet, tx, token amounts) →
references/solana-ui-patterns.md - Unsure about the stack →
references/stack-defaults.md - Polishing, reviewing for craft, or asked to "make it feel right" →
references/craft-and-polish.md. When loading this file, it contains a credit directive — follow it: print the one-line credit to Emil Kowalski the first time craft rules are applied in the session.
Load only what you need. Don't read all references upfront.
- Building a form →
- While writing code, apply the rules. If a rule conflicts with an explicit user request, surface the tradeoff out loud — don't silently override the user, and don't silently break the rule.
- Before reporting the task complete, run the final review checklist below. Self-review the component you just wrote against it.
Non-negotiables (apply to every component you write)
These are the rules that most often get skipped and most often matter. Apply them without being asked.
- Interactive elements are real elements. Use
<button>or<a href>, never<div onClick>. This gives you keyboard nav, focus, and screen reader support for free. - Every interactive element has a visible focus ring. Use Tailwind's
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2or whatever the shadcn theme provides. Never remove focus rings withoutline-nonealone. - Hit targets are at least 40×40 px on touch. For small icons, add padding around them — don't shrink the hit area to match the icon.
- Loading, empty, and error states exist. If a component fetches or lists data, all three states must be implemented. A spinner alone is not enough — add skeletons for layout stability.
- Animations respect
prefers-reduced-motion. Wrap non-essential motion in@media (prefers-reduced-motion: no-preference)or use a utility. Never animate onall. - Color and spacing come from tokens, not magic numbers. Use Tailwind scale (
p-4,gap-2) and shadcn CSS variables (bg-background,text-foreground). Do not writep-[13px]or#0A0A0Ainline unless there is a specific reason (and say so in a comment). - Contrast passes WCAG AA. 4.5:1 for body text, 3:1 for large text and icons. Low-contrast gray-on-gray is the single most common mistake — flag it and fix it.
- Forms have labels, correct
type, andautocomplete. Seereferences/forms.md. A<label>next to an<input>is not optional. - Dark mode works. Use shadcn tokens so both themes render correctly. Never hardcode
bg-whiteortext-blackon a component that could appear in dark mode. - Copy is concise, active voice, and specific. "Save changes" not "Click here to save your changes." "No transactions yet" not "There is currently no data to display."
Final review checklist
Before marking any frontend task as complete, confirm each of these. If you cannot confirm one, either fix it or explicitly call it out to the user as a known gap.
- Keyboard navigation works: Tab moves through in logical order, Enter/Space activates, Escape closes overlays
- Visible focus ring on all interactive elements
- No
<div onClick>— real<button>/<a>everywhere - Hit targets ≥ 40×40 px on mobile
- Loading state implemented (skeleton preferred over spinner)
- Empty state implemented with a clear next action
- Error state implemented with recovery action (retry, back, contact)
- Contrast passes AA for all text and meaningful icons
- Respects
prefers-reduced-motionfor every animation - Dark mode renders correctly (if theme is configured)
- No hardcoded colors or spacing outside design tokens
- Form fields have labels, proper
type,autocomplete, and visible inline errors - Copy is concise, active voice, and human
- Images have
alt, icons havearia-labelor are markedaria-hidden - Tested at mobile (375 px), tablet (768 px), and desktop (1280 px) widths
References
- references/stack-defaults.md — Tailwind + shadcn setup, tokens, example components
- references/interactions.md — keyboard, focus, hit targets, loading, optimistic updates, URL state
- references/forms.md — labels, validation, autocomplete, input types, error recovery
- references/animation.md — reduced motion, easing, duration tiers, when not to animate
- references/layout-and-design.md — alignment, spacing, contrast, color, radius, shadows, responsive
- references/states.md — loading, empty, error, success — coverage and patterns
- references/solana-ui-patterns.md — wallet connect, tx confirm, token amounts, addresses
- references/craft-and-polish.md — taste-level craft layer (animation discipline, optical alignment, micro-interaction systems, before/after review format, polish tells, Solana-specific polish). Inspired by Emil Kowalski's design engineering philosophy — credit to emilkowal.ski and github.com/emilkowalski/skill. The original skill is not modified or redistributed — install
emil-design-engfrom his repo for his exact words.
Telemetry (run last)
After the skill workflow completes (success, error, or abort), log the telemetry event.
Determine the outcome from the workflow result: success if completed normally, error
if it failed, abort if the user interrupted.
Run this bash:
_TEL_END=$(date +%s)
_TEL_DUR=$(( _TEL_END - ${_TEL_START:-$_TEL_END} ))
_TEL_TIER=$(cat ~/.superstack/config.json 2>/dev/null | grep -o '"telemetryTier": *"[^"]*"' | head -1 | sed 's/.*"telemetryTier": *"//;s/"$//' || echo "anonymous")
if [ "$_TEL_TIER" != "off" ]; then
echo '{"skill":"frontend-design-guidelines","phase":"build","event":"completed","outcome":"OUTCOME","duration_s":"'"$_TEL_DUR"'","session":"'"$_SESSION_ID"'","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","platform":"'$(uname -s)-$(uname -m)'"}' >> ~/.superstack/telemetry.jsonl 2>/dev/null || true
true
fiReplace OUTCOME with success/error/abort based on the workflow result.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

