Communitygithub.com

ulasalyesil/personal-website-v2

遵循 components.build 规范构建现代、可组合且无障碍的 React UI 组件。适用于创建、评审或重构组件库、设计系统以及任何可复用 UI 组件的场景。在涉及组件 API、组合模式、无障碍访问、样式系统或 TypeScript 属性定义的任务时自动触发。

personal-website-v2 是什么?

该技能基于 components.build 规范,为 AI 代理(如 Claude Code、Cursor)提供了一套完整的 React UI 组件开发指南。它包含了 16 个优先级排序的规则类别,从核心原则、组合模式、无障碍访问(ARIA、键盘导航、焦点管理),到受控/非受控状态管理、TypeScript 属性设计、多态性(as 属性)、As-Child 组合模式、数据属性约定、Tailwind CSS + CVA 样式方案、设计令牌、文档规范、组件注册表以及 npm 发布策略。它特别适用于生成符合工业标准、可维护且对所有人友好的组件代码。该技能由 Hayden Bleasel 和 shadcn 共同编写,并作为 AI 技能进行适配。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ulasalyesil/personal-website-v2/tree/HEAD/.agents/skills/components-build

在你喜欢的 AI 中提问

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

文档

Components.build 规范

构建现代、可组合且无障碍 UI 组件的全面指南。包含 16 个规则类别,涵盖了从核心原则到分发的所有内容,由 Hayden Bleasel 和 shadcn 共同编写。

何时应用

在以下情况下参考这些指南:

  • 创建新的 React 组件或组件库
  • 设计组件 API 和属性接口
  • 实现无障碍功能(键盘、ARIA、焦点管理)
  • 构建可组合的组件架构
  • 使用 Tailwind CSS 和 CVA 进行样式化
  • 将组件发布到注册表或 npm

按优先级排序的规则类别

优先级类别重点前缀
1概述规范范围和目标overview
2原则核心设计理念principles
3定义通用术语definitions
4组合分解复杂组件composition
5无障碍键盘、屏幕阅读器、ARIAaccessibility
6状态受控/非受控模式state
7类型TypeScript 属性和接口types
8多态性使用 as 属性切换元素polymorphism
9作为子元素Radix Slot 组合模式as-child
10数据属性data-state 和 data-slotdata-attributes
11样式化Tailwind CSS、cn 工具函数、CVAstyling
12设计令牌CSS 变量和主题design-tokens
13文档组件文档documentation
14注册表组件注册表registry
15NPM发布到 npmnpm
16市场组件市场marketplaces

快速参考

1. 概述

  • overview - 规范范围、目标和理念

2. 原则

  • principles - 可组合性、无障碍性、可定制性、透明性

3. 定义

  • definitions - 通用术语(基础组件、复合组件、无头组件等)

4. 组合

  • composition-root - 带有 Context 的根组件,用于共享状态
  • composition-item - 项包装组件
  • composition-trigger - 可交互的触发器组件
  • composition-content - 内容展示组件
  • composition-export - 命名空间导出模式

5. 无障碍

  • accessibility-semantic-html - 使用合适的 HTML 元素
  • accessibility-keyboard - 完整的键盘导航支持
  • accessibility-aria - 正确的 ARIA 角色、状态和属性
  • accessibility-focus - 焦点管理和恢复
  • accessibility-live-regions - 屏幕阅读器公告
  • accessibility-contrast - 颜色对比度要求

6. 状态

  • state-uncontrolled - 内部状态管理
  • state-controlled - 外部状态委托
  • state-controllable - 使用 useControllableState 支持两种模式

7. 类型

  • types-extend-html - 扩展原生 HTML 属性
  • types-export - 导出属性类型以供消费者使用
  • types-single-element - 一个组件包装一个元素

8. 多态性

  • polymorphism-as-prop - 更改渲染的元素类型
  • polymorphism-typescript - 类型安全的多态组件
  • polymorphism-defaults - 语义元素默认值

9. 作为子元素

  • as-child-slot - 使用 Radix Slot 进行属性合并
  • as-child-composition - 与子组件组合

10. 数据属性

  • data-attributes-state - 使用 data-state 进行样式状态管理
  • data-attributes-slot - 使用 data-slot 定位子组件

11. 样式化

  • styling-cn-utility - 组合 clsx 和 tailwind-merge
  • styling-order - 基础 → 变体 → 条件 → 用户覆盖
  • styling-cva - 使用 Class Variance Authority 定义变体
  • styling-css-variables - 使用 CSS 变量实现动态值

