robots-txt
它能做什么
这个技能检查网站根目录的 robots.txt 文件,确保它有效且没有屏蔽整个网站。它面向希望搜索引擎能访问其内容的网站所有者。
适用场景
- ✓你请智能体为网站创建或检查 robots.txt 文件的时候。
- ✓网站从搜索中消失,而你怀疑 robots.txt 中有屏蔽规则的时候。
- ✓你上线新网站,并希望有一个干净的 robots.txt 并链接站点地图的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/robots-txt/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我检查 robots.txt 文件,确保它没有屏蔽我的网站,并指向我的站点地图吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会获取 robots.txt 文件,检查它是否返回正常响应以及指令是否正确。它会查找意外屏蔽整个网站的情况,并添加指向正式站点地图的 Sitemap 行。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Publish a robots.txt file
robots.txt is the first file crawlers fetch; misconfigured directives can silently block search engines from crawling your entire site, killing organic visibility.
Quick Reference
- Serve a valid
robots.txtat/robots.txton the production domain, returning HTTP 200 - Include a
Sitemap:directive pointing to your XML sitemap - Never disallow crawling of CSS/JS assets that render your pages
- Avoid blocking all crawlers with
Disallow: /on a live site
Check
Fetch /robots.txt on the live domain and verify it returns HTTP 200, uses correct User-agent / Disallow / Allow syntax, and includes a Sitemap: directive pointing to the XML sitemap. Check for accidental Disallow: / directives.
Fix
Create or update robots.txt at the web root with valid directives. Add a live Sitemap: line for the production sitemap URL. Remove any Disallow: / rules that block the whole site or resources needed for rendering.
Explain
Explain how robots.txt controls crawler access, why an accidental Disallow: / can delist a site, and why CSS/JS must remain accessible for rendering-based indexing.
Code Review
Review metadata generation, rendered HTML, structured data, and response headers related to Publish a robots.txt file. Flag exact routes or templates where search-facing output violates the rule, and describe how to verify the final page output.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/seo/robots-txt
常见问题
如果 robots.txt 屏蔽了所有内容会怎样?
这个技能说,意外地对整个网站使用 Disallow 可能会使网站从搜索中消失。
应该屏蔽 CSS 和 JavaScript 吗?
不应该。这个技能说,这些文件必须可以访问,以便搜索引擎渲染页面。
robots.txt 能控制索引吗?
它控制的是抓取。这个技能解释说,控制索引要在页面上使用 noindex 标签。
详情
作者的原始描述
Use when applies to any public website. Use when auditing technical SEO foundations or diagnosing crawl coverage gaps.
热度
- GitHub 星标
- 75k
- 排名
- #3005
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。