Audit seo

From JoviDeCroock/pracht · View interactive version

Audit seo is an AI agent skill from the GitHub repository JoviDeCroock/pracht. Audit SEO per pracht route (`head()` titles, descriptions, Open Graph, canonicals, robots) and generate a `sitemap.xml` from the route manifest. Use for "audit SEO", "check meta tags", "generate a sitemap", "check OG cards", "review robots.txt".

How to use this skill

Skill file

Pracht Audit SEO

pracht owns the document. Per-route SEO lives in the head() export

returning { title?, lang?, meta?, link?, script? }. This skill audits

coverage and generates the static SEO artifacts.

Step 1: Inventory

MCP: if pracht dev-mcp is registered, prefer its inspect_*, doctor, and verify tools to the CLI.

pracht inspect routes --json

Prerequisite: pracht inspect needs a vite config with the pracht plugin

wired up; run from the app root.

For every route file, read the head() export (and the shell's head() for

inherited values).

Step 2: Per-route checklist

For each route, capture presence and quality:

| Field | Expected |

| ---------------------------------------- | --------------------------------- |

| title | 30-60 chars, unique per route |

| meta description | 70-160 chars, unique per route |

| meta og:title | Present (often = title) |

| meta og:description | Present |

| meta og:image | Absolute URL, ≥ 1200×630 |

| meta og:url | Absolute, canonical |

| meta twitter:card | summary_large_image for content |

| link canonical | Absolute URL |

| script (JSON-LD) | Optional; see Step 6 |

| lang | Set on root or via shell |

Skip SPA-only / non-indexable routes (admin, dashboard) — flag as "noindex

candidate" if they don't already declare it.

Step 3: Cross-route checks

pracht({ trailingSlash: "ignore" }) every page answers at /about and

/about/. Recommend "always" or "never", which redirects the other

spelling with a 308, or a canonical link on every page. Canonicals, og:url,

and sitemap entries must use the spelling in dist/server/routing.json.

shell level so every route inherits one.

Step 4: `robots.txt`

robots.txt MUST be served at the origin root (/robots.txt) — crawlers

never look anywhere else. pracht API routes are always mounted under /api/

(a src/api/robots.ts handler serves /api/robots, never /robots.txt), so

an API handler cannot provide it. The workable option is the static asset:

If absent, recommend creating public/robots.txt:

User-agent: *
Allow: /
Disallow: /api/
Disallow: /admin/
Sitemap: https://<domain>/sitemap.xml

If present, validate:

sitemap is an API route, this must point at /api/sitemap).

weight at /api/robots and does not serve /robots.txt.

Step 5: sitemap

Generate (or recommend generating) a sitemap from the route manifest:

render: "ssg"/"isg" routes (and public SSR routes worth indexing),

minus routes under auth middleware, minus routes declaring a

robots/noindex meta. (prefetch is a client navigation hint —

orthogonal to indexability; do not use it as a criterion.)

time — pull resolved paths from the prerender output, which is laid out as

dist/client/<route>/index.html (clean URLs; e.g. /about →

dist/client/about/index.html).

trailingSlash: "always", /about otherwise (the root is always /).

→ weekly if > 86400s, daily if > 3600s, hourly otherwise.

Offer two output forms:

  1. Static public/sitemap.xml regenerated at build time via a small script

(served at /sitemap.xml).

  1. A pracht API route at src/api/sitemap.ts that emits XML on each request

from the inspected manifest. It is served at /api/sitemap (API routes

always mount under /api/), so the robots Sitemap: line must point at

https://<domain>/api/sitemap.

Step 6: Structured data (optional)

If the user asks, scaffold JSON-LD via the head() export's native script

field — HeadMetadata supports script?: HeadScriptDescriptor[], where each

descriptor takes attributes plus children for the inline body:

export function head() {
  return {
    script: [
      {
        type: "application/ld+json",
        children: JSON.stringify({ "@context": "https://schema.org", ... }),
      },
    ],
  };
}

No shell-level custom <script> JSX is needed. This is opt-in — do not push

it on every audit.

Step 7: Report

| Route | Severity | Title | Description | OG image | Canonical | Verdict |

| ----- | -------- | ----- | ----------- | -------- | --------- | ------- |

Primary severity per finding: error (site blocked by robots, auth-gated

route in sitemap), warn (missing title/description/OG image/canonical on an

indexable route), info (nice-to-haves like JSON-LD). Keep the

complete/partial/missing verdict as a secondary per-route rollup,

grouped by verdict.

Rules

  1. Use the resolved manifest — shell head() inheritance matters.
  2. Never auto-write sitemap.xml to the deployed site without user

confirmation; offer the file as a draft.

  1. Recommend a default OG image at the shell level — single highest-leverage

fix.

  1. Auth-gated routes should NOT appear in sitemaps.
  2. Cross-reference with tune-render-mode — SSG routes are the sitemap

candidates; SSR routes need decision per case.

$ARGUMENTS

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.