12. 设计令牌

  • design-tokens-css-variables - 将令牌定义为 CSS 变量
  • design-tokens-theming - 支持浅色/深色模式和主题

13. 文档

  • documentation-props - 使用 JSDoc 记录所有属性
  • documentation-examples - 提供使用示例

14. 注册表

  • registry-structure - 注册表文件结构
  • registry-schema - 组件元数据模式

15. NPM

  • npm-package-json - 包配置
  • npm-exports - 模块导出

16. 市场

  • marketplaces-distribution - 组件分发策略

如何使用

阅读单个规则文件以获取详细解释和代码示例:

rules/composition/SKILL.md
rules/accessibility/SKILL.md
rules/styling/SKILL.md

每个规则文件包含:

  • 简要解释为什么重要
  • 带解释的错误代码示例
  • 带解释的正确代码示例
  • 最佳实践和常见陷阱

完整编译文档

如需包含所有规则展开的完整指南:AGENTS.md

关键原则

  1. 组合优于配置 - 将组件分解为可组合的子组件
  2. 默认无障碍 - 不是事后补丁,而是硬性要求
  3. 单一元素包装 - 每个组件包装一个 HTML 元素
  4. 扩展 HTML 属性 - 始终扩展原生元素属性
  5. 导出类型 - 使属性类型对消费者可用
  6. 支持两种状态模式 - 受控和非受控
  7. 智能类合并 - 使用带有 tailwind-merge 的 cn() 工具函数

作者

共同编写:

作为 AI 技能适配:

基于 components.build 规范。

Individual skills in this repo

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

ulasalyesil/personal-website-v2

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

ulasalyesil/personal-website-v2

Conduct design interviews, generate five distinct UI variations in a temporary design lab, collect feedback, and produce implementation plans. Use when the user wants to explore UI design options, redesign existing components, or create new UI with multiple approaches to compare.

ulasalyesil/personal-website-v2

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

ulasalyesil/personal-website-v2

Design and implement microinteractions, motion design, transitions, and user feedback patterns. Use when adding polish to UI interactions, implementing loading states, or creating delightful user experiences.

ulasalyesil/personal-website-v2

This skill is for interface design — dashboards, admin panels, apps, tools, and interactive products. NOT for marketing design (landing pages, marketing sites, campaigns).

ulasalyesil/personal-website-v2

Best practices and example-driven guidance for building SwiftUI views and components. Use when creating or refactoring SwiftUI UI, designing tab architecture with TabView, composing screens, or needing component-specific patterns and examples.

ulasalyesil/personal-website-v2

UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples.

ulasalyesil/personal-website-v2

Conduct WCAG 2.2 accessibility audits with automated testing, manual verification, and remediation guidance. Use when auditing websites for accessibility, fixing WCAG violations, or implementing accessible design patterns.

ulasalyesil/personal-website-v2

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

ulasalyesil/personal-website-v2

Enforces an opinionated UI baseline to prevent AI-generated interface slop.

ulasalyesil/personal-website-v2

Ship correct, complete metadata.

ulasalyesil/personal-website-v2

Survey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on source code — never implements, fixes, or refactors anything itself. Use when asked to audit a codebase, find improvement opportunities (bugs, security, performance, test coverage, tech debt, migrations, DX), suggest features or where to take the project next (roadmap, product direction), or generate handoff plans for another agent to implement.

ulasalyesil/personal-website-v2

Defines the product's objects, relationships, states, and vocabulary independently of any interface — the most load-bearing layer

ulasalyesil/personal-website-v2

Maps domain concepts, terminology conflicts, and bounded contexts — produces a noun harvest for the conceptual model layer

ulasalyesil/personal-website-v2

Maps interaction structure and flow — produces breadboard notation with edge cases, failure paths, and open decisions

ulasalyesil/personal-website-v2

Framework orientation for Layers of Product Design — load this first; provides the context all other skills depend on

ulasalyesil/personal-website-v2

User research planning and synthesis at the observed behaviour layer — produces candidate job stories with confidence ratings

ulasalyesil/personal-website-v2

Diagnostic audit across all seven layers — identifies the bottleneck layer and recommends where to focus

ulasalyesil/personal-website-v2

Connects user opportunities to business outcomes and solution bets — produces a strategy tree and prioritised experiments

ulasalyesil/personal-website-v2

Audits existing surface against lower-layer decisions and produces a surface decision inventory — vocabulary, object consistency, completeness, feedback, hierarchy, accessibility

相关技能