AgentSkillsCN

seo

SEO 清单和结构化数据模式。 适用场景:设置元数据、结构化数据、OG 图片、多语言 SEO。 不适用于:一般 Web 性能。 工作流程:与 nextjs 技能配合使用。

SKILL.md
--- frontmatter
name: seo
description: |
  SEO checklist and structured data patterns.
  Use when: setting up metadata, structured data, OG images, multi-language SEO.
  Do not use for: general web performance.
  Workflow: Use alongside nextjs skill.

SEO Patterns

For framework-specific implementation, use context7 with the relevant library. For latest Next.js metadata APIs, use context7.


Quick Checklist

Per Page

  • Unique title (50-60 chars)
  • Meta description (150-160 chars)
  • Canonical URL set
  • OG tags (title, description, image)
  • Single H1, proper heading hierarchy
  • Images have alt text

Site-Wide

  • sitemap.xml generated
  • robots.txt configured
  • HTTPS enabled
  • Core Web Vitals passing
  • Hreflang tags (if multi-language)

Next.js Metadata

For latest Next.js metadata APIs:


Structured Data (JSON-LD)

Rule: Add JSON-LD for content that benefits from rich results.

How to Add

tsx
<script
  type="application/ld+json"
  dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
/>

Article

json
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "Article title",
  "description": "Article description",
  "image": "https://example.com/image.jpg",
  "datePublished": "2024-01-01",
  "author": { "@type": "Person", "name": "Author Name" }
}

Product

json
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Product Name",
  "description": "Product description",
  "image": "https://example.com/product.jpg",
  "offers": {
    "@type": "Offer",
    "price": "29.99",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock"
  }
}

FAQ

json
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Question text?",
      "acceptedAnswer": { "@type": "Answer", "text": "Answer text" }
    }
  ]
}

Multi-language SEO

Set alternates.languages in metadata with hreflang codes:

code
'en': 'https://example.com/en'
'ko': 'https://example.com/ko'
'x-default': 'https://example.com/en'

References