Communitygithub.com

Geruyang/agent-skills-library

Orientação especializada para Next.js App Router. Use ao construir, depurar ou arquitetar aplicações Next.js — roteamento, Componentes de Servidor, Ações do Servidor, Cache de Componentes, layouts, middleware/proxy, busca de dados, estratégias de renderização e implantação na Vercel.

O que é agent-skills-library?

Esta skill fornece orientação especializada para desenvolvedores que trabalham com o Next.js App Router, cobrindo as melhores práticas e padrões recomendados para construir aplicações modernas com Next.js. Ela é útil para arquitetar, desenvolver e depurar projetos Next.js, abordando tópicos como roteamento, Componentes de Servidor React (RSC), Ações do Servidor, Cache de Componentes, layouts, middleware/proxy, busca e manipulação de dados, estratégias de renderização e implantação na Vercel. A skill organiza seu conhecimento em arquivos de referência bem definidos, como `file-conventions.md` para estrutura de projetos e segmentos de rota, `rsc-boundaries.md` para detecção de padrões inválidos de RSC, `async-patterns.md` para as mudanças assíncronas na API do Next.js 15+, e `runtime-selection.md` para escolha entre Node.js e Edge runtime. Ela também abrange diretivas como `'use client'` e `'use server'`, funções de navegação e servidor, tratamento de erros com `error.tsx`, `redirect` e `notFound`, otimização de imagens e fontes, e muito mais, tornando-se uma referência completa para qualquer desenvolvedor Next.js.

Funciona com~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Geruyang/agent-skills-library/tree/HEAD/original-skills/x-openai-nextjs-0babc94

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

Melhores Práticas Next.js

Aplique estas regras ao escrever ou revisar código Next.js.

Convenções de Arquivo

Consulte file-conventions.md para:

  • Estrutura de projeto e arquivos especiais
  • Segmentos de rota (dinâmicos, catch-all, grupos)
  • Rotas paralelas e de interceptação
  • Renomeação de middleware na v16 (middleware → proxy)

Limites de RSC

Detecte padrões inválidos de Componentes de Servidor React.

Consulte rsc-boundaries.md para:

  • Detecção de componente cliente assíncrono (inválido)
  • Detecção de props não serializáveis
  • Exceções de Ação do Servidor

Padrões Assíncronos

Alterações na API assíncrona do Next.js 15+.

Consulte async-patterns.md para:

  • params e searchParams assíncronos
  • cookies() e headers() assíncronos
  • Codemod de migração

Seleção de Runtime

Consulte runtime-selection.md para:

  • Padrão para runtime Node.js
  • Quando o Edge runtime é apropriado

Diretivas

Consulte directives.md para:

  • 'use client', 'use server' (React)
  • 'use cache' (Next.js)

Funções

Consulte functions.md para:

  • Hooks de navegação: useRouter, usePathname, useSearchParams, useParams
  • Funções do servidor: cookies, headers, draftMode, after
  • Funções de geração: generateStaticParams, generateMetadata

Tratamento de Erros

Consulte error-handling.md para:

  • error.tsx, global-error.tsx, not-found.tsx
  • redirect, permanentRedirect, notFound
  • forbidden, unauthorized (erros de autenticação)
  • unstable_rethrow para blocos catch

Padrões de Dados

Consulte data-patterns.md para:

  • Componentes de Servidor vs Ações do Servidor vs Manipuladores de Rota
  • Evitando waterfalls de dados (Promise.all, Suspense, preload)
  • Busca de dados em componente cliente

Manipuladores de Rota

Consulte route-handlers.md para:

  • Básico de route.ts
  • Conflitos do manipulador GET com page.tsx
  • Comportamento do ambiente (sem React DOM)
  • Quando usar vs Ações do Servidor

Metadados e Imagens OG

Consulte metadata.md para:

  • Metadados estáticos e dinâmicos
  • Função generateMetadata
  • Geração de imagem OG com next/og
  • Convenções de metadados baseadas em arquivo

Otimização de Imagens

Consulte image.md para:

  • Sempre use next/image em vez de <img>
  • Configuração de imagens remotas
  • Atributo sizes responsivo
  • Placeholders de desfoque
  • Carregamento prioritário para LCP

Otimização de Fontes

Consulte font.md para:

  • Configuração de next/font
  • Google Fonts, fontes locais
  • Integração com Tailwind CSS
  • Pré-carregamento de subconjuntos

Empacotamento (Bundling)

