mindrally avatar

Optimized Nextjs Typescript

This is a comprehensive prompt for building modern Next.js apps with TypeScript, pushing you toward Server Components over client-side hooks and favoring composition over classes. It steers you to specific tools like Zustand for state, TanStack Query for data fetching, Zod for validation, and Shadcn/Radix for UI components. The architecture guidance is solid, emphasizing early returns, guard clauses, and proper error boundaries. What's nice is the focus on real performance wins like dynamic imports and WebP images rather than just talking about optimization in the abstract. If you're spinning up a new Next.js project and want opinionated defaults that lean heavily on the React Server Component model, this gives you a clear pattern to follow.

skills.sh installs
1K
GitHub stars
302
last updated
Aug 21, 2026

Install

$ npx -y skills add mindrally/skills --skill optimized-nextjs-typescript --agent claude-code

Installs into .claude/skills of the current project.

Files

Optimized Next.js TypeScript Best Practices

You are an expert in creating highly optimized and maintainable Next.js solutions adhering to best practices in performance, security, and clean architecture principles.

Code Style and Structure

  • Write concise, technical TypeScript with functional, declarative patterns
  • Avoid classes; favor composition and modularization
  • Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
  • Organize files with exported components, subcomponents, helpers, static content, and types
  • Use lowercase with dashes for directory naming conventions

Optimization Best Practices

  • Minimize 'use client', useEffect, and setState; prioritize React Server Components
  • Implement dynamic imports for code splitting
  • Use mobile-first responsive design
  • Optimize images with WebP format, size data, and lazy loading

Error Handling and Validation

  • Prioritize comprehensive error handling and edge cases
  • Use early returns and guard clauses for preconditions
  • Implement custom error types for consistency
  • Validate user input rigorously

UI and Styling

Sponsors

Details

Repository
github.com/mindrally/skills
Categories
Frontend Development, Security, Code Review & Quality, Debugging, Design & UI/UX
First seen
May 16, 2026

More from mindrally/skills

All 240
1patternsdev avatarreact-selective-hydrationpatternsdev/skillsTeaches selective hydration combined with streaming SSR in React 18+. Use when you need to prioritize hydrating interactive components while streaming the rest 1Kskills.sh installs
2mindrally avatarreactmindrally/skillsExpert in React development with modern patterns, hooks, and performance optimization976skills.sh installs
3patternsdev avatarstreaming-ssrpatternsdev/skillsTeaches streaming server-side rendering for chunked HTML delivery. Use when you need faster Time to First Byte and First Contentful Paint by streaming HTML as i938skills.sh installs
4sergiodxa avatarfrontend-accessibility-best-practicessergiodxa/agent-skillsAccessibility (a11y) best practices for React components. Use when creating UI components, forms, interactive elements, or reviewing code for accessibility comp896skills.sh installs
5framara avatarreact-flowframara/react-flow-skillExpert guidance for React Flow (@xyflow/react): building interactive node-based graphs, custom nodes and edges, handles, state management, layouting, TypeScript857skills.sh installs
6wot-ui avatarcreate-wot-ui-themewot-ui/open-wot为 wot-ui 生成单文件主题 SCSS,并在用户明确要求接入时追加 App.vue 的 `@use`。当用户要做品牌主题、语义变量落地、单文件主题接入时使用。854skills.sh installs