component-engineering
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseComponent Engineering Specification
组件工程规范
<overview>
This skill embodies the formal standard for building professional, accessible, and composable React artifacts.
</overview>
<context name="Knowledge Deep-Dives">
You MUST read these reference files to perform your duties:
- **Architecture**: `composition.md` - asChild, Taxonomy, Composition.
- **Accessibility**: `accessibility.md` - Keyboard maps, ARIA, Focus management.
- **Styling**: `styling.md` - `cn` utility, Data attributes, CVA, Design tokens.
</context>
<workflow>
<phase name="review">
<overview>
本Skill体现了构建专业、可访问且可组合的React制品的正式标准。
</overview>
<context name="知识深度探究">
你必须阅读以下参考文件以履行职责:
- **架构**:`composition.md` - asChild、Taxonomy、组件组合。
- **可访问性**:`accessibility.md` - 键盘映射、ARIA、焦点管理。
- **样式**:`styling.md` - `cn`工具、数据属性、CVA、设计令牌。
</context>
<workflow>
<phase name="评审">
/component-review [file]
/component-review [file]
Strictly audit the file against the specification pillars.
- You MUST read all reference files in the directory before proceeding.
references/ - Classify the artifact using .
taxonomy.md - Evaluate Accessibility: You MUST check keyboard support and semantic HTML against .
accessibility.md - Evaluate Architecture: You MUST check for monolithic patterns vs composition against .
composition.md - Evaluate Styling: Look for usage and prop spreading against
data-slot. </phase>styling.md
严格按照规范核心要点审核文件。
- 开始前你必须阅读目录下的所有参考文件。
references/ - 使用对制品进行分类。
taxonomy.md - 评估可访问性:你必须对照检查键盘支持和语义化HTML。
accessibility.md - 评估架构:你必须对照检查单体模式与组件组合的情况。
composition.md - 评估样式:检查的使用和属性扩散情况,对照
data-slot。 </phase>styling.md
/component-create [name] [intent]
/component-create [name] [intent]
Build a new artifact following the "Architecture First" workflow.
- You MUST read the relevant files to select the correct patterns.
references/*.md - Choose the Taxonomy type.
- Select the base Semantic Element or Headless Primitive.
- You MUST implement the Keyboard Map.
- You MUST apply asChild support if the component is an activator/trigger.
- You MUST expose Data Attributes (,
data-state).data-slot - Use the utility for class merging. </phase>
cn
遵循「架构优先」的工作流构建新制品。
- 你必须阅读相关的文件以选择正确的模式。
references/*.md - 选择Taxonomy类型。
- 选择基础的语义化元素或Headless Primitive。
- 你必须实现键盘映射(Keyboard Map)。
- 如果组件是激活器/触发器,你必须实现asChild支持。
- 你必须暴露数据属性(Data Attributes)(、
data-state)。data-slot - 使用工具进行类名合并。 </phase>
cn