expo-design-system-scaffolder
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseExpo Design System Scaffolder
Expo Design System 脚手架
Parameterized templates that generate Expo / React Native design system components which start
correct instead of being retrofitted. Every template uses Unistyles v3 variants (never a
escape hatch), -as-prop, design tokens, built-in accessibility, and web/iOS parity (
hover/focus/cursor on interactive primitives), and cites the
rule IDs it satisfies.
styleref_webexpo-design-system可参数化的模板,用于生成Expo / React Native设计系统组件,从一开始就确保组件符合规范,无需后期改造。每个模板均采用Unistyles v3变体(绝不使用逃逸方案)、-as-prop、设计令牌、内置无障碍支持,并实现Web/iOS一致性(交互式原语上的悬停/聚焦/光标效果),同时会标注其满足的规则ID。
styleref_webexpo-design-systemWhen to Apply
适用场景
Use this skill when the user wants to:
- Create or add a new shared component — a button, card, text, input, or other primitive
- Scaffold a new screen that lists a domain entity (appointments, patients, notes)
- Add a new design token group (colors, etc.) to the Unistyles theme
- Add a Storybook story that catalogs a component's variants
- Start a new feature and want its components to follow the design system from the first commit
- Set up or update the design system index so agents discover and reuse existing components before building new ones
当用户有以下需求时,可使用此Skill:
- 创建或添加新的共享组件——按钮、卡片、文本、输入框或其他原语
- 搭建新页面,用于展示领域实体列表(如预约、患者、笔记)
- 向Unistyles主题中添加新的设计令牌组(如颜色等)
- 添加Storybook故事,用于分类展示组件的变体
- 启动新功能,希望组件从第一版提交就遵循设计系统规范
- 设置或更新设计系统索引,让Agent在构建新组件前先发现并复用现有组件
Available Templates
可用模板
To scaffold: read the template, substitute the placeholders, and write the result under the
design system package (or for the screen). Placeholders are single-brace identifier tokens
(e.g., ); literal TSX and Unistyles braces (e.g., , )
stay as-is.
app/{ComponentName}{ variant }{item.title}| Template | Generates | Placeholders |
|---|---|---|
| Pressable primitive with | |
| Composite surface with | |
| Typed text component with | |
| Labeled input: controlled/uncontrolled, | |
| Entity list composed from primitives: FlashList, memoized row, web row hover/cursor, safe-area insets | |
| Raw → semantic → component token group to merge into the Unistyles theme | |
| Storybook story rendering every variant side by side | |
| The design system's single public entry and inventory catalog — agents read it before styling to reuse what exists (reuse-first) | |
Common placeholders:
- — PascalCase component, e.g.
{ComponentName},AppButton,AppCard,AppTextAppTextField - — PascalCase screen with a
{ScreenName}suffix, e.g.ScreenAppointmentsScreen - /
{Entity}/{entity}— PascalCase, camelCase, and plural, e.g.{entity_plural}/Appointment/appointmentappointments - — route segment pushed for a row, e.g.
{route_path}appointments - — camelCase token group name, e.g.
{token_group}statusBadge - — the destination path, written into the header comment
{file_path}
搭建步骤:阅读模板,替换占位符,然后将结果写入设计系统包目录(页面模板写入目录)。占位符为单大括号标识令牌(例如);TSX和Unistyles的字面大括号(例如、)保持原样。
app/{ComponentName}{ variant }{item.title}| 模板 | 生成内容 | 占位符 |
|---|---|---|
| 带有 | |
| 带有 | |
| 带有 | |
| 带标签的输入框:受控/非受控、 | |
| 由原语组成的实体列表:FlashList、记忆化行组件、Web行悬停/光标效果、安全区域内边距 | |
| 原始→语义化→组件令牌组,可合并到Unistyles主题中 | |
| Storybook故事,用于并排渲染所有变体 | |
| 设计系统的唯一公共入口及组件清单目录——Agent在样式设计前会读取此文件,优先复用现有组件(复用优先原则) | |
通用占位符说明:
- — 大驼峰命名的组件,例如
{ComponentName}、AppButton、AppCard、AppTextAppTextField - — 大驼峰命名的页面,后缀为
{ScreenName},例如ScreenAppointmentsScreen - /
{Entity}/{entity}— 大驼峰、小驼峰及复数形式,例如{entity_plural}/Appointment/appointmentappointments - — 点击行时跳转的路由段,例如
{route_path}appointments - — 小驼峰命名的令牌组名称,例如
{token_group}statusBadge - — 目标文件路径,会写入头部注释
{file_path}
How to Use
使用方法
- Pick the template for what you are building.
- Choose values for its placeholders (see the table and each template's header comment).
- Substitute the tokens and write the file under (or
design_system_dirfor the screen).app_dir - Generate a matching story with so the variants are cataloged.
component-story.tsx.template - Append the new component to the design system index () — an
component-index.ts.templateplus a one-line catalog entry — so the next agent finds and reuses it instead of rebuilding it.export - Fill in the data layer the screen imports (, the
use{Entity}Listtype) — the scaffold owns the view; you own the data.domain - Read references/conventions.md for the rules each template enforces and when to deviate.
- 选择与你要构建的内容匹配的模板。
- 为模板的占位符选择对应值(参考表格及每个模板的头部注释)。
- 替换令牌并将文件写入目录(页面模板写入
design_system_dir目录)。app_dir - 使用生成对应的Storybook故事,以便分类展示变体。
component-story.tsx.template - 将新组件添加到设计系统索引()中——添加一个
component-index.ts.template语句及一行清单条目——让后续Agent能够找到并复用它,而非重新构建。export - 填充页面导入的数据层(、
use{Entity}List类型)——脚手架负责视图部分,你负责数据部分。domain - 阅读references/conventions.md了解每个模板遵循的规则以及何时可以偏离规则。
Setup
设置
config.json- — design system package source (default
design_system_dir)packages/design-system/src - — Expo Router routes directory for the screen template (default
app_dir)app
config.json- — 设计系统包的源码目录(默认
design_system_dir)packages/design-system/src - — 用于页面模板的Expo Router路由目录(默认
app_dir)app
Related Skills
相关Skill
- — the rule pack these templates follow; each generated file cites it.
expo-design-system - — feature development around the scaffolded components.
expo-react-native-coder
- — 这些模板遵循的规则包;每个生成的文件都会引用它。
expo-design-system - — 围绕搭建好的组件进行功能开发。
expo-react-native-coder