Back to list
jovermier

nextjs-metadata

by jovermier

Claude Code agents for Go, GraphQL, Next.js, and Playwright. 4 agents, 12 skills for code review and test generation.

0🍴 0📅 Jan 3, 2026

SKILL.md


name: nextjs-metadata description: Next.js Metadata API for SEO, OpenGraph tags, structured data, and social sharing. Use when implementing metadata, SEO, or social media previews.

Next.js Metadata

Expert guidance for implementing effective metadata in Next.js.

Quick Reference

ConcernSolutionExample
Page titlemetadata objectexport const metadata = { title: '...' }
Dynamic metadatagenerateMetadata functionexport async function generateMetadata({ params })
OpenGraph imagesmetadata.imagesopenGraph: { images: ['/og.jpg'] }
Structured dataScript component<Script type="application/ld+json">
Canonical URLsmetadata.alternatescanonical: 'https://...'
Twitter cardsmetadata.twittertwitter: { card: 'summary_large_image' }

What Do You Need?

  1. Static metadata - metadata object for fixed values
  2. Dynamic metadata - generateMetadata for dynamic values
  3. OpenGraph - Social sharing images and descriptions
  4. Structured data - JSON-LD for rich results
  5. Canonical URLs - Preventing duplicate content

Specify a number or describe your metadata scenario.

Routing

ResponseReference to Read
1, "static", "metadata", "object"static-metadata.md
2, "dynamic", "generatemetadata", "params"dynamic-metadata.md
3, "opengraph", "social", "sharing"opengraph.md
4, "structured", "json-ld", "schema"structured-data.md
5, "canonical", "seo", "duplicate"seo.md

Essential Principles

Every page needs metadata: Title, description, OpenGraph image minimum.

Static for static pages: Use metadata object when values don't change.

Dynamic for dynamic routes: Use generateMetadata when data comes from params or fetch.

OpenGraph for sharing: Ensure pages look good when shared on social media.

Structured data for rich results: Use JSON-LD for articles, products, organizations.

Code Patterns

Static Metadata

// app/page.tsx
import { Metadata } from 'next'

export const metadata: Metadata = {
  title: 'My App',
  description: 'Description for search engines',
  openGraph: {
    title: 'My App',
    description: 'Description for social sharing',
    images: ['/og-image.jpg'],
  },
}

export default function Page() {
  return <div>...</div>
}

Dynamic Metadata

// app/blog/[slug]/page.tsx
import { Metadata } from 'next'

export async function generateMetadata(
  { params }: { params: { slug: string } }
): Promise<Metadata> {
  const post = await fetchPost(params.slug)

  return {
    title: post.title,
    description: post.excerpt,
    openGraph: {
      title: post.title,
      images: [post.ogImage],
    },
  }
}

export default function BlogPost({ params }: { params: { slug: string } }) {
  // ...
}

Structured Data

import Script from 'next/script'

export default function ArticlePage({ post }: { post: Post }) {
  const jsonLd = {
    '@context': 'https://schema.org',
    '@type': 'Article',
    headline: post.title,
    datePublished: post.publishedAt,
    author: { '@type': 'Person', name: post.author.name },
  }

  return (
    <>
      <Script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }} />
      <article>{post.content}</article>
    </>
  )
}

Metadata Checklist

ElementRequiredFormat
titleYesstring or Metadata.title
descriptionYesstring (~160 chars)
openGraph:titleYesstring
openGraph:descriptionYesstring
openGraph:imageYesstring or array (1200x630px min)
twitter:cardRecommended'summary_large_image'
canonicalRecommendedstring
alternates:languagesOptionalRecord<locale, string>

Common Issues

IssueSeverityFix
Missing page titleHighAdd metadata.title
No OpenGraph imageMediumAdd openGraph.images
No descriptionMediumAdd metadata.description
Dynamic not using generateMetadataHighChange to async function
Duplicate content (no canonical)MediumAdd metadata.canonical
Small OG image (< 1200x630)LowUse larger image

Reference Index

FileTopics
static-metadata.mdmetadata object, all options
dynamic-metadata.mdgenerateMetadata, params, fetch
opengraph.mdOG tags, Twitter cards, images
structured-data.mdJSON-LD, Script component, schemas
seo.mdCanonical, hreflang, robots, sitemap

Success Criteria

Metadata is complete when:

  • Every page has title and description
  • OpenGraph tags present (title, description, image)
  • OG image is 1200x630px minimum
  • Dynamic routes use generateMetadata
  • Canonical URLs set for duplicate content
  • Structured data for content types (articles, products)

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

0/5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon