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.

rulestech-robots-txt.md

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

Robots.txt Configuration

Impact: HIGH (Controls crawl budget and blocks sensitive paths)

Robots.txt controls which pages search engine crawlers can access. A misconfigured robots.txt can either block important content from being indexed or waste crawl budget on irrelevant pages. It must always reference your XML sitemap to aid discovery.

Incorrect

# ❌ Bad: blocks CSS/JS (breaks rendering), no sitemap, too open

User-agent: *
Disallow: /css/
Disallow: /js/
Disallow: /images/

# No sitemap reference
# No blocking of admin, API, or internal paths
# ❌ Bad: blocks everything on staging (but staging is publicly accessible)

User-agent: *
Disallow: /

# This only prevents indexing — it does NOT prevent access.
# If staging is public, Google can still find and cache URLs via links.

Problems:

  • Blocking /css/ and /js/ prevents Google from rendering the page, leading to poor indexing of JavaScript-heavy sites
  • Blocking /images/ removes images from Google Image Search traffic
  • No Sitemap: directive makes it harder for crawlers to discover all pages
  • Not blocking admin, API, or staging paths wastes crawl budget and risks exposing internal routes
  • Using robots.txt alone to "hide" staging does not prevent access — it only prevents crawling

Correct

# ✅ Good: robots.txt for production site

# Default rules for all crawlers
User-agent: *

# Block admin and internal paths
Disallow: /admin/
Disallow: /api/
Disallow: /internal/

# Block search result pages (thin/duplicate content)
Disallow: /search
Disallow: /*?s=

# Block user-specific pages
Disallow: /account/
Disallow: /cart
Disallow: /checkout

# Block duplicate filtered/sorted views
Disallow: /*?sort=
Disallow: /*?filter=

# Allow all static assets (CSS, JS, images)
Allow: /css/
Allow: /js/
Allow: /images/
Allow: /fonts/

# Sitemap reference (always absolute URL)
Sitemap: https://example.com/sitemap.xml
# ✅ Good: block AI training crawlers while allowing search engines

User-agent: GPTBot
Disallow: /

User-agent: ChatGPT-User
Disallow: /

User-agent: CCBot
Disallow: /

# Allow search engine crawlers
User-agent: Googlebot
Allow: /

User-agent: Bingbot
Allow: /

User-agent: *
Disallow: /admin/
Disallow: /api/

Sitemap: https://example.com/sitemap.xml
// ✅ Laravel: dynamic robots.txt via route (routes/web.php)
use Illuminate\Support\Facades\App;

Route::get('/robots.txt', function () {
    $content = App::environment('production')
        ? view('seo.robots-production')->render()
        : "User-agent: *\nDisallow: /";

    return response($content, 200)
        ->header('Content-Type', 'text/plain');
});
{{-- ✅ resources/views/seo/robots-production.blade.php --}}
User-agent: *
Disallow: /admin/
Disallow: /api/
Disallow: /account/
Disallow: /cart
Disallow: /checkout
Disallow: /search
Disallow: /*?sort=
Disallow: /*?filter=

Allow: /css/
Allow: /js/
Allow: /images/

Sitemap: {{ url('/sitemap.xml') }}

Benefits:

  • Allowing CSS, JS, and images ensures Google can render pages accurately for indexing
  • Blocking admin, API, and internal paths protects crawl budget and keeps sensitive routes out of search results
  • Blocking search and filtered pages prevents thin or duplicate content from being indexed
  • Sitemap reference helps crawlers discover all important pages efficiently
  • Environment-aware generation prevents production rules from accidentally blocking staging, and vice versa

Reference: Google's Robots.txt Specification

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