cookie-consent
它能做什么
这项技能检查网站是否在设置可选 Cookie(例如分析或广告代码)之前征得同意。适合必须遵守欧盟等地区隐私规则的网站所有者。
适用场景
- ✓当你的网站为欧盟访客设置分析或广告 Cookie 时。
- ✓当追踪脚本在访客同意之前就已加载时。
- ✓当你需要提供让访客更改或撤回选择的方式时。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/cookie-consent/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在我的网站上添加 Cookie 横幅,使分析代码在访客点击同意之前不会运行。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查非必要脚本在访客接受该类别之前是否保持阻止,并添加以后更改偏好的方式,通常通过同意管理工具实现。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Show a cookie consent notice
GDPR violations can result in fines up to €20 million or 4% of global annual turnover. Regulators across the EU have actively fined organizations for deploying tracking cookies without valid consent.
Quick Reference
- GDPR requires consent before setting non-essential cookies (analytics, advertising, personalization)
- Essential/strictly necessary cookies (session, security, login) do not require consent
- Consent must be freely given, specific, informed, and unambiguous — pre-ticked boxes are invalid
- Users must be able to withdraw consent as easily as they gave it
- Scripts and pixels must not load until the user has actively accepted their category
- Non-essential trackers must stay blocked until consent and after revocation
Check
Check whether the site displays a cookie consent notice before setting non-essential cookies. Verify that analytics, advertising, and tracking scripts do not load until the user has actively accepted. Check whether users can reject non-essential cookies without losing access to content.
Fix
Implement a cookie consent management platform (CMP) that blocks non-essential scripts until consent is granted. Configure analytics and tracking tags to initialize only after explicit consent. Provide a mechanism for users to change their consent preferences at any time.
Explain
Explain what GDPR requires for cookie consent, the difference between essential and non-essential cookies, why pre-ticked boxes are invalid consent, and what a technically compliant consent implementation looks like.
Code Review
Review server config, headers, forms, and integration points related to Show a cookie consent notice. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response. Check that tracker initialization is gated on consent and that a persistent "change cookie settings" path exists after the banner is gone.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/privacy/cookie-consent
常见问题
哪些 Cookie 不需要同意?
严格必要的 Cookie,例如用于会话、安全和登录的 Cookie。
默认勾选的选项可以算作同意吗?
不可以。这项技能说明,默认勾选的选框不是有效的同意。
GDPR 罚款有多高?
这项技能指出,罚款可达 2000 万欧元或全球年营业额的 4%。
详情
作者的原始描述
Use when reviewing a website for GDPR/CCPA compliance, specifically whether cookie consent is obtained before non-essential cookies are set.
热度
- GitHub 星标
- 75k
- 排名
- #2788
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。