Communitygithub.com

coastdigitalgroup/coastai-skills

设计和实现用户隐私管理的系统化框架,处理同意横幅、偏好中心以及持久的隐私控制,以平衡法律合规性与用户信任。

coastai-skills 是什么?

这项技能旨在帮助开发者和AI助手设计并实现一个完整的用户同意与偏好管理系统。它专注于隐私管理的UI/UX层,确保网站中的隐私通知、Cookie横幅和细粒度偏好控制既符合GDPR、CCPA等法规要求,又具备高可访问性和用户信任度。该技能适用于多种平台,包括Claude Code、Cursor及Codex,它提供了从分类同意级别、选择空间模式到定义持久触发器的结构化工作流。核心原则包括遵循“同等权重”规则(拒绝按钮与接受按钮视觉权重相当)、在GDPR中默认关闭非必要类别的开关,以及响应浏览器级全局隐私控制信号。其主要输出包括同意解剖规范、状态矩阵、偏好中心蓝图和交互规范。此外,它还强调避免“暗模式”陷阱,并确保遵循WCAG 2.2可访问性标准,如焦点管理和24×24px的最小触摸目标。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/coastdigitalgroup/coastai-skills/tree/HEAD/website-design/consent-and-preference-system

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

同意与偏好系统

目的

同意与偏好系统提供了一种方法论,用于设计用户隐私管理的视觉和结构框架。它确保隐私通知、Cookie 横幅和细粒度偏好控制以合法合规(GDPR、CCPA)、可访问且高信任度的方式融入到网站体验中。该系统通过将信息组织成清晰的层级结构并提供直观的数据共享控制,防止了“同意疲劳”。

用例

  • 初始同意横幅: 设计首次接触时的覆盖层或通知栏,告知用户 Cookie 的使用。
  • 细粒度偏好中心: 创建模态窗口或页面,用户可在其中切换特定数据类别(例如分析、营销)。
  • 持久的隐私触发器: 实现微妙的“隐私设置”触发器,在初始选择后仍可访问。
  • 法规适配: 标准化设计以满足不同地区的不同要求(例如“全部拒绝”按钮要求)。
  • 沟通偏好: 设计用于管理新闻通讯或营销通知选择加入的 UI。

何时不使用

  • 内部数据治理: 本技能处理 UI/UX 层;不管理后端数据架构或法律策略编写。
  • 通用横幅: 对于简单的公告(如促销或维护),请使用 banner-and-alert-system。
  • 系统设置: 对于纯粹功能性的应用设置(例如主题、语言)且不涉及隐私,请使用 site-navigation-system 或专用设置视图。

输入

  1. 法规要求: 适用哪些法律(GDPR、CCPA/CPRA、DMA)?
  2. 数据类别: 所有数据收集工具的列表(必要、功能、分析、营销/定向)。
  3. 品牌声音: 隐私沟通的预期语气(例如透明、极简、安抚)。
  4. 布局上下文: 横幅应放置的位置(底部栏、浮动框、全屏模态窗口)。
  5. 浏览器信号: 网站是否必须检测并尊重全局隐私控制(GPC)或“禁止追踪”信号作为有效的选择退出。

输出

  1. 同意解剖规范: 定义横幅/模态窗口的区域(标题、描述、开关、操作)。
  2. 状态矩阵: 待定、已接受、已拒绝和聚焦状态的视觉规范。
  3. 偏好中心蓝图: 细粒度类别管理的结构图。
  4. 交互规范: 背景行为、“全部拒绝”的突出程度以及持久触发器放置的规则。

工作流程

1. 分类同意级别

根据法律和用户体验目标确定所需的干扰级别:

  • 级别 1(隐式/信息): 不阻止交互的微妙条。最适合低风险地区或非追踪网站。
  • 级别 2(主动/模态): 在导航之前或期间需要做出选择的浮动框或模态窗口。最适合 GDPR/CCPA 合规。
  • 级别 3(硬门控): 强制阻止任何访问直到做出选择的全屏覆盖层。仅适用于极端合规或年龄验证场景。

