Skip to content
Back to skills

Seo Nextjs

ASecurity

Technical SEO for the Next.js App Router: Metadata API, dynamic generateMetadata, sitemap.ts, robots.ts, JSON-LD structured data, Open Graph and canonical. Use when adding or auditing SEO in a Next app.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 14, 2026
content-marketinggobashnextjsgitapidatabasefrontend

Works with

  • api

Security analysis

A100/100

Scanned November 14, 2026

npx -y skills add SebastianLuser/claude-code-arcane --skill seo-nextjs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Seo Nextjs?

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

Security grade badge for Seo Nextjs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sebastianluser-seo-nextjs/badge)](https://www.skillsdirectory.com/skills/sebastianluser-seo-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: seo-nextjs
description: "Technical SEO for the Next.js App Router: Metadata API, dynamic generateMetadata, sitemap.ts, robots.ts, JSON-LD structured data, Open Graph and canonical. Use when adding or auditing SEO in a Next app."
category: "frontend"
argument-hint: "[metadata|sitemap|jsonld|audit]"
user-invocable: true
allowed-tools: Read, Glob, Grep, Bash, Write, Edit, Task
---
# seo-nextjs — Technical SEO for Next.js

## MANDATORY WORKFLOW

**Before generating or modifying code, complete these steps in order.**

### Step 0: Determine the scope
1. New app or an audit of existing SEO?
2. Static, dynamic (DB/CMS) or mixed content?
3. Does it need structured data (JSON-LD) for rich results? (articles, products, FAQ, breadcrumbs)

### Step 1: Base metadata (`app/layout.tsx`)
```ts
export const metadata: Metadata = {
  metadataBase: new URL('https://example.com'),
  title: { default: 'Site', template: '%s · Site' },
  description: '...',
  openGraph: { type: 'website', siteName: 'Site', images: ['/og.png'] },
  twitter: { card: 'summary_large_image' },
  alternates: { canonical: '/' },
};
```

### Step 2: Dynamic metadata (`generateMetadata`)
```ts
export async function generateMetadata({ params }): Promise<Metadata> {
  const post = await getPost(params.slug);
  return {
    title: post.title,
    description: post.excerpt,
    alternates: { canonical: `/blog/${post.slug}` },
    openGraph: { images: [post.cover] },
  };
}
```
Never manual `<meta>` tags in the body — always the Metadata API.

### Step 3: sitemap.ts and robots.ts
```ts
// app/sitemap.ts
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
  const posts = await getAllPosts();
  return [{ url: 'https://example.com', changeFrequency: 'daily' },
    ...posts.map(p => ({ url: `https://example.com/blog/${p.slug}`, lastModified: p.updatedAt }))];
}
// app/robots.ts → rules + link to the sitemap
```

### Step 4: JSON-LD structured data
```tsx
<script type="application/ld+json"
  dangerouslySetInnerHTML={{ __html: JSON.stringify({
    '@context': 'https://schema.org', '@type': 'Article',
    headline: post.title, datePublished: post.date, author: {...} }) }} />
```
Validate with Google's Rich Results Test.

### Step 5: Checklist
- [ ] `metadataBase` set (avoids broken OG URLs)
- [ ] Canonical on every indexable page
- [ ] 1200×630 OG image per important page
- [ ] sitemap.ts + robots.ts present
- [ ] JSON-LD wherever a rich result applies
- [ ] No accidental `noindex` in prod
- [ ] Healthy LCP/CLS (see the `nextjs-best-practices` skill)

## Wrap-up

Validate the structured data with Google's Rich Results Test and the meta tags with the browser inspector. If the checklist passes → SEO **READY**. Confirm changes with the user before writing. Next step: the `nextjs-best-practices` skill for Web Vitals, or `ai-seo` for content strategy.

---

_Inspired by the SEO skills in [laguagu/claude-code-nextjs-skills](https://github.com/laguagu/claude-code-nextjs-skills). Adapted to the Arcane format. Related: the `ai-seo` skill._

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 content-marketing →

Comments

Loading comments…

Newsletter

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