seo-optimizer by ailabs-393/ai-labs-claude-skills
npx skills add https://github.com/ailabs-393/ai-labs-claude-skills --skill seo-optimizer此技能为 HTML/CSS 网站提供全面的 SEO 优化能力。它分析网站的 SEO 问题,实施最佳实践,并生成涵盖所有关键 SEO 方面的优化报告,包括元标签、标题结构、图片优化、结构化数据标记、移动端优化和技术 SEO。
当用户请求以下内容时使用此技能:
使用 SEO 分析器脚本开始全面分析:
python scripts/seo_analyzer.py <directory_or_file>
此脚本分析 HTML 文件并生成详细报告,涵盖:
输出选项:
--json:用于程序化处理的机器可读 JSON 格式广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
使用示例:
# 分析单个文件
python scripts/seo_analyzer.py index.html
# 分析整个目录
python scripts/seo_analyzer.py ./public
# 获取 JSON 输出
python scripts/seo_analyzer.py ./public --json
分析器将发现的问题分为三个级别:
关键问题 (🔴) - 立即修复:
警告 (⚠️) - 为获得最佳 SEO 效果应尽快修复:
良好实践 (✅) - 已优化:
按优先级顺序处理问题:
缺少或标题标签不佳:
<!-- 在 <head> 中添加唯一、描述性的标题 -->
<title>主要关键词 - 次要关键词 | 品牌名称</title>
缺少元描述:
<!-- 在 <head> 中添加有吸引力的描述 -->
<meta name="description" content="清晰、简洁的描述,包含目标关键词并鼓励点击。150-160 个字符。">
缺少 H1 或多个 H1:
图片缺少 Alt 文本:
<!-- 为所有图片添加描述性 alt 文本 -->
<img src="image.jpg" alt="描述图片内容的文本">
缺少 HTML Lang 属性:
<!-- 添加到 <html> 开始标签 -->
<html lang="en">
视口元标签(对移动端 SEO 至关重要):
<meta name="viewport" content="width=device-width, initial-scale=1.0">
字符集声明:
<meta charset="UTF-8">
Open Graph 标签(用于社交媒体分享):
<meta property="og:title" content="您的页面标题">
<meta property="og:description" content="您的页面描述">
<meta property="og:image" content="https://example.com/image.jpg">
<meta property="og:url" content="https://example.com/page-url">
<meta property="og:type" content="website">
Twitter Card 标签:
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="您的页面标题">
<meta name="twitter:description" content="您的页面描述">
<meta name="twitter:image" content="https://example.com/image.jpg">
规范 URL:
<link rel="canonical" href="https://example.com/preferred-url">
结构化数据标记 - 有关详细实现,请参阅 references/schema_markup_guide.md。常见类型:
实现示例:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "文章标题",
"author": {
"@type": "Person",
"name": "作者姓名"
},
"datePublished": "2024-01-15",
"image": "https://example.com/image.jpg"
}
</script>
修复问题后,生成 XML 网站地图:
python scripts/generate_sitemap.py <directory> <base_url> [output_file]
示例:
# 为网站生成网站地图
python scripts/generate_sitemap.py ./public https://example.com
# 指定输出位置
python scripts/generate_sitemap.py ./public https://example.com ./public/sitemap.xml
该脚本:
生成后:
使用 assets/robots.txt 中的模板并进行自定义:
User-agent: *
Allow: /
# 阻止敏感目录
Disallow: /admin/
Disallow: /private/
# 引用您的网站地图
Sitemap: https://yourdomain.com/sitemap.xml
将 robots.txt 放置在网站根目录。
实施修复后:
本地测试:
在线测试:
定期维护:
对于全新的 HTML/CSS 网站:
python scripts/seo_analyzer.py ./publicpython scripts/generate_sitemap.py ./public https://yourdomain.com对于需要优化的现有网站:
python scripts/seo_analyzer.py ./public对于优化特定页面:
python scripts/seo_analyzer.py page.html对于博客文章和文章:
references/schema_markup_guide.md)references/seo_checklist.md:涵盖所有 SEO 方面的全面检查清单:
有关任何 SEO 元素的详细规范,请参考此文件。
references/schema_markup_guide.md:实施 schema.org 结构化数据的完整指南:
为任何内容类型实施结构化数据标记时,请参考此文件。
scripts/seo_analyzer.py:用于自动化 SEO 分析的 Python 脚本。分析 HTML 文件的常见问题并生成详细报告。可以输出文本或 JSON 格式。对于重复分析是确定且可靠的。
scripts/generate_sitemap.py:用于生成 XML 网站地图的 Python 脚本。自动爬取目录,估算优先级和更新频率,并生成格式正确、可提交给搜索引擎的网站地图。
assets/robots.txt:包含常见配置和注释的 robots.txt 模板文件。根据特定需求进行自定义并放置在网站根目录。
<header>、<nav>、<main>、<article>、<aside>、<footer>)# 分析单个文件
python scripts/seo_analyzer.py index.html
# 分析整个网站
python scripts/seo_analyzer.py ./public
# 生成网站地图
python scripts/generate_sitemap.py ./public https://example.com
# 获取 JSON 分析输出
python scripts/seo_analyzer.py ./public --json
每周安装量
164
代码仓库
GitHub 星标数
325
首次出现
2026年1月23日
安全审计
安装于
opencode148
gemini-cli139
codex136
cursor131
github-copilot122
claude-code120
This skill provides comprehensive SEO optimization capabilities for HTML/CSS websites. It analyzes websites for SEO issues, implements best practices, and generates optimization reports covering all critical SEO aspects including meta tags, heading structure, image optimization, schema markup, mobile optimization, and technical SEO.
Use this skill when the user requests:
Start with comprehensive analysis using the SEO analyzer script:
python scripts/seo_analyzer.py <directory_or_file>
This script analyzes HTML files and generates a detailed report covering:
Output Options :
--json: Machine-readable JSON format for programmatic processingExample Usage :
# Analyze single file
python scripts/seo_analyzer.py index.html
# Analyze entire directory
python scripts/seo_analyzer.py ./public
# Get JSON output
python scripts/seo_analyzer.py ./public --json
The analyzer categorizes findings into three levels:
Critical Issues (🔴) - Fix immediately:
Warnings (⚠️) - Fix soon for optimal SEO:
Good Practices (✅) - Already optimized:
Address issues in priority order:
Missing or Poor Title Tags :
<!-- Add unique, descriptive title to <head> -->
<title>Primary Keyword - Secondary Keyword | Brand Name</title>
Missing Meta Descriptions :
<!-- Add compelling description to <head> -->
<meta name="description" content="Clear, concise description that includes target keywords and encourages clicks. 150-160 characters.">
Missing H1 or Multiple H1s :
Images Without Alt Text :
<!-- Add descriptive alt text to all images -->
<img src="image.jpg" alt="Descriptive text explaining image content">
Missing HTML Lang Attribute :
<!-- Add to opening <html> tag -->
<html lang="en">
Viewport Meta Tag (critical for mobile SEO):
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Charset Declaration :
<meta charset="UTF-8">
Open Graph Tags (for social media sharing):
<meta property="og:title" content="Your Page Title">
<meta property="og:description" content="Your page description">
<meta property="og:image" content="https://example.com/image.jpg">
<meta property="og:url" content="https://example.com/page-url">
<meta property="og:type" content="website">
Twitter Card Tags :
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Your Page Title">
<meta name="twitter:description" content="Your page description">
<meta name="twitter:image" content="https://example.com/image.jpg">
Canonical URL :
<link rel="canonical" href="https://example.com/preferred-url">
Schema Markup - Refer to references/schema_markup_guide.md for detailed implementation. Common types:
Example implementation:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Article Title",
"author": {
"@type": "Person",
"name": "Author Name"
},
"datePublished": "2024-01-15",
"image": "https://example.com/image.jpg"
}
</script>
After fixing issues, generate an XML sitemap:
python scripts/generate_sitemap.py <directory> <base_url> [output_file]
Example :
# Generate sitemap for website
python scripts/generate_sitemap.py ./public https://example.com
# Specify output location
python scripts/generate_sitemap.py ./public https://example.com ./public/sitemap.xml
The script:
After generation :
Use the template from assets/robots.txt and customize:
User-agent: *
Allow: /
# Block sensitive directories
Disallow: /admin/
Disallow: /private/
# Reference your sitemap
Sitemap: https://yourdomain.com/sitemap.xml
Place robots.txt in website root directory.
After implementing fixes:
Local Testing :
Online Testing :
Regular maintenance :
For a brand new HTML/CSS website:
python scripts/seo_analyzer.py ./publicpython scripts/generate_sitemap.py ./public https://yourdomain.comFor an existing website needing optimization:
python scripts/seo_analyzer.py ./publicFor optimizing a specific page:
python scripts/seo_analyzer.py page.htmlFor blog posts and articles:
references/schema_markup_guide.md)references/seo_checklist.md : Comprehensive checklist covering all SEO aspects:
Reference this for detailed specifications on any SEO element.
references/schema_markup_guide.md : Complete guide for implementing schema.org structured data:
Reference this when implementing schema markup for any content type.
scripts/seo_analyzer.py : Python script for automated SEO analysis. Analyzes HTML files for common issues and generates detailed reports. Can output text or JSON format. Deterministic and reliable for repeated analysis.
scripts/generate_sitemap.py : Python script for generating XML sitemaps. Automatically crawls directories, estimates priorities and change frequencies, and generates properly formatted sitemaps ready for submission to search engines.
assets/robots.txt : Template robots.txt file with common configurations and comments. Customize for specific needs and place in website root directory.
User-First : Optimize for users first, search engines second. Good user experience leads to better SEO.
Unique Content : Every page should have unique title, description, and H1. Duplicate content hurts SEO.
Mobile-First : Google uses mobile-first indexing. Always include viewport meta tag and ensure mobile responsiveness.
Accessibility = SEO : Accessible websites (alt text, semantic HTML, proper headings) rank better.
Quality Over Quantity : Substantial, valuable content ranks better than thin content. Aim for comprehensive pages.
Technical Foundation : Fix critical technical issues (missing tags, broken structure) before advanced optimization.
Structured Data : Schema markup helps search engines understand content and can lead to rich results.
Regular Updates : SEO is ongoing. Keep content fresh, monitor analytics, and adapt to algorithm changes.
Natural Language : Write for humans using natural language. Avoid keyword stuffing.
Validation : Always validate changes with testing tools before deploying to production.
<header>, <nav>, <main>, <article>, <aside>, <footer>)# Analyze single file
python scripts/seo_analyzer.py index.html
# Analyze entire website
python scripts/seo_analyzer.py ./public
# Generate sitemap
python scripts/generate_sitemap.py ./public https://example.com
# Get JSON analysis output
python scripts/seo_analyzer.py ./public --json
Weekly Installs
164
Repository
GitHub Stars
325
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode148
gemini-cli139
codex136
cursor131
github-copilot122
claude-code120
程序化SEO实战指南:大规模创建优质页面,避免内容单薄惩罚
35,800 周安装