2. 选择空间模式

  • 底部栏: 在底部全宽延伸。低干扰,常见模式。
  • 浮动框: 通常位于左下角或右下角。对主要内容干扰较小但高度可见。
  • 偏好模态窗口: 用于细粒度选择的居中覆盖层。通过“管理偏好”按钮触发。

3. 建立信息层级

避免“法律条文疲劳”:

  • 标题: 清晰诚实(例如“您的隐私选择”)。
  • 主要描述: 1-2 句引人注目的句子,解释为什么收集数据以及用户的权利。
  • 类别标签: 高级别分类(例如“个性化”、“广告”),附带可展开的“了解更多”详情。

4. 设计操作优先级

在必要时遵循“同等权重”规则:

  • 主要操作: “全部接受”和“全部拒绝”(或“确认选择”)应具有相似的视觉权重,以避免“暗模式”。
  • 次要操作: “管理偏好”或“Cookie 设置”链接到细粒度视图。
  • 逃生口: 确保用户在使用隐式同意时可以轻松找到“关闭”或“取消”按钮。

5. 定义持久触发器

同意是动态状态;用户必须能够改变主意:

  • “隐私盾”图标: 一个小的、持久的浮动图标(通常位于左下角),可重新打开偏好中心。
  • 页脚链接: site-footer-system 中的专用“Cookie 设置”链接。

6. 尊重浏览器级选择退出信号

对于认可自动选择退出机制(例如 CCPA/CPRA 对全局隐私控制的认可)的司法管辖区:

  • 检测并应用: 如果存在 GPC 信号,则将其视为有效的“拒绝”或“选择退出销售/共享”信号,并在偏好中心反映该状态,无需用户手动重新切换。
  • 勿重提示: 不要仅为了要求用户覆盖他们已经发送的 GPC 信号而重新显示初始横幅。
  • 透明度: 在偏好中心中展示检测到的信号(例如“我们检测到全局隐私控制信号并已应用您的选择退出”),以免状态静默应用。

决策规则

  • “同等权重”规则: 如果您的地区要求“全部拒绝”(例如欧盟),则按钮必须与“全部接受”一样易于查找和点击。避免让“拒绝”按钮成为一个微小的文字链接,而“接受”按钮是一个大蓝色按钮。
  • “默认不勾选”规则: 所有非必要(分析、营销)开关必须在 GDPR 合规下默认为关闭。
  • “清晰语言”规则: 避免技术行话。使用“改进我们的网站”代替“处理基于像素的遥测数据”。
  • 分层披露: 保持初始横幅简单。将 20 段政策列表移至偏好中心或专用隐私政策页面。
  • “尊重信号”规则: 检测到的 GPC 选择退出优先于过时的本地“全部接受” cookie;不要让缓存的同意记录覆盖新鲜的浏览器级选择退出信号。

约束

  • 可访问性: 横幅必须可通过键盘访问。偏好模态窗口必须限制焦点,并且焦点指示器在限制期间必须保持可见且不被遮挡(WCAG 2.2 SC 2.4.11)。所有开关必须有清晰的 ARIA 标签,并满足 24x24px 最小目标尺寸(SC 2.5.8)。
  • 对比度: 按钮文字和开关必须满足 WCAG AA(4.5:1)对比度。
  • 响应式: 横幅绝不能重叠主要移动端导航(例如底部导航栏)。如果浮动框过于拥挤,则切换到全屏抽屉。

常见失败模式

  • “暗模式”陷阱: 使用户无法找到“拒绝”按钮以强制用户同意。
  • 干扰导航: 底部横幅覆盖了网站的移动菜单或主要 CTA。
  • Z 索引冲突: 横幅出现在其他覆盖层或菜单下方,导致无法点击。
  • “50 项清单”: 强制用户切换 50 个单独供应商,而非高级别类别。
  • 逃生中断: 横幅关闭后不允许用户更改其偏好。

验证标准

  • “全部接受”和“全部拒绝”对于目标地区具有适当的视觉突出度。
  • 非必要类别默认设置为“关”状态(为严格合规)。
  • 持久触发器(图标或页脚链接)允许用户重新打开设置。
  • 信息是分层的(简单横幅 -> 详细偏好中心)。
  • 开关和按钮符合 WCAG 2.2 SC 2.5.8(24x24px 最小触摸目标)。
  • 可访问性:偏好模态窗口的焦点管理已处理,焦点指示器从未被遮挡(WCAG 2.2 SC 2.4.11)。
  • 所有文字和交互状态的对比度比率符合 WCAG AA。
  • 全局隐私控制(或等效)信号已被检测并尊重,无需重新提示用户。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for progressive disclosure using accordions, ensuring structural integrity, visual affordances, and accessibility across different content densities and devices.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for long-form content, managing readability, vertical rhythm, and information density to ensure a superior reading experience.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for informational elements that communicate state (Badges) and categorization (Tags) with clarity and accessibility.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for non-overlay notifications, managing global announcements and contextual inline alerts to communicate system states without interrupting the user's flow.

coastdigitalgroup/coastai-skills

Design and implement a systematic, asymmetrical bento-grid layout framework to organize diverse content types cohesively while maintaining strict visual hierarchy, logical focus order, and responsive flexibility.

coastdigitalgroup/coastai-skills

Design a responsive, mobile-first bottom navigation bar and persistent action dock system for mobile websites and web applications, establishing spatial anchors, tab bar anatomy, badge indicators, thumb-zone ergonomics, safe area inset handling, active/inactive state contrast, and desktop responsive adaptation rules.

coastdigitalgroup/coastai-skills

Design a mobile-first bottom sheet overlay system with configurable detents, drag affordances, safe area padding, responsive desktop modal/popover adaptation, and WCAG AA accessibility compliance.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for secondary navigation trails that provide orientation, context, and one-click access to parent levels in deep information architectures.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for buttons and interactive triggers, managing visual hierarchy, variant logic, and action grouping to ensure clear intent and accessible interaction.

coastdigitalgroup/coastai-skills

Design a systematic framework for date and time selection, managing calendar grids, range pickers, and scheduling interfaces to ensure precision and accessibility.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for modular content containers that maintain hierarchy, structural integrity, and action alignment across variable content and responsive viewports.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for horizontal discovery components, managing navigation affordances, scroll behavior, and accessibility to ensure effective content density without compromising usability.

coastdigitalgroup/coastai-skills

Design a systematic, highly accessible, and developer-friendly UI layout framework for code blocks, snippet showcases, multi-file code tabs, line-highlighting, diff views, and syntax token contrast in technical documentation and developer platforms.

coastdigitalgroup/coastai-skills

Design a systematic framework for global command menus (Cmd+K panels) that combines keyboard-driven navigation, command execution, and shortcut discovery into an accessible, responsive overlay.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for threaded conversations, managing nesting depths, action hierarchies, and community signaling to foster engagement and readability.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for side-by-side comparison interfaces, managing high attribute density and responsive complexity to support informed decision-making.

coastdigitalgroup/coastai-skills

Design and implement a systematic, highly accessible, and responsive visual layout framework for conversational chat widgets, live chat boxes, and chatbot panels that ensures clear message scannability, native focus flow, and seamless mobile keyboard adaptation.

coastdigitalgroup/coastai-skills

Design a systematic, accessible, and high-conversion framework for custom select dropdowns and comboboxes, defining anatomy, states, search-filtering, and responsive mobile-adaptive patterns.

coastdigitalgroup/coastai-skills

Design and specify a systematic dark theme framework, establishing rules for elevation-based surface colors, desaturated brand accents, text legibility, and media adaptation to ensure an accessible, low-fatigue experience.

coastdigitalgroup/coastai-skills

Design and implement a systematic color palette that ensures WCAG 2.2 accessibility compliance. Trigger this skill when asked to define brand colors, create UI themes, or establish a visual system for a website.

相关技能