Skip to content
Back to skills

NextJS Best Practices

ASecurity

Guidelines for building scalable, SEO-friendly applications with Next.js (App Router).

  • 36 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added February 7, 2026
developmentnextjsapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add mdbabumiamssm/LLMs-Universal-Life-Science-and-Clinical-Skills- --skill NextJS_Best_Practices --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of NextJS Best Practices?

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

Security grade badge for NextJS Best Practices
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mdbabumiamssm-nextjs-best-practices/badge)](https://www.skillsdirectory.com/skills/mdbabumiamssm-nextjs-best-practices)

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-best-practices'
description: 'Guidelines for building scalable, SEO-friendly applications with Next.js (App Router).'
---


# Next.js Best Practices

This skill outlines the standards for developing modern web applications using the Next.js App Router. It covers server components, data fetching, caching strategies, and route handling.

## When to Use This Skill

*   **Project Setup**: Initializing a new Next.js project.
*   **Architecture Design**: Deciding between Server vs. Client Components.
*   **Optimization**: Improving Core Web Vitals, LCP, and CLS.
*   **SEO Strategy**: Implementing Metadata API and sitemaps.

## Core Capabilities

1.  **App Router Architecture**: structuring `app/`, `layout.tsx`, `page.tsx`, and `loading.tsx`.
2.  **Server Actions**: Handling form submissions and mutations without API routes.
3.  **Data Fetching**: Implementing `fetch` with caching tags and revalidation strategies.
4.  **Middleware**: Authentication and request processing at the edge.

## Workflow

1.  **Determine Component Type**: Default to Server Components. "Use Client" only for interactivity (hooks, event listeners).
2.  **Plan Data Access**: Fetch data directly in Server Components where possible.
3.  **Implement Metadata**: specific exportable `metadata` objects for SEO.
4.  **Handle Errors**: Use `error.tsx` and `global-error.tsx` for graceful degradation.

## Example Usage

**User**: "Create a blog post page that fetches data from a CMS."

**Agent Action**:
1.  Reads `references/rules.md`.
2.  Generates `app/blog/[slug]/page.tsx` as an async Server Component.
3.  Uses `generateStaticParams` for SSG.

Files in this skill

  • SKILL.md1.6 KB
  • references/rules.md2.3 KB

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.

View all in development →

Comments

Loading comments…

Newsletter

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