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.

rulesasync-no-error-boundary.md

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

Async tree without an error boundary

A thrown error in a server component or client async tree with no ancestor error boundary unmounts the whole route: a blank page in production, a stack trace in dev. Every route segment and every independently-fetching widget needs its own boundary so one failure does not take the page down.

What goes wrong

A widget fetch returns 500. With no boundary, the error bubbles past page and layout and unmounts everything to the nearest boundary (usually root). A user mid-checkout now sees a blank screen with no recovery path.

Detection

Surfaces: dashboard, list, checkout, sign-in, error-state, modal (anything that fetches data or runs server actions).

Static signals:

  1. List App Router segments: find app src/app -type f \( -name 'page.tsx' -o -name 'layout.tsx' \) 2>/dev/null.
  2. Check each segment for a sibling error.tsx.
  3. Find client components using useQuery, fetch, useSWR, or server actions; confirm an <ErrorBoundary> ancestor.
  4. Flag segments with awaits but no error.tsx, and any client async tree with no boundary.

Concrete commands:

# Route segments lacking error.tsx
find app src/app -type f -name 'page.tsx' 2>/dev/null | while read p; do
  dir=$(dirname "$p")
  [ ! -f "$dir/error.tsx" ] && echo "$dir: no error.tsx"
done

# Root-level global-error.tsx
find app src/app -type f -name 'global-error.tsx' 2>/dev/null | grep -q . || echo 'missing global-error.tsx'

# Client components with fetches but no ErrorBoundary import
rg "useQuery|useSWR|'use client'" --type=ts -l | while read f; do
  rg -q 'ErrorBoundary' "$f" || echo "$f: client async tree without local ErrorBoundary"
done

False-positive guards:

  • Skip leaf segments inherited from a parent that defines error.tsx (App Router cascades).
  • Skip components inside Storybook (*.stories.tsx).
  • Skip files annotated // ui-audit-ignore:async-no-error-boundary.

Fix

Add an error.tsx per route segment with a reset() button. For client trees, wrap in react-error-boundary's <ErrorBoundary>.

// app/dashboard/error.tsx
'use client';

import { useEffect } from 'react';

export default function Error({
  error,
  reset,
}: {
  error: Error & { digest?: string };
  reset: () => void;
}) {
  useEffect(() => {
    console.error(error);
  }, [error]);

  return (
    <div role="alert">
      <h2>Couldn&apos;t load your dashboard</h2>
      <p>We&apos;ve logged this. Try again?</p>
      <button onClick={reset}>Try again</button>
    </div>
  );
}
// client-side widget boundary
import { ErrorBoundary } from 'react-error-boundary';

<ErrorBoundary
  fallbackRender={({ error, resetErrorBoundary }) => (
    <WidgetError onRetry={resetErrorBoundary} />
  )}
>
  <BillingWidget />
</ErrorBoundary>;

Docs:

Default tier and overrides

Defaults to: release-blocker

Surface overrides:

Surface Tier
Sign-in / Sign-up release-blocker
Checkout release-blocker
Dashboard widget (per-widget) release-blocker
Marketing landing fix-this-sprint
Internal admin fix-this-sprint

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

  • Sentry / Vercel Observability for error capture and alerting.
  • Vercel Agent for surfacing failing routes in PR review.
  • Lighthouse cannot detect this; it's a runtime concern.

Suppression

{/* ui-audit-ignore:async-no-error-boundary, covered by parent layout error.tsx */}
<Widget />

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