Skip to content
Back to skills

Nextjs

ASecurity

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

  • 57 stars
  • 0 votes
  • 0 copies
  • 15 views
  • Added May 31, 2026
developmentreactnextjsapiperformance

Works with

  • cli
  • api

Security analysis

A100/100

Scanned May 31, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill nextjs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Nextjs?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Nextjs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-nextjs/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-nextjs)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.