agentleFS
charanjit-singhcharanjit-singh/lovable-skills/skills/seo-meta-tags-spa/SKILL.md

seo-meta-tags-spa

Skill10 starsChanged 6 months agoMITView on GitHub

Use when adding per-route titles, meta descriptions, Open Graph, Twitter card, or canonical tags in a Lovable SPA (React + Vite). Not for static HTML edits or content-only changes.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every public route MUST set:

    line 77
  2. Distinctive:

    Use at the top of every page:

    line 120

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SEO meta tags for SPAs

SPAs need per-route title + meta tags, but index.html only has one. Use one of these mechanisms consistently — never mix.

Companion skills: seo-ssr-and-prerendering, seo-structured-data, seo-landing-page.

Choose one approach

OptionWhenNotes
React 19 native (<title>, <meta> in JSX)React 19+ projectsBuilt-in, no library, hoisted to <head>
react-helmet-asyncReact 18 and earlier, or you need SSR with collected tagsBattle-tested, SSR-friendly
@unhead/reactModern alternative, smaller than helmetWorks for SSR + SPA

For Lovable's current default React version, prefer React 19 native tags if available, otherwise react-helmet-async.

React 19 native (preferred)

function PricingPage() {
  return (
    <>
      <title>Pricing — Acme</title>
      <meta name="description" content="Simple per-seat pricing. Start free." />
      <link rel="canonical" href="https://acme.com/pricing" />
      <meta property="og:title" content="Acme Pricing" />
      <meta property="og:description" content="Simple per-seat pricing. Start free." />
      <meta property="og:image" content="https://acme.com/og/pricing.png" />
      <meta property="og:url" content="https://acme.com/pricing" />
      <meta name="twitter:card" content="summary_large_image" />

      <main>{/* ... */}</main>
    </>
  );
}

React lifts these to <head> automatically; SSR/prerendering captures them.

react-helmet-async (React 18)

import { HelmetProvider, Helmet } from "react-helmet-async";

// once at the root
<HelmetProvider>
  <App />
</HelmetProvider>

// per page
function PricingPage() {
  return (
    <>
      <Helmet>
        <title>Pricing — Acme</title>
        <meta name="description" content="Simple per-seat pricing. Start free." />
        <link rel="canonical" href="https://acme.com/pricing" />
        <meta property="og:title" content="Acme Pricing" />
        <meta property="og:image" content="https://acme.com/og/pricing.png" />
      </Helmet>
      <main>{/* ... */}</main>
    </>
  );
}

Per-page contract

Every public route MUST set:

TagLengthNotes
<title>50–60 charsFormat: "Page — Brand"
<meta name="description">140–160 charsOne sentence, action-oriented
<link rel="canonical">absolute URLEven when there are no obvious duplicates
og:title, og:description, og:image, og:urlOG image 1200×630Required for LinkedIn/Slack previews
twitter:cardsummary_large_imageRequired for Twitter/X

Helper component

Centralize defaults so every page only overrides what's unique:

type SeoProps = {
  title: string;
  description: string;
  path: string;
  image?: string;
  type?: "website" | "article";
};

export function Seo({ title, description, path, image, type = "website" }: SeoProps) {
  const url = `https://acme.com${path}`;
  const ogImage = image ?? "https://acme.com/og/default.png";

  return (
    <>
      <title>{`${title} — Acme`}</title>
      <meta name="description" content={description} />
      <link rel="canonical" href={url} />
      <meta property="og:type" content={type} />
      <meta property="og:title" content={title} />
      <meta property="og:description" content={description} />
      <meta property="og:url" content={url} />
      <meta property="og:image" content={ogImage} />
      <meta name="twitter:card" content="summary_large_image" />
    </>
  );
}

Use at the top of every page:

<Seo title="Pricing" description="Simple per-seat pricing. Start free." path="/pricing" />

Canonicals

  • Self-referencing canonical on every page (yes, even the home page).
  • For paginated pages, canonical to the first page or self-canonical per page; do not canonical all pages to /blog.
  • For UTM-tagged URLs, canonical to the clean URL.

Open Graph images

  • 1200×630 PNG/JPG, < 1 MB, no transparency.
  • Programmatic images: see programmatic-seo-pages — generate per-page OG via Satori or an edge function.

Verify

Avoid

  • Identical <title> on every route.
  • Description duplicated across pages.
  • OG image missing or > 5 MB.
  • Mixing react-helmet-async and React 19 native tags — one wins, the other is dropped silently.
  • Canonical pointing to / from every page.

Checklist

  • One Seo helper used everywhere.
  • Each public route has unique title and description.
  • Canonical set absolute, per-page.
  • OG image generated and validated in three external debuggers.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.