Skip to content

/seo-audit

Next.js App Router Generates reports

A complete, automated SEO audit for Next.js App Router projects. Run it in any project and Claude acts as a senior SEO engineer — auditing every route, generating two professional HTML reports, and applying every fix.


/seo-audit

To generate reports without applying fixes:

/seo-audit audit only

PhaseAction
1 — DiscoveryDetects framework version and router type from package.json. Lists all routes. Identifies "use client" pages that need a layout.tsx wrapper to export metadata.
2 — Metadata auditChecks every route for title, description, alternates.canonical, openGraph, twitter, and robots: { index: false } where needed.
3 — Root layoutVerifies metadataBase, default openGraph, and default twitter are set in app/layout.tsx.
4 — robots & sitemapChecks app/robots.ts and app/sitemap.ts exist and are correctly configured.
5 — Structured dataLooks for JSON-LD scripts. Flags missing schemas (Organization, WebSite, TouristTrip, Product, Article).
6 — Image alt textScans all <Image> and <img> tags. Flags empty alts, filename-style alts (alt="hamburger-menu"), and implementation-detail alts.
7 — Thin pagesFinds stub pages and duplicate-content URLs. Recommends redirect() consolidation.
8 — ReportsGenerates two HTML reports in reports/ with severity badges, before/after code snippets, and print-friendly CSS.
9 — FixesApplies every fix unless you said “audit only”.

reports/seo-audit-YYYY-MM-DD.html

  • Pass/fail summary table for every route
  • Per-route breakdown: what’s present, what’s missing, exact code fix
  • Severity ratings: Critical / High / Medium / Low
  • robots.txt and sitemap.xml assessment
  • Structured data gaps with recommended schemas
  • Alt text violations with file path and line number
  • Post-fix column showing resolved vs still-open issues

When not in “audit only” mode, the command:

  • Adds missing metadata exports to server component pages
  • Creates layout.tsx wrappers for "use client" pages (the correct Next.js App Router pattern)
  • Adds metadataBase and default OG/Twitter blocks to the root layout
  • Creates app/robots.ts if missing
  • Creates app/sitemap.ts if missing — asks about dynamic routes if the data source is unclear
  • Fixes empty and implementation-detail alt text on all images
  • Replaces stub pages with redirect() to the canonical URL
  • Adds JSON-LD structured data schemas where missing

FrameworkStatus
Next.js 13–15 App Router✅ Fully supported
Next.js Pages RouterPlanned
Nuxt 3Planned
SvelteKitPlanned
RemixPlanned

Terminal window
git clone https://github.com/Oladiman/iron-scrolls.git
cd iron-scrolls
bash install.sh

Or install just this command:

Terminal window
mkdir -p ~/.claude/commands
curl -o ~/.claude/commands/seo-audit.md \
https://raw.githubusercontent.com/Oladiman/iron-scrolls/main/commands/seo-audit.md

View the raw command source on GitHub →

If these scrolls have served you well —
☕ Support on Ko-fi ♥ GitHub Sponsors