← Browse

@diegosouzapw/nextjs

B

Next.js framework best practices including App Router, data fetching, and performance optimization.

skillclaude

Install

agr install @diegosouzapw/nextjs --target claude

Writes 2 files into .claude/skills/, pinned to git-0dbb1599.

  • .claude/skills/nextjs/SKILL.md
  • .claude/skills/nextjs/metadata.json

Document


name: nextjs description: Next.js framework best practices including App Router, data fetching, and performance optimization. globs: ["/next.config.*", "/app//*.tsx", "/pages//*.tsx", "/middleware.ts"] priority: 90 tags: ["framework"]

Next.js Best Practices

App Router (v13+)

  • Use Server Components by default
  • Add 'use client' only when needed
  • Use loading.tsx for loading states
  • Use error.tsx for error boundaries
  • Use layout.tsx for shared layouts
  • Use route groups (folder) for organization

Data Fetching

  • Fetch in Server Components when possible
  • Use React Suspense for streaming
  • Use generateStaticParams for static generation
  • Use revalidate for ISR
  • Use Next.js cache() for request deduplication

Performance

  • Use next/image for optimized images
  • Use next/font for font optimization
  • Use next/link for client-side navigation
  • Implement proper caching headers
  • Use dynamic imports for code splitting

API Routes

  • Use Route Handlers in app directory
  • Validate inputs thoroughly
  • Handle errors gracefully
  • Use middleware for auth/logging

SEO

  • Use generateMetadata for dynamic SEO
  • Implement proper Open Graph tags
  • Use semantic HTML
  • Add structured data (JSON-LD)

Trustgrade B

  • passBody integrity

    Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.

  • passType matchnot applicable to this artifact type

    Whether the artifact is really the kind of thing its metadata claims it is.

  • passFreshness

    How long since the source repository was last pushed to.

  • passPrompt injection

    Scans the artifact's own text for instructions aimed at your agent rather than at you.

  • warnLicenseno SPDX license detected

    Whether the source repository declares an SPDX license permissive enough to redistribute.

How the grade is calculated

Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:

  • Aevery check passed
  • Bone warning
  • Ctwo warnings
  • Dprompt injection or body integrity failed, or three warnings
  • Fone of those failed, and something else is wrong

These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.

Versions

  • git-0dbb159902192026-07-31