clean-up-comments
它能做什么
这项技能检查正式环境的 HTML 中是否有只应供开发者看的笔记、调试代码和未使用的标记。适合希望上线前页面干净、安全的开发者。
适用场景
- ✓当你准备发布网站或页面时。
- ✓当页面源代码中出现只为开发者准备的 TODO 或调试笔记时。
- ✓当构建过程输出了应当删除的注释或控制台代码时。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/clean-up-comments/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在上线前清理我落地页的 HTML,删除开发者笔记和调试标记。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会审查模板和渲染后的 HTML,查找 TODO、FIXME 和调试笔记、遗留标记以及敏感细节,然后将其删除,同时保留无障碍和法律相关的注释。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Remove comments and debug code in production
Comments expose internal logic to attackers, increase file size, and can leak sensitive information like API endpoints, credentials, or system architecture.
Quick Reference
- Remove TODO, FIXME, DEBUG comments before production
- Keep accessibility and legal comments
- Configure build tools to strip comments automatically
- Review for sensitive data leaks in comments
Check
Review this HTML code for unnecessary comments, debug code, console logs, and temporary markup that should be removed before production deployment.
Fix
Remove all development comments, debug code, unused markup, and temporary elements from the HTML before deploying to production.
Explain
Explain why cleaning up code before production is important for security, performance, and professional presentation of web applications.
Code Review
Review templates, server-rendered HTML, and shared components that output markup related to Remove comments and debug code in production. Flag exact elements, attributes, and routes where the rendered HTML violates the rule.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/html/clean-up-comments
常见问题
注释为什么可能带来安全风险?
这项技能说明,它们可能向任何查看页面源代码的人泄露内部逻辑、API 地址或系统细节。
哪些注释应该保留?
根据这项技能,应保留无障碍和法律相关的注释。
构建时能自动删除注释吗?
可以。这项技能建议配置构建工具去除注释。
详情
作者的原始描述
Use when reviewing templates, rendered HTML, or shared components related to Remove comments and debug code in production. Validate the final browser-facing markup, not just the source framework abstraction.
热度
- GitHub 星标
- 75k
- 排名
- #2773
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。