frontend-builder

v2026.09.24

Builds modern React and Next.js frontends. Use when creating web applications, choosing frontend stack, structuring components, implementing UI/UX designs, or setting up project architecture. Use for React, Next.js, Tailwind CSS, shadcn/ui, server components, and component patterns.

GitHub
安装命令
npx skhub add oakoss/frontend-builder
Markdown
SKILL.md

Frontend Builder

Overview

Builds maintainable, performant React and Next.js frontends using a server-first architecture. Covers component design, state management, data fetching, forms, styling, and performance optimization. Not for backend API design, database schema, or deployment infrastructure.

Quick Reference

PatternApproachKey Points
FrameworkNext.js App Router (default), React + Vite (SPAs)Server-first rendering, file-based routing
ComponentsPage, Feature, UI, Layout typesSingle responsibility, typed props, composition
Server vs ClientServer Components default, 'use client' at leaf nodesPush interactivity to edges of component tree
State (local)useState, props, lift to parentKeep state close to where it is consumed
State (global)Context API (theme, auth), Zustand (complex)Avoid Context for frequently changing values
Data fetchingServer Components (server), TanStack Query (client)Server Actions for mutations, revalidatePath for cache
FormsReact Hook Form + Zod, or Server Actions + useActionStateSchema validation, optimistic updates with useOptimistic
StylingTailwind CSS v4 + shadcn/uiCSS-first config with @theme, OKLCH colors
PerformanceSuspense streaming, code splitting, memoizationReact.lazy(), next/dynamic, selective memo()
Error handlingError boundaries, error.tsx per routeWrap feature sections, not individual components

Common Mistakes

MistakeCorrect Pattern
Adding 'use client' to every componentDefault to Server Components; add 'use client' only for interactivity
Giant multi-responsibility componentBreak into focused sub-components with single purposes
Placing all state at the top of the component treeKeep state as close to where it is consumed as possible
Using useEffect to compute derived dataUse useMemo for derived values; reserve useEffect for side effects
Missing error boundaries around feature sectionsWrap feature areas with error boundaries to prevent full-page crashes
Creating API routes for simple mutationsUse Server Actions with 'use server' for form submissions and mutations
Passing non-serializable props to Client ComponentsProps crossing server/client boundary must be serializable (no functions, classes)
Using tailwind.config.js with Tailwind v4Use CSS-first configuration with @theme directive in CSS file
Fetching data in Client Components when Server Components sufficeFetch in Server Components by default; use TanStack Query only when client-side caching is needed

Delegation

When building frontends, delegate to specialized skills:

  • react-patterns -- React hooks, rendering patterns, and performance optimization
  • nextjs -- Next.js routing, middleware, and deployment configuration
  • tanstack-query -- Client-side data fetching, caching, and mutations
  • tanstack-form -- Complex form handling and field-level validation
  • tailwind -- Tailwind CSS utility patterns and responsive design
  • design-system -- Token hierarchy and component architecture
  • performance-optimizer -- Profiling, bundle analysis, and Core Web Vitals

References

  • Component Architecture -- Component types, folder structure, TypeScript patterns, and composition
  • Server Components -- Server/client boundary, Server Actions, Suspense streaming, and data flow
  • State Management -- useState, Context API, Zustand, and URL state patterns
  • Data Fetching -- TanStack Query, Server Components data, and cache revalidation
  • Forms and Validation -- React Hook Form, Zod schemas, Server Actions, and useActionState
  • Styling -- Tailwind CSS v4, shadcn/ui, CSS-first config, and responsive patterns
  • Performance and Errors -- Memoization, code splitting, Suspense streaming, and error boundaries
发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.24

发布时间

2026年9月24日

分类

未分类

许可证

未指定

源路径

skills/frontend-builder

默认分支

main

最新提交

85e3a39

Tree SHA

a4c9e7b