writing-nextjs

Enforce Next.js Pages Router patterns for pages, data fetching, and SEO.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/anthony-fdez/claude-skills --skill writing-nextjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-nextjs
Source: https://github.com/anthony-fdez/claude-skills/tree/main/.claude/skills/writing-nextjs
Command: npx skills add https://github.com/anthony-fdez/claude-skills --skill writing-nextjs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures adherence to best practices and patterns for building Next.js applications using the Pages Router, optimizing for performance, SEO, and maintainability.

Core Features & Use Cases

  • Page Structure: Enforces standard directory and file organization within the pages/ directory.
  • Data Fetching: Guides the use of getStaticProps with ISR for performance and getServerSideProps only when necessary.
  • SEO & Meta Tags: Implements best practices for Head component usage, including titles, descriptions, and Open Graph tags.
  • Error Handling: Details custom 404 pages and the use of Error Boundaries.
  • Performance: Recommends lazy loading components and optimizing images with next/image.
  • Internationalization: Provides patterns for handling translations and locale-specific routing.
  • Use Case: When developing a new page in a Next.js application, this skill will guide you to correctly implement data fetching, SEO meta tags, and ensure the page is performant.

Quick Start

Use the writing-nextjs skill to create a new page with optimized data fetching and SEO meta tags.

Frequently Asked Questions about writing-nextjs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement getStaticProps with ISR for static generation in Next.js?

Use getStaticProps with ISR in Next.js by returning a revalidate property alongside props, enabling incremental static regeneration to serve pre-rendered pages that update periodically without full rebuilds.

When should I use getServerSideProps instead of static generation in Next.js?

Use getServerSideProps in Next.js only when your page requires real-time data on every request, as it bypasses static generation and ISR, potentially impacting performance compared to pre-rendered pages.

What is the best way to add SEO meta tags to a Next.js Pages Router app?

Add SEO meta tags in Next.js by importing the Head component into your Pages Router files, then defining titles, descriptions, and Open Graph tags directly within the page's JSX structure for optimal search engine indexing.

How do I optimize images and lazy load components in Next.js?

Optimize Next.js images using the built-in next/image component, and implement lazy loading for secondary components to reduce initial bundle size, directly improving frontend performance and SEO metrics.

How do I configure internationalization routing in a Next.js Pages Router?

Configure Next.js internationalization by setting up locale-specific routing patterns within the Pages Router directory structure, managing translations to serve localized content based on user locale preferences.

How do I create custom 404 error pages in Next.js?

Create custom 404 error pages in Next.js by adding a 404.js file directly inside the pages directory, allowing you to handle routing errors and implement Error Boundaries for a customized fallback experience.