Communitygithub.com

coastdigitalgroup/coastai-skills

设计和实现结构清晰、可访问且响应式的导航框架,引导用户浏览网站的信息架构。

coastai-skills 是什么?

这个站点导航系统技能提供了一套完整的方法论,用于组织、设计和实现网页的结构化路径。它专注于帮助开发者和设计师创建平衡信息密度与清晰度的导航,同时确保在所有设备上维持可访问性和视觉层级。该技能支持多种导航模式(如简单栏、下拉菜单、Mega菜单和移动抽屉),并提供了从信息架构分类、响应式行为定义到可访问性增强的完整工作流。它适用于Claude Code、Cursor、Codex等AI编程助手,帮助快速生成符合WCAG 2.2标准的导航代码。通过详细的验证清单和决策规则,该技能能有效避免常见的设计缺陷(如“神秘肉导航”),确保导航系统在可用性和可访问性方面达到专业水准。

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

在你喜欢的 AI 中提问

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

文档

站点导航系统

目的

站点导航系统技能提供了一种用于组织和设计网站结构路径的方法论。它确保用户能够定位自己、快速找到信息,并在所有设备类型之间轻松移动。一个健壮的导航系统平衡了信息密度与清晰度,同时保持了可访问性和视觉层级。

用例

  • 为新建网站设计全局页眉和页脚。
  • 重组复杂网站的信息架构 (IA)。
  • 实现响应式导航模式(例如移动抽屉、Mega菜单)。
  • 在内容密集型站点上改进“寻路”(面包屑、子导航)。
  • 审计现有导航的可访问性和可用性差距。

何时不使用

  • 路由极少的单页应用 (SPA): 导航在单个视图中纯粹是功能性的(例如一个简单的仪表盘工具)。
  • 沉浸式/实验性网站: 故意避免使用标准导航约定以达到叙事或艺术目的。
  • 独立着陆页: 目标是单一的转化路径,全局导航可能会分散用户的注意力(但可能仍然使用“返回顶部”或最小锚点导航)。

输入

  1. 信息架构 (IA): 一个站点地图或按层次分类的页面列表。
  2. 用户角色与目标: 用户需要执行的最频繁的任务是什么?
  3. 内容优先级: 哪些链接是“主要”(全局)、“次要”(上下文相关)或“实用”(工具/账户)?
  4. 设备约束: 目标断点以及触控与鼠标交互要求。

输出

  1. 导航地图: 页眉、页脚和子导航元素的结构指南。
  2. 响应式策略: 导航如何从桌面端适应到移动端的定义。
  3. 交互规范: 下拉菜单、活动状态和焦点管理的行为。
  4. 可访问性地标: 为屏幕阅读器导航定义的ARIA角色和标签。

工作流

1. 分类导航层级

将您的站点地图划分为功能层级:

  • 主要: 核心站点区域(例如,产品、服务、关于我们)。
  • 次要/上下文相关: 特定于某个部分的链接(例如,特定产品类别)。
  • 实用: 非核心但必要的工具(例如,搜索、登录、语言选择器)。
  • 第三级(页脚): SEO链接、法律信息、社交媒体和冗余的全局链接。

2. 选择导航模式

根据内容密度选择模式:

  • 简单栏: 3–7 个链接。最适合中小型网站。
  • 下拉菜单: 最适合具有 2 级层次结构的网站。
  • Mega菜单: 最适合具有许多类别的大型电子商务或企业网站。
  • 移动抽屉: 移动端标准;在一个垂直堆栈中包含所有导航层级。

3. 为寻路设计

确保用户始终知道他们在哪里:

  • 活动状态: 视觉上区分当前页面链接,并使用 aria-current="page" 为辅助技术标记它。
  • 面包屑: 用于深度超过 3 级的网站。
  • 一致放置: 在所有页面上将全局导航保持在相同位置。

4. 定义响应式行为

确定导航如何折叠:

  • 断点切换: 确切决定桌面菜单何时变成“汉堡包”菜单。
  • 优先级修剪: 在移动端,如果实用链接(如“搜索”)优先级高,则将其移出抽屉并放入页眉。
  • 触摸目标: 满足 WCAG 2.2 SC 2.5.8(目标大小最小值)24x24px 并具有充足间距;对于主要拇指交互目标,首选 44x44px。

5. 确立可访问性

  • 地标: 使用带有唯一 aria-label 的 <nav> 标签(例如,“主菜单”,“页脚”)。
  • 键盘路径: 确保逻辑的 Tab 顺序和可见的 :focus-visible 状态,且这些状态永远不会被粘性页眉或覆盖层遮蔽(WCAG 2.2 SC 2.4.11 焦点不被遮蔽)。
  • 跳过链接: 为键盘用户提供一个“跳转到内容”链接。
  • ARIA 状态: 对于可切换菜单,使用 aria-expanded 和 aria-controls。

决策规则

  • 7 链接规则: 尝试将主导航限制在 7 项或更少,以减轻认知负荷(米勒定律)。
  • 可预测性优于创新: 使用标准图标(汉堡包表示菜单,放大镜表示搜索)以确保立即识别。
  • 视觉层级: 最重要的操作(例如,“立即开始”)应该是样式化的按钮,而不是文本链接。
  • 粘性与静态: 仅当用户在滚动时需要频繁访问导航时才使用粘性页眉(例如,长篇内容或仪表盘)。

约束

  • 可访问性: 必须完全可仅通过键盘导航。导航链接的对比度必须满足 WCAG AA (4.5:1)。触摸目标需满足 WCAG 2.2 SC 2.5.8。
  • 响应式: 导航绝不能水平溢出视口。
  • 层级: 导航不应与页面的 H1 或主要 CTA 竞争。

常见失败模式

  • “神秘肉”导航: 使用没有标签且不被普遍理解的图标。
  • 过度拥挤的页眉: 试图容纳太多实用链接,导致混乱和误点击。
  • 不可访问的抽屉: 创建无法通过键盘关闭或打开时不捕捉焦点的移动菜单。
  • 缺少反馈: 当用户在当前页面或悬停在链接上时没有视觉变化。

验证标准

  • 导航被分为清晰的层级(主要、实用、页脚)。
  • 活动状态在视觉上可区分且可访问。
  • 移动端导航功能正常,并包含所有主要链接。
  • 键盘用户可以访问所有链接并仅使用键盘关闭菜单。
  • 地标 (<nav>) 被正确使用和标记。
  • 移动端的触摸目标至少满足 WCAG 2.2 24x24px 最小值(主要操作首选 44x44px)。
  • “跳转到内容”链接存在且功能正常。

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 framework for user privacy, managing consent banners, preference centers, and persistent privacy controls to balance legal compliance with user trust.

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 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.

相关技能