Skip to content

laguagu/claude-code-nextjs-skills / skills/nextjs-seo

nextjs-seo

Verified

Next.js App Router SEO implementation and audits. Use for metadata and social images, sitemap/robots, canonicals and localization, structured data, Core Web Vitals evidence, AI crawler policy or search-indexing diagnosis. Not for general Next.js feature work unrelated to SEO.

FileKindSize
SKILL.mdskill md4.0 KB
references/ai-search.mdmarkdown7.1 KB
references/checklist.mdmarkdown2.6 KB
references/json-ld.mdmarkdown2.2 KB
references/metadata-api.mdmarkdown3.7 KB
references/sitemap-robots.mdmarkdown2.9 KB
references/troubleshooting.mdmarkdown4.3 KB

references/sitemap-robots.md

View on GitHub
# Sitemaps and crawl policy

Use [sitemap](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap)
and [robots](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/robots)
file conventions from the installed Next.js version. Static files can be
sufficient for a fixed site; dynamic generation needs an actual update policy.

## Sitemaps

Include absolute canonical URLs intended to be indexed. Check real statuses
and exclude redirects, unavailable pages and deliberate noindex routes.
Sitemap presence does not override crawl restrictions, canonical selection or
indexing decisions.

Use `lastModified` only for meaningful content changes from reliable data.
Do not stamp every URL with the current build/request time. Google ignores
`priority` and `changeFrequency`; they do not need tuning.

Each sitemap is limited to 50,000 URLs and 50 MB uncompressed. Split large
sets, verify the generated endpoint paths and expose all children through a
sitemap index or their submission/discovery mechanism. Next.js
`generateSitemaps` does not itself create a sitemap index. In 15+, children are
served at `<segment>/sitemap/<id>.xml` in dev and production; in 16 the sitemap
function receives `id: Promise<string>`. Expose the children through the
`robots` sitemap array or a separately served index, and verify those URLs.

Localized entries need absolute reciprocal language alternates including
themselves. Image/video extensions should describe actual media and meet the
consumer's requirements.

`sitemap.ts`/`robots.ts` are cached by default unless request-time APIs or
supported dynamic configuration change that. A database-backed sitemap may
therefore run only at build time. Verify that a
publication update reaches the served sitemap using the configured cache,
invalidation or rebuild path. See
[Google sitemap guidance](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap).

## Robots and previews

[Robots rules](https://developers.google.com/crawling/docs/robots-txt/robots-txt-spec)
control cooperative crawling, not access or index removal. Keep a noindex
page crawlable when the crawler must see its directive. Authentication and
deployment protection serve a different purpose.

Specific user-agent groups do not inherit the wildcard group's restrictions.
Repeat intended shared rules in named groups or avoid unnecessary groups.
Do not block render-critical assets when Google needs them. Google's parser
does not use `host` or `crawl-delay`; use redirects/canonicals for the preferred
host.

`NODE_ENV=production` also describes optimized preview builds. Use the
deployment's explicit environment policy (`VERCEL_ENV` on Vercel where
appropriate), and verify preview protection and index directives independently.

Preserve the owner's AI crawler policy; see [ai-search.md](ai-search.md).
Verify production robots status/body, affected paths and crawl diagnostics
before narrowing a rule.
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall