add-ui-component

Create reusable UI components following design system, accessibility, and state boundary rules.

Updated Feb 10, 2026
One-click install
npx skills add https://github.com/vesviet/agent-skills --skill add-ui-component-vesviet
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: add-ui-component
Source: https://github.com/vesviet/agent-skills/tree/main/core/skills/frontend/add-ui-component
Command: npx skills add https://github.com/vesviet/agent-skills --skill add-ui-component-vesviet

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building frontend components without a consistent process leads to duplicated patterns, accessibility gaps, and state management sprawl. This Skill guides the creation or evolution of reusable UI components that conform to the repo's design system, WAI-ARIA accessibility rules, and clear state boundaries. ## Core Features & Use Cases - Design System Conformance: Enforces existing design tokens, the cn() utility for Tailwind class merging, and headless primitives like Radix UI instead of reinventing focus traps. - Component Contract Definition: Requires a UI Component Spec defining props, events, states, and whether the component is presentational, stateful, or compositional before coding. - 2026 Architecture Patterns: Covers React Server Components leaf placement, React 19 form actions, Lit v3 web component bridging, and anti-slop mechanics like min-h-[100dvh] and motion values. - Use Case: When adding a new Dialog component to a shared library, use this Skill to mirror an existing component's structure, define its contract, wire keyboard and focus behavior, and add interaction tests. ## Quick Start Use the add-ui-component skill to create a new reusable Dialog component following our design system and accessibility rules.

Frequently Asked Questions about add-ui-component

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a reusable React component that follows a design system?▼

Start by inspecting a similar existing component, then define a component contract covering props, events, and states. Build the smallest useful version with semantic structure, apply the repo's design tokens and cn() utility, and add render and interaction tests.

What headless UI libraries should I use for accessible components?▼

Use headless accessibility primitives like Radix UI, Base UI, or Ark UI for interactive components. They provide WAI-ARIA roles, keyboard focus management, and escape key handling so you do not reinvent focus trap logic.

Should I use compound components or prop-based configuration?▼

Prefer compound component patterns like Dialog.Root and Dialog.Content over mega-components with dozens of boolean props. Composition keeps components understandable and avoids prop-soup complexity that is hard to maintain.

Where should the use client directive go in React Server Components?▼

Push the use client directive as deep down the component tree as possible, following the leaf pattern. Keep Server Components at the top and pass interactive client components down as children to maximize SSR benefits.

How do I handle continuous animations like scroll progress in React?▼

Never use useState for continuous values like pointer physics or scroll progress. Bind continuous motion to motion/react values such as useMotionValue and useTransform to avoid unnecessary re-renders.

What checks are required for AI-generated UI components?▼

Verify conformance to design tokens, run an axe-devtools accessibility scan, strip non-repository CSS, and conduct a peer code review. Do not present AI-generated components as production-ready without these checks and a visual regression baseline.