Agent skill

managing-seo-metadata

Strategies for dynamic SEO using Next.js Metadata API. Use to generate social share cards and search-engine-friendly titles for tours.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/managing-seo-metadata

SKILL.md

SEO and Metadata Strategy

When to use this skill

  • Any page intended for public discovery (Tours, Destinations, Blog).
  • Creating dynamic OpenGraph (OG) images for social media sharing.

Workflow

  • Use export const metadata for static pages.
  • Use export async function generateMetadata for dynamic routes (tours/[id]).
  • Fetch the tour data inside generateMetadata to populate tags.

Example (Dynamic Metadata)

typescript
export async function generateMetadata({ params }): Promise<Metadata> {
    const { id } = await params;
    const tour = await TourService.getById(id);

    return {
        title: `${tour.title} | Tourly`,
        description: tour.description.substring(0, 160),
        openGraph: {
            images: [tour.images[0]],
        },
    };
}

Instructions

  • Memoization: Next.js automatically deduplicates fetch requests between generateMetadata and your Page component.
  • Defaults: Set a global title.template in root layout.tsx (e.g., %s | Tourly).
  • Canonical: Always include canonical URLs to prevent duplicate content issues.

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results