nextjs-seo

Configure Next.js 16+ SEO metadata, Open Graph, and sitemaps.

58|18|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/laguagu/claude-code-nextjs-skills --skill nextjs-seo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-seo
Source: https://github.com/laguagu/claude-code-nextjs-skills/tree/main/skills/nextjs-seo
Command: npx skills add https://github.com/laguagu/claude-code-nextjs-skills --skill nextjs-seo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Managing SEO configuration for Next.js apps is error-prone and time-consuming, risking poor indexing and social sharing.

Core Features & Use Cases

  • Metadata API mastery: implement root and per-route metadata using Next.js App Router and generateMetadata.
  • Open Graph & Twitter Cards: configure social previews for pages and blog posts.
  • Sitemaps & Robots: generate canonical sitemaps and robots.txt to guide crawlers.
  • JSON-LD & Structured Data: embed schema.org data for richer search results.
  • Use Case: You have a Next.js site with dynamic product pages; generate per-page titles, descriptions, OG data, and a sitemap to improve indexing and sharing.

Quick Start

  • Create a root layout with a root metadata export and optional generateMetadata for dynamic routes.
  • Add references guidance for metadata best practices and validation.
  • Validate SEO setup with Google Rich Results Test and Schema Validator

Frequently Asked Questions about nextjs-seo

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

FAQPage Schema
How do I configure dynamic metadata for Next.js App Router pages?

To configure dynamic metadata for Next.js App Router pages, export a generateMetadata function alongside your page component. This function fetches route-specific data to generate per-page titles, descriptions, and Open Graph tags for search indexing.

What is the best way to generate a sitemap and robots.txt in Next.js 16+?

The best way to generate a sitemap and robots.txt in Next.js 16+ is using the App Router's native file conventions. Add sitemap.ts and robots.ts files to your root app directory to programmatically output canonical URLs and guide search engine crawlers.

How do I add JSON-LD structured data to a Next.js website?

To add JSON-LD structured data to a Next.js website, embed schema.org JSON objects directly within your App Router page or layout components. This injects structured data into the DOM to achieve richer search results and enhanced indexing.

How do I set up Open Graph and Twitter Cards for social sharing in Next.js?

To set up Open Graph and Twitter Cards for social sharing in Next.js, define the openGraph and twitter fields within your metadata export. This configures social previews with specific titles, descriptions, and images for pages and blog posts.

Can I use the Next.js Metadata API for dynamic product pages?

Yes, you can use the Next.js Metadata API for dynamic product pages by implementing generateMetadata. It dynamically generates per-page titles, descriptions, and Open Graph data based on your specific product details to improve indexing and sharing.

How do I validate Next.js SEO metadata and structured data?

To validate Next.js SEO metadata and structured data, test your deployed pages using the Google Rich Results Test and a Schema Validator. These tools verify that your metadata API configuration and JSON-LD output are correctly parsed by search engines.