Communitygithub.com

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for in-page navigation that orientates users within long-form content and provides direct access to document sections via scroll-synced links.

coastai-skills とは?

coastai-skills is a Claude Code agent skill that design and implement a systematic framework for in-page navigation that orientates users within long-form content and provides direct access to document sections via scroll-synced links.

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/coastdigitalgroup/coastai-skills/tree/HEAD/website-design/table-of-contents-system

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Table of Contents (ToC) System

Purpose

The Table of Contents (ToC) System provides a methodology for designing in-page navigation menus that reflect the structure of a single page or document. It solves the problem of "scroll fatigue" in long-form content by providing a constant visual map of the page's hierarchy, allowing users to understand their current context and jump to specific sections instantly without losing their place.

Use Cases

  • Documentation & Technical Guides: Navigating deep hierarchies of headers and sub-headers.
  • Long-form Articles & Blog Posts: Providing a roadmap for 2,000+ word editorial content.
  • Complex Landing Pages: Helping users jump between Feature, Pricing, and FAQ sections.
  • Legal & Policy Pages: Navigating dense clauses and numbered sections.
  • Resource Hubs: Organizing long lists of links or tools on a single page.

When NOT to Use

  • Short Content (<3 sections): If the entire page can be scanned in two scrolls, a ToC adds unnecessary visual noise.
  • Primary Site Navigation: Do not use a ToC for moving between different pages; use site-navigation-system instead.
  • Linear Wizards: For step-by-step processes where the user must follow a fixed order, use step-progress-system.
  • Minimalist Marketing: Where the goal is a single, uninterrupted narrative flow without diversion.

Inputs

  1. Heading Hierarchy: The map of <h2> through <h4> tags on the page.
  2. Layout Context: The available horizontal space (Sidebar vs. Inline).
  3. Scroll Container: Is the scroll happening on the body or a specific overflowing container?
  4. Brand Tokens: Spacing, typography, and "Active" state colors from the design system.

Outputs

  1. ToC Anatomy Spec: Visual definitions for list items, indentation levels, and the "Active" indicator.
  2. Scroll-Spy Blueprint: Logic for how the "Active" state updates as the user scrolls.
  3. Responsive Adaptation Map: How the ToC transforms from a Desktop sidebar to a Mobile utility (e.g., Sticky Header or Bottom Drawer).
  4. Wayfinding Spec: Definition of smooth-scroll behaviors and focus management.

Workflow

1. Audit the Document Outline

Extract the heading structure. A clean ToC depends on a logical h1 -> h2 -> h3 progression.

  • Primary Level: Usually derived from <h2> tags.
  • Secondary Level: Derived from <h3> tags (indented).
  • Tertiary Level: Rarely shown in the ToC unless the document is exceptionally dense; consider collapsing these by default.

2. Select the Layout Pattern

Choose a spatial arrangement based on the page layout:

  • Persistent Sidebar (Right/Left): Best for wide screens (Desktop). Keeps the map visible at all times.
  • Inline Summary: Placed at the top of the article. Best for mobile or medium-length content where "stickiness" isn't required.
  • Sticky Header/Floating Bar: A minimized version that appears only after scrolling past the hero.

3. Establish Visual Hierarchy (Levels)

Apply the visual-hierarchy-system to indicate depth:

  • Indentation: Use consistent horizontal padding (e.g., --space-s per level) to show parent-child relationships.
  • Typography: Use a smaller font size or muted color for sub-levels (h3) compared to primary levels (h2).
  • Indicators: Use a vertical "progress line" on the left/right of the list to visually connect the items.

4. Design the Scroll-Spy (Active) State

The ToC must stay in sync with the user's viewport:

  • The Active Link: Highlight the link corresponding to the section currently at the top of the viewport.
  • The "Active Line" Effect: If using a vertical line, animate a marker to slide to the active item's position.
  • Feedback Delay: Ensure the active state updates quickly (<100ms) but includes a small buffer to prevent flickering when scrolling between headers.

5. Plan Responsive Wayfinding

Sidebars usually disappear on mobile; provide an alternative:

  • The Mobile ToC Trigger: A sticky button (e.g., "In this section") at the top or bottom of the screen that opens a drawer.
  • The Progressive Reveal: Show only the current <h2> in a sticky bar, with a chevron to expand the full list.

Decision Rules

  • The "Three-Level" Limit: Never show more than 3 levels of depth in a ToC. If the content is deeper, simplify the ToC to focus on h2 and h3 only.
  • Indentation over Icons: Use indentation to show hierarchy rather than bullets or icons, which can clutter the dense text list.
  • Active State Uniqueness: Only ONE item in the ToC should be "Active" at a time.
  • Sticky Threshold: The ToC should become sticky (fixed) only when it reaches the top of the viewport, not immediately upon page load.
  • Click to Jump: Clicking a ToC link must use "Smooth Scrolling" to prevent disorientation, and MUST update the URL hash (#section-id) for shareability.

Constraints

  • Accessibility: The ToC must be wrapped in a <nav> with aria-label="Table of contents". The active link must use aria-current="true" (or aria-current="location"). Ensure the focus ring is visible when tabbing through links.
  • Contrast: Active and inactive states must meet WCAG AA (4.5:1) requirements.
  • Responsiveness: On mobile, the ToC must not overlap the main text content; use a drawer or a toggleable section.
  • Content Sync: Link text in the ToC should match the heading text exactly (or be a clearly recognizable shortened version).

Common Failure Patterns

  • The "Stale" State: The ToC highlighting the wrong section because the scroll-spy trigger point is set too high or too low.
  • The Content Obscurer: A sticky ToC that overlaps the text it's supposed to be helping the user read.
  • Depth Overload: Showing every single h4 and h5, making the ToC longer than the viewport and requiring its own scrollbar (avoid nested scrollbars).
  • Missing IDs: Links that don't work because the headings lack matching id attributes.
  • Broken Back Button: Jumping to a section without updating the URL hash, preventing users from using the browser's "Back" button to return to the ToC.

Validation Criteria

  • A clear visual hierarchy (indentation) exists between h2 and h3 levels.
  • Scroll-spy correctly highlights the active section as the user scrolls.
  • Clicking a link triggers a smooth scroll to the correct section.
  • The URL hash is updated upon clicking a ToC link.
  • The ToC is wrapped in a <nav aria-label="Table of contents"> landmark.
  • The active state is accessible via aria-current.
  • A mobile-specific wayfinding pattern (e.g., Drawer or Sticky Bar) is defined.
  • No more than 3 levels of hierarchy are displayed.

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.

関連スキル