npx skills add https://github.com/jwilger/agent-skills --skill atomic-design价值: 简洁性与沟通。通过小型、命名明确、可组合的构件构建用户界面,使团队中的每个人都能理解界面,并避免由单体组件带来的复杂性。
教授如何将 UI 组件组织成一个复杂度递增的层次结构:原子、分子、有机体和模板。每个层级都有明确的职责和组合规则。最终成果是一个组件系统,其中每个部分都是可复用的、可独立测试的,并使用共享的词汇命名。
从最小的可复用元素开始,向上组合。切勿跳过任何一个层级。
四个层级:
原子: 不可再分的 UI 元素。一个按钮、一个输入框、一个标签、一个图标。一个视觉元素,一个职责。原子引用设计令牌来定义所有视觉属性(颜色、间距、排版)。
分子: 作为单元运作的小型原子组合。一个表单字段(标签 + 输入框 + 错误信息)。一个搜索栏(输入框 + 按钮 + 图标)。每个分子对应一种交互模式。
有机体: 由分子和原子组成的复杂组件,构成界面的一个独立部分。一个导航头部、一个完整的表单、一个数据表格。每个有机体对应一个功能区域。
模板: 页面级布局,将有机体排列成一个完整的视图。一个仪表板模板、一个列表-详情模板。模板定义结构和内容插槽,而非具体数据。
示例:
Atom: Button, Input, Label, ErrorMessage
Molecule: FormField (Label + Input + ErrorMessage)
Organism: LoginForm (FormField + FormField + Button)
Template: AuthPage (Header + LoginForm + Footer)
应做:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
不应做:
组件负责渲染 UI。它们通过 props 接收数据。它们不获取数据、不管理业务逻辑、也不持有应用状态。
示例:
Presentational (good):
UserCard({ name, email, avatar }) -> renders UI
Container (separate):
UserCardContainer() -> fetches data, passes to UserCard
不应做:
将每个设计决策(颜色、间距、排版、阴影、圆角)提取为命名的令牌。组件引用令牌,绝不直接使用原始值。
示例:
/* Tokens */
--color-primary: #0066cc;
--spacing-sm: 8px;
--spacing-md: 16px;
/* Component uses tokens, not values */
.button { background: var(--color-primary); padding: var(--spacing-sm); }
不应做:
#0066cc 或 8px通过嵌套更简单的组件来构建复杂组件。不要通过类继承或深层属性转发链来扩展基础组件。
应做:
IconButton = Icon + Button (组合)Card > CardHeader + CardBody (插槽)不应做:
FancyButton extends Button (继承)在所有模式下均为建议性。组件层次结构和令牌规范是自我约束的。
硬性约束:
[RP]spacing-md 而不是 card-header-padding-top)。在完成本技能指导的工作后,请验证:
如果有任何标准未满足,请在继续之前重新审视相关实践。
此技能可独立工作。为增强工作流,它可与以下技能集成:
缺少依赖项?请使用以下命令安装:
npx skills add jwilger/agent-skills --skill tdd
每周安装数
91
代码仓库
GitHub 星标数
2
首次出现
2026 年 2 月 12 日
安全审计
已安装于
claude-code82
cline74
antigravity67
continue67
codebuddy66
codex66
Value: Simplicity and communication. Building UI from small, named, composable pieces makes the interface understandable to everyone on the team and prevents the complexity that comes from monolithic components.
Teaches how to organize UI components into a hierarchy of increasing complexity: atoms, molecules, organisms, and templates. Each level has clear responsibilities and composition rules. The outcome is a component system where every piece is reusable, testable in isolation, and named in a shared vocabulary.
Start with the smallest reusable elements and compose upward. Never skip a level.
The four levels:
Atoms: Indivisible UI elements. A button, an input, a label, an icon. One visual element, one responsibility. Atoms reference design tokens for all visual properties (color, spacing, typography).
Molecules: Small groups of atoms functioning as a unit. A form field (label + input + error message). A search bar (input + button + icon). One interaction pattern per molecule.
Organisms: Complex components composed of molecules and atoms that form a distinct section of the interface. A navigation header, a complete form, a data table. One feature area per organism.
Templates: Page-level layouts that arrange organisms into a complete view. A dashboard template, a list-detail template. Templates define structure and content slots, not specific data.
Example:
Atom: Button, Input, Label, ErrorMessage
Molecule: FormField (Label + Input + ErrorMessage)
Organism: LoginForm (FormField + FormField + Button)
Template: AuthPage (Header + LoginForm + Footer)
Do:
Do not:
Components render UI. They receive data as props. They do not fetch data, manage business logic, or hold application state.
Example:
Presentational (good):
UserCard({ name, email, avatar }) -> renders UI
Container (separate):
UserCardContainer() -> fetches data, passes to UserCard
Do not:
Extract every design decision (colors, spacing, typography, shadows, radii) into named tokens. Components reference tokens, never raw values.
Example:
/* Tokens */
--color-primary: #0066cc;
--spacing-sm: 8px;
--spacing-md: 16px;
/* Component uses tokens, not values */
.button { background: var(--color-primary); padding: var(--spacing-sm); }
Do not:
#0066cc or 8px in any componentBuild complex components by nesting simpler ones. Do not extend base components through class inheritance or deep prop-forwarding chains.
Do:
IconButton = Icon + Button (composition)Card > CardHeader + CardBody (slots)Do not:
FancyButton extends Button (inheritance)Advisory in all modes. Component hierarchy and token discipline are self-enforced.
Hard constraints:
[RP]spacing-md not card-header-padding-top).After completing work guided by this skill, verify:
If any criterion is not met, revisit the relevant practice before proceeding.
This skill works standalone. For enhanced workflows, it integrates with:
Missing a dependency? Install with:
npx skills add jwilger/agent-skills --skill tdd
Weekly Installs
91
Repository
GitHub Stars
2
First Seen
Feb 12, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code82
cline74
antigravity67
continue67
codebuddy66
codex66