Toolverse
All skills

nextjs-best-practices

by davila7

Next.js App Router principles. Server Components, data fetching, routing patterns.

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
davila7
Category
Frontend
Views
47

About this skill

Next.js App Router principles. Server Components, data fetching, routing patterns.

How to use

  1. Zainstaluj umiejętność w swoim środowisku Claude lub agenta, wskazując repozytorium davila7/claude-code-templates w ścieżce cli-tool/components/skills/development/nextjs-best-practices.

  2. Kiedy projektujesz komponent, zadaj pytanie: czy potrzebujesz useState, useEffect lub obsługi zdarzeń? Jeśli tak, oznacz go jako Client Component ('use client'). Jeśli komponent tylko pobiera dane i wyświetla zawartość, zostaw go jako Server Component (domyślnie).

  3. Przy pobieraniu danych wybierz strategię: Static (domyślnie, cache'owany przy budowie), Revalidate (odświeżanie co określony czas), lub No-store (dynamicznie przy każdym żądaniu). Dla baz danych używaj Server Components, dla API — fetch z cache'owaniem, dla danych użytkownika — Client state plus server action.

  4. Organizuj routing za pomocą konwencji plików: page.tsx dla UI trasy, layout.tsx dla wspólnego layoutu, loading.tsx dla stanu ładowania, error.tsx dla granic błędów, not-found.tsx dla stron 404. Grupy tras (name) pomagają organizować bez zmiany URL, trasy równoległe @slot obsługują wiele stron na tym samym poziomie.

  5. Dla tras API (GET, POST, PUT/PATCH, DELETE) waliduj dane wejściowe narzędziami takimi jak Zod, zwracaj właściwe kody statusu i obsługuj błędy. Rozważ użycie Edge runtime dla lepszej wydajności.

  6. Optymalizuj wydajność: używaj komponentu next/image zamiast zwykłego img, ustaw priority dla obrazów powyżej linii widoku, dostarczaj rozmiary i formaty. Stosuj te zasady podczas każdej iteracji projektu, aby uniknąć pułapek wydajności.

Related skills

google-official-seo-guide

by littleben

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

Frontend
101196

2d-games

by davila7

2D game development principles. Sprites, tilemaps, physics, camera.

Frontend
2674

senior-fullstack

by davila7

Comprehensive fullstack development skill for building complete web applications with React, Next.js, Node.js, GraphQL, and PostgreSQL. Includes project scaffolding, code quality analysis, architecture patterns, and complete tech stack guidance. Use when building new projects,

Frontend
2896

interactive-dashboard-builder

by anthropics

Build self-contained interactive HTML dashboards with Chart.js, dropdown filters, and professional styling. Use when creating dashboards, building interactive reports, or generating shareable HTML files with charts and filters that work without a server.

Frontend
2298

angular

by sickn33

Modern Angular (v20+) expert with deep knowledge of Signals, Standalone Components, Zoneless applications, SSR/Hydration, and reactive patterns. Use PROACTIVELY for Angular development, component architecture, state management, performance optimization, and migration to modern

Frontend
2656

browser-use

by browser-use

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, or extract information from web pages.

Frontend
23107