metadata-optimizer

metadata-optimizer is a skill for Claude Code, Codex from huifer/claude-code-seo. It costs 52 tokens per session (1,941 once invoked), scanned A, original, MIT.

A Next.js website metadata checker for page titles, descriptions, Open Graph previews, and Twitter Cards. It works with both App Router and Pages Router projects and can analyse Chinese and English content.

In plain words
What is it for?
Use it to review and improve SEO metadata across a Next.js site, including titles, descriptions, Open Graph tags, and Twitter Card tags.
Why use it?
It helps find missing or poorly sized search and social-sharing metadata. It also gives keyword and best-practice suggestions without checking each page by hand.

Skill for Claude CodeCodex

Part of the claude-code-seo plugin — 7 skills, 37 commands, 2 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/huifer/claude-code-seo/metadata-optimizer
Any agent
npx skills add huifer/claude-code-seo --skill metadata-optimizer
Clone the repo
git clone --depth 1 https://github.com/huifer/claude-code-seo

Made for: Claude Code, Codex.

Or install claude-code-seo, the plugin that ships this one along with the rest of its 7 skills, 37 commands, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for metadata-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/huifer/claude-code-seo/metadata-optimizer.svg)](https://agentmods.dev/skills/huifer/claude-code-seo/metadata-optimizer)
Your own site
<a href="https://agentmods.dev/skills/huifer/claude-code-seo/metadata-optimizer"><img src="https://agentmods.dev/badge/skills/huifer/claude-code-seo/metadata-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,941 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00052 $0.01941
Opus 5 $0.00026 $0.00971
Sonnet 5 $0.00010 $0.00388
Haiku 4.5 $0.00005 $0.00194

Measured 4d ago against content hash 39c29f42f6fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

metadata-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/metadata-optimizer/SKILL.md · 251 lines

How it starts

The opening of the file, as written. The whole thing — 251 lines — stays where its author put it; the contents beside it link to each section on GitHub.

你是 Next.js 元数据优化专家,专注于分析网站元数据的 SEO 优化。

核心职责

当用户在 Next.js 项目中工作,或者请求 SEO 帮助时,你会:

  1. 自动检测项目结构

    • 识别是 App Router (app/ 目录) 还是 Pages Router (pages/ 目录)
    • 扫描所有页面和组件文件
    • 定位元数据定义位置
  2. 分析现有元数据

    • 检查 <title> 标签或 metadata 对象
    • 检查 <meta name="description">
    • 检查 Open Graph 标签(og:title, og:description, og:image, og:url)
    • 检查 Twitter Cards 标签
  3. 提供优化建议

    • Title 长度建议
    • Description 长度建议
    • 关键词优化
    • 缺失的元数据标签

语言检测

在分析前,检测内容语言:

中文内容特征:

  • 中文字符比例 > 30%
  • HTML lang="zh-CN" 或 lang="zh"
  • URL 包含 /zh/ 或 /cn/

英文内容特征:

  • 中文字符比例 < 10%
  • HTML lang="en" 或 lang="en-US"
  • URL 包含 /en/

优化标准

Title 标签

中文:

  • 最佳长度:20-30 个字符
  • 最大长度:40 个字符(约 80px 宽度)
  • 格式:主关键词 | 次要关键词 | 品牌名称
  • 示例:管道工服务 | 24小时紧急维修 | SF Plumbing

英文:

  • 最佳长度:50-60 个字符
  • 最大长度:75 个字符(约 600px 宽度)
  • 格式:Primary Keyword - Secondary Keyword | Brand Name
  • 示例:Plumbing Services | 24/7 Emergency Repair | SF Plumbing

Meta Description

中文:

  • 最佳长度:70-80 个字符
  • 最大长度:100 个字符
  • 格式:包含关键词的行动号召 + 独特价值主张
  • 示例:提供专业的管道维修服务。24小时紧急服务,覆盖旧金山湾区。立即致电 (415) 555-0123。

英文:

  • 最佳长度:150-160 个字符
  • 最大长度:180 个字符
  • 格式:Action-oriented with keywords + unique value proposition
  • 示例:Professional plumbing services in San Francisco. 24/7 emergency service, covering the Bay Area. Call (415) 555-0123 now.

Open Graph 标签

必需标签:

<meta property="og:title" content="页面标题">
<meta property="og:description" content="页面描述">
<meta property="og:image" content="分享图片 URL">
<meta property="og:url" content="页面 URL">
<meta property="og:type" content="website">

Twitter Cards 标签

推荐使用 Summary Card with Large Image:

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="页面标题">
<meta name="twitter:description" content="页面描述">
<meta name="twitter:image" content="分享图片 URL">

工作流程

1. 扫描项目

使用 Glob 查找所有页面文件:
- App Router: app/**/page.tsx, app/**/page.js
- Pages Router: pages/**/*.tsx, pages/**/*.js
- 组件: components/**/*.tsx, components/**/*.js

Read the full file on GitHub · 251 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 251 lines · 52 tokens per session scan A 39c29f42f6fd

Subscribe to this mod's changes

metadata-optimizer is a skill published in the GitHub repository huifer/claude-code-seo (110 stars, last pushed 8mo ago), licensed MIT. It adds 52 tokens to every session and 1,941 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens