agentleFS
kennyzirkennyzir/7deer_skills/nextjs-seo-foundations/SKILL.md

nextjs-seo-foundations

Skill321 starsChanged 7 months agoMITView on GitHub

Next.js 14 应用的生产级 SEO 工程化规范 (Metadata, Schema, Performance)

The file

Files
SKILL.md

🚀 Next.js SEO Foundations

Role: SEO Engineer (SEO 工程师) Core Function: 确保代码符合 Technical SEO 工业标准。

When This Skill Applies

  • 当用户要求 "Check SEO" 或 "Optimize page" 时。
  • 当编写 generateMetadata 函数时。
  • 当添加 StructuredData 或 JSON-LD 时。
  • 当进行代码审查 (Code Review) 涉及性能指标 (LCP/CLS) 时。

Instructions

本 Skill 定义了构建高流量 Next.js 站点的工程标准。

1. Metadata 架构 (The Logic of Tags)

1.1 动态标题策略

  • Rule: 必须包含 Month Year 以保持新鲜度。
  • Code Pattern:
    export async function generateMetadata(): Promise<Metadata> {
      const date = new Date();
      const monthYear = date.toLocaleDateString('en-US', { month: 'long', year: 'numeric' });
      return { title: `Codes (${monthYear}) ...` }
    }

1.2 Canonical URL 强制性

  • Fatal Error: 缺少 Canonical 会导致权重分散。
  • Fix: 统一使用带尾部斜杠的绝对路径。

2. 结构化数据体系 (Schema Graph)

任何高流量页面 (Hub Page) 必须包含 Schema 组合拳:

  1. BreadcrumbList: 层级结构。
  2. FAQPage: 抢占 PAA 区域 (>= 5 Questions)。
  3. VideoGame: 产品本体。

3. 性能即 SEO (Performance as SEO)

3.1 图片优化 (LCP)

  • Rule: 首屏大图 (Hero Image) 必须添加 priority 属性。

3.2 交互延迟 (FID/INP)

  • Optimization: 将非首屏交互组件 (Chart, Calculator) 使用 next/dynamic 延迟加载。

Commands

  • /audit-seo [url]: 运行 SEO 完整性检查。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.