/seo-audit
Next.js App Router
Generates reports
Terminal window
Terminal window
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-auditTo generate reports without applying fixes:
/seo-audit audit onlyWhat it does
Section titled “What it does”| Phase | Action |
|---|---|
| 1 — Discovery | Detects 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 audit | Checks every route for title, description, alternates.canonical, openGraph, twitter, and robots: { index: false } where needed. |
| 3 — Root layout | Verifies metadataBase, default openGraph, and default twitter are set in app/layout.tsx. |
| 4 — robots & sitemap | Checks app/robots.ts and app/sitemap.ts exist and are correctly configured. |
| 5 — Structured data | Looks for JSON-LD scripts. Flags missing schemas (Organization, WebSite, TouristTrip, Product, Article). |
| 6 — Image alt text | Scans all <Image> and <img> tags. Flags empty alts, filename-style alts (alt="hamburger-menu"), and implementation-detail alts. |
| 7 — Thin pages | Finds stub pages and duplicate-content URLs. Recommends redirect() consolidation. |
| 8 — Reports | Generates two HTML reports in reports/ with severity badges, before/after code snippets, and print-friendly CSS. |
| 9 — Fixes | Applies every fix unless you said “audit only”. |
Reports generated
Section titled “Reports generated”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
reports/seo-owner-report-YYYY-MM-DD.html
Written for a non-technical business owner:
- What SEO is and why it matters (plain English)
- Traffic-light table: Green = done, Amber = partial, Red = missing
- What content/assets the owner needs to provide (OG images, business info for JSON-LD)
- What has already been fixed
- What the developer will do next
- No code, no jargon
What gets fixed
Section titled “What gets fixed”When not in “audit only” mode, the command:
- Adds missing
metadataexports to server component pages - Creates
layout.tsxwrappers for"use client"pages (the correct Next.js App Router pattern) - Adds
metadataBaseand default OG/Twitter blocks to the root layout - Creates
app/robots.tsif missing - Creates
app/sitemap.tsif 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
Framework support
Section titled “Framework support”| Framework | Status |
|---|---|
| Next.js 13–15 App Router | ✅ Fully supported |
| Next.js Pages Router | Planned |
| Nuxt 3 | Planned |
| SvelteKit | Planned |
| Remix | Planned |
Install
Section titled “Install”git clone https://github.com/Oladiman/iron-scrolls.gitcd iron-scrollsbash install.shOr install just this command:
mkdir -p ~/.claude/commandscurl -o ~/.claude/commands/seo-audit.md \ https://raw.githubusercontent.com/Oladiman/iron-scrolls/main/commands/seo-audit.md