Consulte bundling.md para:

  • Pacotes incompatíveis com servidor
  • Importações CSS (não tags link)
  • Polyfills (já incluídos)
  • Problemas ESM/CommonJS
  • Análise de bundle

Scripts

Consulte scripts.md para:

  • next/script vs tags script nativas
  • Scripts inline precisam de id
  • Estratégias de carregamento
  • Google Analytics com @next/third-parties

Erros de Hidratação

Consulte hydration-error.md para:

  • Causas comuns (APIs de navegador, datas, HTML inválido)
  • Depuração com sobreposição de erro
  • Correções para cada causa

Limites de Suspense

Consulte suspense-boundaries.md para:

  • Falha de CSR com useSearchParams e usePathname
  • Quais hooks exigem limites de Suspense

Rotas Paralelas e de Interceptação

Consulte parallel-routes.md para:

  • Padrões de modal com @slot e interceptadores (.)
  • default.tsx para fallbacks
  • Fechando modais corretamente com router.back()

Auto-hospedagem

Consulte self-hosting.md para:

  • output: 'standalone' para Docker
  • Manipuladores de cache para ISR multi-instância
  • O que funciona vs precisa de configuração extra

Truques de Depuração

Consulte debug-tricks.md para:

  • Endpoint MCP para depuração assistida por IA
  • Reconstruir rotas específicas com --debug-build-paths

Individual skills in this repo

This repo contains 12 individual skills — each has its own dedicated page.

Geruyang/agent-skills-library

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

Geruyang/agent-skills-library

Set up Tailwind CSS v4 in Expo with react-native-css and NativeWind v5 for universal styling

Geruyang/agent-skills-library

Use for new frontend applications, dashboards, games, creative websites, hero sections, and visually driven UI from scratch, or when the user explicitly asks for a redesign/restyle/modernization. Builds from clean, airy, high-taste, readable image-generated concept design with section-specific references, faithful implementation, and browser testing.

Geruyang/agent-skills-library

Use when testing, debugging, or making targeted improvements to rendered frontend apps through the Build Web Apps or web dev plugin: local dev servers, UI regressions, interaction bugs, console errors, responsive layout, and visual QA. Check whether the Browser plugin is available and use it first when it is; otherwise use regular Playwright with the recorded reason.

Geruyang/agent-skills-library

Design UI surfaces for browser games. Use when the user asks for HUDs, menus, overlays, responsive layouts, or visual direction that must protect the playfield.

Geruyang/agent-skills-library

GSAP animation reference for HyperFrames. Covers gsap.to(), from(), fromTo(), easing, stagger, defaults, timelines (gsap.timeline(), position parameter, labels, nesting, playback), and performance (transforms, will-change, quickTo). Use when writing GSAP animations in HyperFrames compositions.

Geruyang/agent-skills-library

Guide for building, configuring, and deploying microfrontends on Vercel. Use this skill when the user mentions microfrontends, multi-zones, splitting an app across teams, independent deployments, cross-app routing, incremental migration, composing multiple frontends under one domain, microfrontends.json, @vercel/microfrontends, the microfrontends local proxy, or path-based routing between Vercel projects. Also use when the user asks about shared layouts across projects, navigation between microfrontends, fallback environments, asset prefixes, or feature flag controlled routing.

Geruyang/agent-skills-library

Use when sizing Public Equity Investing positions, finding equity hedges, or building an integrated position-and-hedge risk plan from a listed-equity thesis. Do not use for thesis construction, standalone event underwriting, trade execution, personal investment advice, or credit-instrument risk.

Geruyang/agent-skills-library

Integrate data visualizations into React and Next.js applications. Use when the user needs chart components, UML-like or architecture diagram components, React integration patterns, Next.js client or server boundaries, hydration-safe rendering, lazy loading, framework-aware performance, scroll-driven visual stories, or export guidance.

Geruyang/agent-skills-library

shadcn/ui expert guidance — CLI, component installation, composition patterns, custom registries, theming, Tailwind CSS integration, and high-quality interface design. Use when initializing shadcn, adding components, composing product UI, building custom registries, configuring themes, or troubleshooting component issues.

Geruyang/agent-skills-library

v0 by Vercel expert guidance. Use when discussing AI code generation, generating UI components from prompts, v0 CLI usage, v0 SDK/API integration, or integrating v0 into development workflows with GitHub and Vercel deployment.

Geruyang/agent-skills-library

Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI. Provides project context, component docs, and usage examples. Applies when working with shadcn/ui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for "shadcn init", "create an app with --preset", or "switch to --preset".

Habilidades Relacionadas