All skills
mblode avatar

/ui-design

@e7db33d
by Matthew Blodemblode/agent-skills134 stars
12

Designs and builds React/Next/Tailwind UI and audits visual and interaction defects. Use when asked to "build a landing page", "extract our design system", "add dark mode", "make this responsive", "remove UI slop", or "audit this component". For product decisions use product-design; for browser measurements use ui-verification; for motion use ui-animation.

Use this Skill: https://skilld.dev/gh/mblode/agent-skills/ui-design

This session only. Nothing lands on disk.

rulesdark-i18n-untested.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Component lacks dark-mode coverage and hardcodes light tokens

Hardcoded colors (bg-white, text-black, #fff, text-gray-900) break in dark mode: white surfaces glow on a dark background, fixed grays lose contrast, borders disappear. CSS-variable tokens (bg-background, text-foreground) make the same JSX work in both themes. The companion bug: no Storybook dark story or Chromatic dark snapshot, so the regression ships unnoticed.

What goes wrong

A card uses bg-white border-gray-200 text-gray-900. In dark mode it's a white rectangle on a near-black canvas, and nothing catches it because the component's only Storybook story renders the default (light) theme.

Detection

Surfaces: any UI surface, especially marketing components migrated into a dark-mode-aware product.

Static signals:

  1. Grep for hardcoded color classes: bg-white, bg-black, text-black, text-white, bg-gray-\d+, text-gray-\d+, border-gray-\d+.
  2. Grep for hardcoded hex/rgb in inline styles or CSS modules.
  3. Confirm a *.stories.tsx with a dark-themed story (or Chromatic param parameters: { backgrounds: { default: 'dark' } }).
  4. Confirm dark: variants exist on the offending classes.

Concrete commands:

# Hardcoded Tailwind tokens (likely missing dark variants)
rg -n 'className="[^"]*\b(bg-white|bg-black|text-black|text-white|bg-gray-\d{2,3}|text-gray-\d{2,3}|border-gray-\d{2,3})\b[^"]*"' --type=ts \
  | rg -v 'dark:'

# Hardcoded hex
rg -n '#(fff|000|FFF|000000|FFFFFF)\b' --type=ts --type=css

# Storybook dark coverage
find . -name '*.stories.tsx' -type f -exec rg -l 'dark|theme: ["\']dark' {} + 2>/dev/null

False-positive guards:

  • Skip marketing-only directories (app/(marketing)) where the brand forbids dark mode; verify via the CSS entry file's @theme and @custom-variant dark lines, or a legacy tailwind.config.*.
  • Skip illustrations, brand SVGs, and logos where fixed color is intentional.
  • Skip // ui-audit-ignore:dark-i18n-untested near the match.

Fix

Replace hardcoded tokens with semantic CSS variable tokens, and add a dark Storybook story.

// before: light-only
<div className="bg-white border border-gray-200 text-gray-900 p-4 rounded-lg">
  <h3 className="text-gray-700">Title</h3>
  <p className="text-gray-500">Body</p>
</div>

// after: semantic tokens (shadcn / Blode UI convention)
<div className="bg-card border border-border text-card-foreground p-4 rounded-lg">
  <h3 className="text-foreground">Title</h3>
  <p className="text-muted-foreground">Body</p>
</div>

For a genuine one-off, use dark: variants:

<div className="bg-white dark:bg-zinc-950 text-zinc-900 dark:text-zinc-50">

Add a dark Storybook story:

// Card.stories.tsx
export const Default: Story = { args: { /* … */ } };
export const Dark: Story = {
  ...Default,
  parameters: { backgrounds: { default: 'dark' }, themes: { themeOverride: 'dark' } },
};

Or derive variants with color-mix (no second token):

.surface-subtle {
  background-color: color-mix(in oklch, var(--background) 92%, var(--foreground));
}

Docs:

Default tier and overrides

Defaults to: backlog

Surface overrides:

Surface Tier
Sign-in / Sign-up fix-this-sprint (high-traffic surface)
Checkout fix-this-sprint
Dashboard fix-this-sprint
Marketing landing backlog
Internal admin backlog

Defer-to (when this is another tool's job)

  • Chromatic captures the actual dark-mode regression: https://www.chromatic.com/docs/themes/
  • Storybook a11y addon flags low-contrast pairs after the dark switch.
  • axe-core flags contrast violations at runtime.

Suppression

{/* ui-audit-ignore:dark-i18n-untested, brand mark, fixed color by design */}
<svg fill="#FF6F00" />

Source: SKILL.md on GitHub

No alerts7d5 checks · Risk SAFE
  • Gen Agent Trust Hub7d

    A comprehensive UI design and auditing skill that uses standard developer tools and trusted services like Tailwind CSS and placeholder asset APIs to build and verify React/Next.js interfaces. It includes explicit guardrails to prevent instruction following from analyzed project files.

  • Socket7d

    No alerts

  • Snyk7d

    Risk: LOW · No issues

  • Runlayer6mo

    4/5 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at e7db33d. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated last week

README badge

README badge for mblode/agent-skills/ui-design