AgentSkillsCN

atomic-design-planning

在讨论UI组件、设计系统、前端实现或组件架构时使用此技能。引导思考原子设计方法论——原子、分子、有机体——并促进组件复用而非新建。触发条件为UI/前端讨论、“我们需要哪些组件?”、“我应该创建新组件吗?”或设计系统相关问题。

SKILL.md
--- frontmatter
name: atomic-design-planning
description: Use this skill when discussing UI components, design systems, frontend implementation, or component architecture. Guides thinking about Atomic Design methodology - atoms, molecules, organisms - and promotes component reuse over creation. Triggers on UI/frontend discussions, "what components do we need?", "should I create a new component?", or design system questions.

Atomic Design Planning Skill

This skill guides UI component architecture using Atomic Design methodology, emphasizing reuse of existing components and proper categorization of new ones.

When to Use

Apply this skill when:

  • Planning UI features or components
  • Deciding whether to create new components
  • Discussing frontend architecture
  • Users ask "what components do we need?"
  • Reviewing UI implementation plans
  • Discussing design system structure

Atomic Design Hierarchy

code
┌─────────────────────────────────────────────────────────┐
│  PAGES         - Complete screens with real content     │
├─────────────────────────────────────────────────────────┤
│  TEMPLATES     - Page-level layout structures           │
├─────────────────────────────────────────────────────────┤
│  ORGANISMS     - Complex UI sections (Header, LoginForm)│
├─────────────────────────────────────────────────────────┤
│  MOLECULES     - Simple groups (SearchInput, NavItem)   │
├─────────────────────────────────────────────────────────┤
│  ATOMS         - Basic blocks (Button, Input, Icon)     │
└─────────────────────────────────────────────────────────┘

Component Categories

Atoms

Smallest, indivisible UI elements: Buttons, Inputs, Labels, Icons, Typography.

  • No dependencies on other components
  • Highly reusable, controlled by props only

Molecules

Simple combinations of 2-4 atoms: SearchInput, FormField, NavItem.

  • Single responsibility, reusable in multiple organisms

Organisms

Complex, distinct UI sections: Header, ProductCard, LoginForm, DataTable.

  • May connect to data/state, often feature-specific

Templates

Page-level structural layouts: DashboardLayout, AuthLayout.

  • Define content placement, handle responsive behavior

Pages

Specific instances with real content: HomePage, ProductDetailPage.

  • Templates filled with data, route-specific

The Reuse-First Principle

Before creating ANY component:

  1. Search existing atoms - Is there a Button/Input that works?
  2. Search existing molecules - Can a FormField be adapted?
  3. Search existing organisms - Does a similar Card exist?
  4. Only then create new - Is this truly unique?

Decision Table

QuestionIf YesIf No
Does something similar exist?Reuse/extend itContinue evaluation
Will this be used in 2+ places?Consider extractingInline it instead
Is it truly indivisible?Make it an atomMake it a molecule+
Does it combine 2-4 atoms?Make it a moleculeMake it an organism
Is it a complete UI section?Make it an organismReconsider structure

Anti-Patterns to Avoid

  • Creating when reusing works - Configure existing Button with props instead
  • Feature-specific atoms - "UserProfileButton" should be an organism
  • Skipping levels - Pages shouldn't directly use atoms
  • Wrong abstraction level - Atoms shouldn't have business logic

Integration with Linear Workflow

When planning UI features, create issues for:

  1. Atom issues - New basic components needed
  2. Molecule issues - New component combinations
  3. Organism issues - New feature-level components

Investigation phase should identify existing components to reuse.

Remember: Reuse existing components. Only create what's truly missing.