From web-standards
Apply when writing or reviewing Next.js + React + Tailwind + shadcn code — app router, Server Components by default, client boundary pushed deep, Tailwind utilities with CSS variable tokens, shadcn base components, React Query with structured keys, React Hook Form + Zod, next/image + next/font, no barrel files, no any or as assertions. Auto-invoke on changes under app/, components/, or lib/.
How this skill is triggered — by the user, by Claude, or both
Slash command
/web-standards:nextjsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **Ownership**: Generic Next.js patterns — reusable across any Next.js + Tailwind + shadcn/ui project.
Ownership: Generic Next.js patterns — reusable across any Next.js + Tailwind + shadcn/ui project. App-specific values (tokens, container widths, brand colors, API clients) belong in your app's
CLAUDE.mdor a local app-level rule.
Concrete code patterns for Next.js app router, React components, Tailwind CSS, and shadcn/ui.
"use client" when the component needs interactivity, hooks, or browser APIs"use client" goes at the very top of the file, before importsloading.tsx for route-level loading states — matches the page's layouterror.tsx for route-level error boundaries — must be a client componentnot-found.tsx for 404 statesReact.memo() for expensive components that receive stable propslib/types/dark: prefix) — controlled by next-themes--background, --foreground, --border, --primary, etc.sm:, md:, lg: for larger viewports)cn() utility (clsx + tailwind-merge) for conditional class compositionp-[13px] unless truly necessarymax-w-* utility — never full-width body text. Specific value lives in your app-level config.components/ui/ — not by overriding with wrapper componentsvariants via class-variance-authority, composable primitives['entity', 'list', { filter }] — never plain stringsstaleTime and gcTime set per query based on data volatilityuseMutation with onSuccess invalidationuseState for component-local UI state (open/closed, selected tab)useReducer for complex local state with multiple actionslocalStorage (view mode, collapsed states)next/image with explicit width/height. Lazy loading by default. Fallback placeholders.next/dynamic) for heavy components not needed at first paint@next/bundle-analyzer — no surprise large dependenciesnext/font for self-hosted fonts — no layout shiftReact.memo, useMemo, useCallback — only where profiling shows benefit, not preemptively<nav>, <main>, <article>, <section>, <button>alt text or alt="" for decorativeprefers-reduced-motion: respect via Tailwind's motion-reduce: variantuser-card.tsx, api-client.ts, use-viewport.tsx)user-card.tsx → export default function UserCard)use- prefix in filename, use prefix in function name (use-viewport.tsx → useViewport)date-utils.ts → formatDate)UserCardProps, ApiResponse)PAGE_SIZE, MAX_RETRIES), camelCase for config objectsinterface for component props, type for unions/utility typesany — use unknown and narrowas type assertions — use type guards or explicit narrowing instead. as silently bypasses type safety.const over letnever for default case to catch unhandled union members at compile timekey in lists with dynamic/reorderable data — use stable unique identifiersindex.ts re-exports) — they break tree-shaking and slow builds. Import directly from the source file.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub pixelcrafts-app/claude-craft --plugin web-standards