[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-ba541f6b-fb32-40a5-97bb-e20f07ba8e6e":3,"$fmW97xZzgdx2ZctUmesl4xJSp3nlRW4xoRPOkubG5XJQ":42},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":33},"ba541f6b-fb32-40a5-97bb-e20f07ba8e6e","seo-hreflang",">","cat_writing_article","mod_writing","sickn33,writing","---\nname: seo-hreflang\ndescription: >\n  Hreflang and international SEO audit, validation, and generation. Detects\n  common mistakes, validates language\u002Fregion codes, and generates correct\n  hreflang implementations. Use when user says \"hreflang\", \"i18n SEO\",\n  \"international SEO\", \"multi-language\", \"multi-region\", or \"language tags\".\nrisk: unknown\nsource: \"https:\u002F\u002Fgithub.com\u002FAgriciDaniel\u002Fclaude-seo\"\ndate_added: \"2026-03-21\"\nuser-invokable: true\nargument-hint: \"[url]\"\nallowed-tools:\n  - Read\n  - Grep\n  - Glob\n  - Bash\n  - WebFetch\n---\n\n# Hreflang & International SEO\n\n## When to Use\n- Use when validating or generating hreflang for multilingual or multiregional sites.\n- Use when the user mentions international SEO, language tags, x-default, or hreflang issues.\n- Use when auditing locale alternates across HTML, headers, or sitemap implementations.\n\nValidate existing hreflang implementations or generate correct hreflang tags\nfor multi-language and multi-region sites. Supports HTML, HTTP header, and\nXML sitemap implementations.\n\n## Validation Checks\n\n### 1. Self-Referencing Tags\n- Every page must include an hreflang tag pointing to itself\n- The self-referencing URL must exactly match the page's canonical URL\n- Missing self-referencing tags cause Google to ignore the entire hreflang set\n\n### 2. Return Tags\n- If page A links to page B with hreflang, page B must link back to page A\n- Every hreflang relationship must be bidirectional (A→B and B→A)\n- Missing return tags invalidate the hreflang signal for both pages\n- Check all language versions reference each other (full mesh)\n\n### 3. x-default Tag\n- Required: designates the fallback page for unmatched languages\u002Fregions\n- Typically points to the language selector page or English version\n- Only one x-default per set of alternates\n- Must also have return tags from all other language versions\n\n### 4. Language Code Validation\n- Must use ISO 639-1 two-letter codes (e.g., `en`, `fr`, `de`, `ja`)\n- Common errors:\n  - `eng` instead of `en` (ISO 639-2, not valid for hreflang)\n  - `jp` instead of `ja` (incorrect code for Japanese)\n  - `zh` without region qualifier (ambiguous; use `zh-Hans` or `zh-Hant`)\n\n### 5. Region Code Validation\n- Optional region qualifier uses ISO 3166-1 Alpha-2 (e.g., `en-US`, `en-GB`, `pt-BR`)\n- Format: `language-REGION` (lowercase language, uppercase region)\n- Common errors:\n  - `en-uk` instead of `en-GB` (UK is not a valid ISO 3166-1 code)\n  - `es-LA` (Latin America is not a country; use specific countries)\n  - Region without language prefix\n\n### 6. Canonical URL Alignment\n- Hreflang tags must only appear on canonical URLs\n- If a page has `rel=canonical` pointing elsewhere, hreflang on that page is ignored\n- The canonical URL and hreflang URL must match exactly (including trailing slashes)\n- Non-canonical pages should not be in any hreflang set\n\n### 7. Protocol Consistency\n- All URLs in an hreflang set must use the same protocol (HTTPS or HTTP)\n- Mixed HTTP\u002FHTTPS in hreflang sets causes validation failures\n- After HTTPS migration, update all hreflang tags to HTTPS\n\n### 8. Cross-Domain Support\n- Hreflang works across different domains (e.g., example.com and example.de)\n- Cross-domain hreflang requires return tags on both domains\n- Verify both domains are verified in Google Search Console\n- Sitemap-based implementation recommended for cross-domain setups\n\n## Common Mistakes\n\n| Issue | Severity | Fix |\n|-------|----------|-----|\n| Missing self-referencing tag | Critical | Add hreflang pointing to same page URL |\n| Missing return tags (A→B but no B→A) | Critical | Add matching return tags on all alternates |\n| Missing x-default | High | Add x-default pointing to fallback\u002Fselector page |\n| Invalid language code (e.g., `eng`) | High | Use ISO 639-1 two-letter codes |\n| Invalid region code (e.g., `en-uk`) | High | Use ISO 3166-1 Alpha-2 codes |\n| Hreflang on non-canonical URL | High | Move hreflang to canonical URL only |\n| HTTP\u002FHTTPS mismatch in URLs | Medium | Standardize all URLs to HTTPS |\n| Trailing slash inconsistency | Medium | Match canonical URL format exactly |\n| Hreflang in both HTML and sitemap | Low | Choose one method (sitemap preferred for large sites) |\n| Language without region when needed | Low | Add region qualifier for geo-targeted content |\n\n## Implementation Methods\n\n### Method 1: HTML Link Tags\nBest for: Sites with \u003C50 language\u002Fregion variants per page.\n\n```html\n\u003Clink rel=\"alternate\" hreflang=\"en-US\" href=\"https:\u002F\u002Fexample.com\u002Fpage\" \u002F>\n\u003Clink rel=\"alternate\" hreflang=\"en-GB\" href=\"https:\u002F\u002Fexample.co.uk\u002Fpage\" \u002F>\n\u003Clink rel=\"alternate\" hreflang=\"fr\" href=\"https:\u002F\u002Fexample.com\u002Ffr\u002Fpage\" \u002F>\n\u003Clink rel=\"alternate\" hreflang=\"x-default\" href=\"https:\u002F\u002Fexample.com\u002Fpage\" \u002F>\n```\n\nPlace in `\u003Chead>` section. Every page must include all alternates including itself.\n\n### Method 2: HTTP Headers\nBest for: Non-HTML files (PDFs, documents).\n\n```\nLink: \u003Chttps:\u002F\u002Fexample.com\u002Fpage>; rel=\"alternate\"; hreflang=\"en-US\",\n      \u003Chttps:\u002F\u002Fexample.com\u002Ffr\u002Fpage>; rel=\"alternate\"; hreflang=\"fr\",\n      \u003Chttps:\u002F\u002Fexample.com\u002Fpage>; rel=\"alternate\"; hreflang=\"x-default\"\n```\n\nSet via server configuration or CDN rules.\n\n### Method 3: XML Sitemap (Recommended for large sites)\nBest for: Sites with many language variants, cross-domain setups, or 50+ pages.\n\nSee Hreflang Sitemap Generation section below.\n\n### Method Comparison\n| Method | Best For | Pros | Cons |\n|--------|----------|------|------|\n| HTML link tags | Small sites (\u003C50 variants) | Easy to implement, visible in source | Bloats `\u003Chead>`, hard to maintain at scale |\n| HTTP headers | Non-HTML files | Works for PDFs, images | Complex server config, not visible in HTML |\n| XML sitemap | Large sites, cross-domain | Scalable, centralized management | Not visible on page, requires sitemap maintenance |\n\n## Hreflang Generation\n\n### Process\n1. **Detect languages**: Scan site for language indicators (URL path, subdomain, TLD, HTML lang attribute)\n2. **Map page equivalents**: Match corresponding pages across languages\u002Fregions\n3. **Validate language codes**: Verify all codes against ISO 639-1 and ISO 3166-1\n4. **Generate tags**: Create hreflang tags for each page including self-referencing\n5. **Verify return tags**: Confirm all relationships are bidirectional\n6. **Add x-default**: Set fallback for each page set\n7. **Output**: Generate implementation code (HTML, HTTP headers, or sitemap XML)\n\n## Hreflang Sitemap Generation\n\n### Sitemap with Hreflang\n```xml\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003Curlset xmlns=\"http:\u002F\u002Fwww.sitemaps.org\u002Fschemas\u002Fsitemap\u002F0.9\"\n        xmlns:xhtml=\"http:\u002F\u002Fwww.w3.org\u002F1999\u002Fxhtml\">\n  \u003Curl>\n    \u003Cloc>https:\u002F\u002Fexample.com\u002Fpage\u003C\u002Floc>\n    \u003Cxhtml:link rel=\"alternate\" hreflang=\"en-US\" href=\"https:\u002F\u002Fexample.com\u002Fpage\" \u002F>\n    \u003Cxhtml:link rel=\"alternate\" hreflang=\"fr\" href=\"https:\u002F\u002Fexample.com\u002Ffr\u002Fpage\" \u002F>\n    \u003Cxhtml:link rel=\"alternate\" hreflang=\"de\" href=\"https:\u002F\u002Fexample.de\u002Fpage\" \u002F>\n    \u003Cxhtml:link rel=\"alternate\" hreflang=\"x-default\" href=\"https:\u002F\u002Fexample.com\u002Fpage\" \u002F>\n  \u003C\u002Furl>\n  \u003Curl>\n    \u003Cloc>https:\u002F\u002Fexample.com\u002Ffr\u002Fpage\u003C\u002Floc>\n    \u003Cxhtml:link rel=\"alternate\" hreflang=\"en-US\" href=\"https:\u002F\u002Fexample.com\u002Fpage\" \u002F>\n    \u003Cxhtml:link rel=\"alternate\" hreflang=\"fr\" href=\"https:\u002F\u002Fexample.com\u002Ffr\u002Fpage\" \u002F>\n    \u003Cxhtml:link rel=\"alternate\" hreflang=\"de\" href=\"https:\u002F\u002Fexample.de\u002Fpage\" \u002F>\n    \u003Cxhtml:link rel=\"alternate\" hreflang=\"x-default\" href=\"https:\u002F\u002Fexample.com\u002Fpage\" \u002F>\n  \u003C\u002Furl>\n\u003C\u002Furlset>\n```\n\nKey rules:\n- Include the `xmlns:xhtml` namespace declaration\n- Every `\u003Curl>` entry must include ALL language alternates (including itself)\n- Each alternate must appear as a separate `\u003Curl>` entry with its own full set\n- Split at 50,000 URLs per sitemap file\n\n## Output\n\n### Hreflang Validation Report\n\n#### Summary\n- Total pages scanned: XX\n- Language variants detected: XX\n- Issues found: XX (Critical: X, High: X, Medium: X, Low: X)\n\n#### Validation Results\n| Language | URL | Self-Ref | Return Tags | x-default | Status |\n|----------|-----|----------|-------------|-----------|--------|\n| en-US | https:\u002F\u002F... | ✅ | ✅ | ✅ | ✅ |\n| fr | https:\u002F\u002F... | ❌ | ⚠️ | ✅ | ❌ |\n| de | https:\u002F\u002F... | ✅ | ❌ | ✅ | ❌ |\n\n### Generated Hreflang Tags\n- HTML `\u003Clink>` tags (if HTML method chosen)\n- HTTP header values (if header method chosen)\n- `hreflang-sitemap.xml` (if sitemap method chosen)\n\n### Recommendations\n- Missing implementations to add\n- Incorrect codes to fix\n- Method migration suggestions (e.g., HTML to sitemap for scale)\n\n## Error Handling\n\n| Scenario | Action |\n|----------|--------|\n| URL unreachable (DNS failure, connection refused) | Report the error clearly. Do not guess site structure. Suggest the user verify the URL and try again. |\n| No hreflang tags found | Report the absence. Check for other internationalization signals (subdirectories, subdomains, ccTLDs) and recommend the appropriate hreflang implementation method. |\n| Invalid language\u002Fregion codes detected | List each invalid code with the correct replacement. Provide a corrected hreflang tag set ready to implement. |\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,66,1787,"2026-05-16 13:39:35",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"写作研究","writing","mdi-pencil-outline","从学术写作到创意文案，让 AI 成为你的专属写作助手",1,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":25,"skillCount":32,"createdAt":26},"文章写作","article","mdi-file-document-edit-outline","博客、新闻稿、自媒体文章等",61,[34],{"id":35,"skillId":4,"version":36,"fileName":37,"fileSize":38,"filePath":39,"fileHash":40,"manifest":41,"createdAt":19},"22d12ca2-687a-4fc6-9d88-b0f49e1cea63","1.0.0","seo-hreflang.zip",3649,"uploads\u002Fskills\u002Fba541f6b-fb32-40a5-97bb-e20f07ba8e6e\u002Fseo-hreflang.zip","da4e4384b79ec7a59c6fdd0ed73bb329e63c771d02d1dab7813b1e37862a9a9f","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":9350}]",{"code":43,"message":44,"data":45},200,"success",{"items":46,"stats":47,"page":50},[],{"averageRating":48,"totalRatings":48,"ratingCounts":49},0,[48,48,48,48,48],{"limit":51,"offset":48,"hasMore":52,"nextOffset":51,"ratedOnly":16},15,false]