All skills
asyrafhussin avatar

/seo-best-practices

@46bae0b

SEO patterns, conventions, and audit for web applications. Use when implementing meta tags, structured data, Core Web Vitals, sitemaps, Open Graph, auditing SEO, or optimizing pages for search engines. Triggers on "audit SEO", "check SEO", "review SEO", or tasks involving search optimization, schema markup, or social sharing meta tags.

Use this Skill: https://skilld.dev/gh/asyrafhussin/agent-skills/seo-best-practices

This session only. Nothing lands on disk.

rulesspa-routing.md

≈924 tokens on demand. Your agent reads this file only when SKILL.md points to it.

SPA Routing and Crawlability

Impact: HIGH (Search engines need real links and unique URLs to crawl)

Search engines discover pages by following links. If your application uses click handlers instead of real anchor tags, crawlers cannot discover or index your pages. With Laravel + Inertia.js, routing is handled server-side by Laravel, but the frontend must still use proper <Link> components to render crawlable <a> elements.

Incorrect

// ❌ Bad: onClick-only navigation with no real links
import { router } from '@inertiajs/react';

export default function Navigation() {
  return (
    <nav>
      <button onClick={() => router.visit('/products')}>Products</button>
      <span onClick={() => router.visit('/about')} style={{ cursor: "pointer" }}>
        About Us
      </span>
      <div onClick={() => window.location.hash = "#contact"}>Contact</div>
    </nav>
  );
}
// ❌ Bad: product card with no crawlable link
import { router } from '@inertiajs/react';

function ProductCard({ product }: { product: { slug: string; name: string } }) {
  return (
    <div
      className="product-card"
      onClick={() => router.visit(`/products/${product.slug}`)}
    >
      <h3>{product.name}</h3>
      {/* No <a> tag — search engines cannot follow this link */}
    </div>
  );
}

Problems:

  • <button> and <span> with onClick or router.visit() are not crawlable; search engines cannot follow them
  • No <a href> means users cannot right-click to open in a new tab, copy the link, or share the URL
  • router.visit() works for navigation but does not render a crawlable HTML element

Correct

// ✅ Good: Inertia <Link> renders real <a> tags
import { Link } from '@inertiajs/react';

export default function Navigation() {
  return (
    <nav>
      <Link href="/products">Products</Link>
      <Link href="/about">About Us</Link>
      <Link href="/contact">Contact</Link>
    </nav>
  );
}
// ✅ Good: product card with crawlable Inertia Link
import { Link } from '@inertiajs/react';

function ProductCard({ product }: { product: { slug: string; name: string; summary: string } }) {
  return (
    <article className="product-card">
      <h3>
        <Link href={`/products/${product.slug}`}>{product.name}</Link>
      </h3>
      <p>{product.summary}</p>
    </article>
  );
}
// ✅ Laravel: proper route definitions with named routes
// routes/web.php
Route::get('/', [HomeController::class, 'index'])->name('home');
Route::get('/products', [ProductController::class, 'index'])->name('products.index');
Route::get('/products/{product:slug}', [ProductController::class, 'show'])->name('products.show');
Route::get('/about', [AboutController::class, 'index'])->name('about');

// 404 handling is automatic — Laravel returns a 404 response for undefined routes
// Customize with resources/views/errors/404.blade.php

Benefits:

  • Inertia's <Link> renders real <a href> elements that crawlers can follow to discover all pages
  • Laravel handles routing server-side, so every page has a unique, indexable URL by default
  • Inertia's first page load is server-rendered HTML, making content immediately visible to crawlers
  • Users can right-click, open in new tab, copy link, and share URLs naturally
  • Laravel's built-in 404 handling returns proper status codes for undefined routes

Reference: Google - Links crawlable

Source: SKILL.md on GitHub

1 warning16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is a comprehensive SEO reference and audit tool for React and Laravel applications. It provides detailed patterns for optimizing Core Web Vitals, technical SEO, and structured data. No malicious code, obfuscation, or data exfiltration patterns were identified. The skill is designed to analyze project code and provide structural feedback based on a predefined checklist.

  • Socket16d

    5 alerts: gptAnomaly

  • Snyk16d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 46bae0b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 6 months ago
metadata
{
  "author": "agent-skills",
  "version": "1.2.0"
}

README badge

README badge for asyrafhussin/agent-skills/seo-best-practices