seo-optimization
Optimize a webpage for search engines by analyzing on-page elements, improving technical performance, and implementing structured data for maximum visibility. Use when the user requests seo optimization or provides relevant inputs for this workflow.
git clone --depth 1 https://github.com/seb1n/awesome-ai-agent-skills /tmp/seo-optimization && cp -r /tmp/seo-optimization/marketing-and-seo/seo-optimization ~/.claude/skills/seo-optimizationSKILL.md
# SEO Optimization
This skill enables an AI agent to perform comprehensive search engine optimization on any webpage or website. The agent audits on-page factors (title tags, meta descriptions, headings, internal links), evaluates technical SEO health (Core Web Vitals, mobile-first indexing, crawlability), and implements structured data markup. The goal is to produce actionable recommendations that improve organic search rankings and click-through rates.
## Workflow
1. **Crawl and inventory the page.** Fetch the target URL and parse the full HTML document. Extract the title tag, meta description, canonical URL, Open Graph tags, all heading elements (H1–H6), images with alt attributes, and every internal and external link. Record the HTTP status code, response time, and redirect chain if applicable.
2. **Analyze on-page SEO elements.** Evaluate the title tag for length (50–60 characters), keyword placement, and uniqueness. Check the meta description for length (150–160 characters) and compelling call-to-action language. Verify there is exactly one H1 tag that contains the primary keyword, and that H2–H4 tags form a logical content hierarchy. Flag missing alt text on images and broken internal links.
3. **Evaluate technical SEO factors.** Assess Core Web Vitals — Largest Contentful Paint (LCP < 2.5s), First Input Delay (FID < 100ms), and Cumulative Layout Shift (CLS < 0.1). Check mobile-friendliness by analyzing the viewport meta tag and responsive layout. Verify the existence and correctness of `robots.txt`, XML sitemap, canonical tags, and hreflang tags for international sites. Identify render-blocking resources and unused CSS/JS.
4. **Implement structured data markup.** Generate JSON-LD schema markup appropriate to the page type — Article, Product, FAQ, BreadcrumbList, Organization, or LocalBusiness. Validate the markup against Google's Rich Results requirements. Ensure the schema references match the visible page content to avoid structured data penalties.
5. **Audit internal linking and content depth.** Map the internal link graph to identify orphan pages and shallow content clusters. Recommend anchor text improvements and suggest new internal links that strengthen topical authority. Evaluate content length and keyword density relative to top-ranking competitors.
6. **Generate a prioritized SEO report.** Produce a structured report with findings organized by impact (critical, high, medium, low). Include before/after code snippets for recommended changes, estimated effort for each fix, and expected ranking impact. Provide a checklist format so engineers and content teams can track completion.
## Usage
Provide the agent with the URL of the webpage to optimize and, optionally, the target keyword. The agent will return a full audit report with actionable fixes.
**Prompt:** `Optimize the following page for the keyword "project management tools": https://example.com/blog/best-pm-tools`
## Examples
### Example 1: Blog Post On-Page Optimization
**Request:** Optimize `https://acme.com/blog/remote-work-tips` for the keyword "remote work tips".
**Before — HTML head:**
```html
<head>
<title>Blog Post | Acme Co</title>
<meta name="description" content="Read our latest blog post.">
</head>
```
**After — Optimized HTML head:**
```html
<head>
<title>15 Remote Work Tips That Boost Productivity in 2025 | Acme Co</title>
<meta name="description" content="Discover 15 proven remote work tips to stay productive, manage your time, and avoid burnout. Backed by research from 500+ distributed teams.">
<link rel="canonical" href="https://acme.com/blog/remote-work-tips">
<meta property="og:title" content="15 Remote Work Tips That Boost Productivity">
<meta property="og:description" content="Proven strategies from 500+ distributed teams.">
<meta property="og:type" content="article">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "15 Remote Work Tips That Boost Productivity in 2025",
"author": { "@type": "Person", "name": "Jane Smith" },
"datePublished": "2025-03-10",
"description": "Proven remote work tips backed by research from 500+ distributed teams."
}
</script>
</head>
```
### Example 2: Technical SEO Audit Findings
**Request:** Run a technical SEO audit on `https://acme.com`.
**Audit Report:**
| Priority | Issue | Details | Fix |
|----------|-------|---------|-----|
| Critical | Missing XML sitemap | No sitemap found at `/sitemap.xml`; 40% of pages not indexed | Generate and submit sitemap to Search Console |
| Critical | LCP = 4.8s on mobile | Hero image is 2.4 MB uncompressed PNG | Convert to WebP, add `width`/`height`, use `loading="lazy"` |
| High | Duplicate title tags | 12 pages share the title "Acme Co — Home" | Write unique, keyword-rich titles for each page |
| High | Missing canonical tags | 8 pages lack `<link rel="canonical">`, causing index bloat | Add self-referencing canonicals to every page |
| Medium | No `robots.txt` | Entire site crawlable including `/admin` and `/staging` | Create `robots.txt` disallowing private paths |
| Low | Images missing alt text | 34 of 120 images have empty `alt` attributes | Add descriptive alt text with relevant keywords |
## Best Practices
- **Write for humans first, search engines second.** Keyword stuffing degrades user experience and triggers ranking penalties. Aim for natural keyword integration at 1–2% density.
- **Prioritize Core Web Vitals.** Google uses LCP, FID, and CLS as direct ranking signals. Compress images, defer non-critical JS, and set explicit dimensions on media elements.
- **Use self-referencing canonical tags on every page.** This prevents duplicate content issues caused by URL parameters, trailing slashes, or session IDs.
- **Build topical authority through internal linking.** Link related content in clusters around pillar pages. Use descriptive anchor text instead of generic "click here" links.
- **Validate struDesign reproducible evaluations for AI agents with representative task sets, explicit rubrics, appropriate graders, baselines, regression gates, and failure analysis. Use when defining agent quality, comparing prompts or models, validating a release, measuring tool-use reliability, investigating regressions, or deciding whether an agent is ready for production.
Design privacy-aware observability for AI agents using traces, spans, structured events, metrics, cost attribution, dashboards, alerts, and investigation workflows. Use when instrumenting an agent, debugging intermittent tool or model failures, defining service-level objectives, analyzing latency or spend, auditing agent decisions, or preparing production monitoring.
Design and verify auditable human oversight, approval gates, escalation paths, and safe state transitions for AI agent workflows. Use when deciding which agent actions require review, adding approve/reject or dual-control flows, preventing unauthorized autonomous effects, creating decision records, reducing rubber-stamping, or recovering safely from rejected, expired, or failed actions.
Design, implement, harden, and verify Model Context Protocol (MCP) servers with precise tool contracts, least-privilege authorization, safe transports, structured errors, and interoperability tests. Use when creating a new MCP server, exposing an API or data source through MCP, reviewing an MCP server design, adding or revising MCP tools, or preparing an MCP server for production.
Design and operate bounded multi-agent workflows with task decomposition, dependency graphs, ownership, handoff contracts, shared-state controls, approvals, recovery, and synthesis. Use when a task contains genuinely independent workstreams, specialized roles, parallel research or implementation, reviewer-worker loops, or coordination problems that one agent should not execute sequentially.
Design and validate model-facing tool definitions with clear names, action-oriented descriptions, bounded JSON Schema parameters, explicit side effects, safe defaults, idempotency, errors, and realistic tests. Use when creating function-calling tools, MCP tools, agent actions, structured tool inputs, or when a model selects the wrong tool, invents arguments, or causes unsafe side effects.
Plan, execute, document, and retest authorized security assessments of AI agents and multi-agent workflows using safe adversarial cases, synthetic identities, canaries, and evidence-based findings. Use when defining red-team rules of engagement, assessing prompt injection or excessive agency, testing tool and identity boundaries, evaluating memory or cross-agent attacks, scoring a campaign, or verifying remediation in an approved environment.
Threat-model and harden AI agents, RAG systems, assistants, and tool-using workflows against direct, indirect, stored, cross-agent, and multimodal prompt injection. Use when reviewing an agent architecture, isolating untrusted content, constraining tools and egress, protecting secrets, adding injection-focused tests, investigating a suspected injection incident, or documenting residual prompt-injection risk.