Communitygithub.com

coastdigitalgroup/coastai-skills

Design a systematic framework for "Skeleton Screens" that manages perceived performance and layout stability (CLS) by mapping UI "bones" to incoming content.

coastai-skills とは?

coastai-skills is a Claude Code agent skill that design a systematic framework for "Skeleton Screens" that manages perceived performance and layout stability (CLS) by mapping UI "bones" to incoming content.

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

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

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

ドキュメント

Skeleton State System

Purpose

The Skeleton State System provides a methodology for designing the "loading" state of an interface. Unlike generic spinners or progress bars, skeletons approximate the final layout using "bones" (low-fidelity shapes), which reduces the user's perceived wait time and prevents Cumulative Layout Shift (CLS) by reserving the necessary space before content arrives.

Use Cases

  • Data-Heavy Dashboards: Where multiple widgets load at different speeds.
  • Content Feeds: Scrolling through lists of articles, products, or social posts.
  • Image-Heavy Grids: Reserving space for high-resolution images to prevent page "jumping."
  • Search & Filter Views: Providing immediate feedback that the system is processing a query.
  • Single Page Applications (SPAs): Managing transitions between routes where data is fetched asynchronously.

When NOT to Use

  • Instant Interactions: If content loads in under 300ms, a skeleton may cause a distracting "flicker."
  • Simple, Low-Context Loads: For small elements like a single button or a tiny tag, a standard spinner or "Loading..." text is more appropriate.
  • Static Content: Content that is hard-coded or cached and renders immediately.
  • High-Velocity Real-time Data: If data changes so fast that the skeleton would be constantly appearing and disappearing, it may cause visual fatigue.

Inputs

  1. Target Layout: The final "fully loaded" design of the component or page.
  2. Content Variables: What parts of the UI are dynamic (Text, Images, Prices, Avatars)?
  3. Spatial Dimensions: The exact height, width, and aspect ratios of the final elements.
  4. Brand Tone: The primary and secondary colors used for the "bone" base and shimmer effect.

Outputs

  1. Skeleton Blueprint: A low-fidelity map showing the arrangement of bones.
  2. Bone Specification: Definitions for shape (circles vs. rectangles) and sizing (fixed vs. percentage-based).
  3. Transition Strategy: Rules for how the skeleton fades out and content fades in.
  4. Accessibility Requirements: Guidance for aria-busy and aria-hidden implementation.

Workflow

1. Map the "Target" Geometry

Break down the final component into its basic geometric primitives:

  • Circles: For avatars, icons, or rounded buttons.
  • Rectangles (Rounded): For cards, image containers, and text blocks.
  • Lines: For single rows of text (headlines, metadata).

2. Define the Bone Hierarchy

Not every element needs a bone. Focus on the structural "anchors":

  • Primary Bone: The largest visual element (e.g., a product image).
  • Secondary Bones: Headlines and primary metadata.
  • Tertiary Bones: Small meta-details or action buttons (can often be omitted if they are too small).

3. Establish Spatial Matching (The CLS Rule)

Ensure the skeleton's dimensions exactly match the final content's container:

  • Aspect Ratio: Use fixed aspect ratios (e.g., 16:9 for videos) for the bone so it doesn't change size when the asset loads.
  • Text Sizing: Use bones that match the line-height and approximate width of the text they represent.

4. Design the Rhythm and Shimmer

Skeletons should feel "alive" but not distracting:

  • Base Color: Use a low-contrast, neutral color (e.g., Light Gray).
  • Shimmer (The Pulse): Apply a subtle gradient animation that moves from left to right.
  • Synchronization: If multiple skeletons are on screen, ensure their animations are synchronized to prevent visual chaos.
  • Reduced Motion: Wrap the shimmer keyframe animation in an @media (prefers-reduced-motion: reduce) query that disables movement and falls back to a static or gently opacity-pulsing bone.

5. Define the "Hand-off" Transition

Plan the exit of the skeleton:

  • Timing: Use a short fade-in (e.g., 200ms) for the real content to prevent a harsh "snap" transition.
  • Staggering: For lists, decide if items should appear all at once or as they load individually.

Decision Rules

  • The 300ms Rule: Only show a skeleton if the load is expected to take longer than 300ms.
  • Bone Accuracy: A bone should represent the container, not the specific data. For example, a text bone should be a simple bar, not a jagged line mimicking specific letters.
  • Line Count: For multi-line text, use 2 or 3 bones of varying widths (e.g., the last line at 60% width) to simulate natural paragraph flow.
  • Spinner vs. Skeleton:
    • Use a Skeleton for page-level or section-level transitions.
    • Use a Spinner for small, localized actions (like a "Saving..." button state).

Constraints

  • Accessibility: Skeletons must be marked with aria-hidden="true" so screen readers don't try to "read" the empty bars. The parent container should use aria-busy="true" while loading, and ideally hold a visually hidden aria-live="polite" region that announces "Loading" and then the completion state once content replaces the skeleton — do not use aria-live on the skeleton bones themselves. Respect prefers-reduced-motion for the shimmer effect.
  • Contrast: The skeleton colors must be distinct from the background but not so high-contrast that they look like active content.
  • Responsiveness: Skeleton bones must scale using the same grid/flex logic as the final content.

Common Failure Patterns

  • The "CLS Jump": A skeleton that is 200px tall being replaced by content that is 300px tall, causing the page to "jump."
  • Shimmer Overload: Animations that are too fast or high-contrast, causing motion sickness or distraction.
  • Content-Bones Mismatch: Using a circular bone for a square image, or vice versa.
  • Over-Complexity: Trying to recreate every tiny icon as a bone, resulting in a cluttered "ghost" layout.
  • The "Static Skeleton": A skeleton with no animation, which can be mistaken for a broken or empty page.

Validation Criteria

  • Skeleton dimensions exactly match the final "loaded" state (Zero CLS).
  • Aspect ratios for images/videos are reserved using fixed containers.
  • Shimmer animation is subtle and moves left-to-right.
  • Text-heavy areas use bones that simulate natural line lengths.
  • aria-hidden="true" is applied to the skeleton elements, and the loading container uses aria-busy="true".
  • Shimmer animation respects prefers-reduced-motion: reduce.
  • The transition from skeleton to content is a smooth fade (200ms approx).
  • Skeleton does not appear for loads faster than 300ms.

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.

関連スキル