frontend-components

设计和构建可重用、可组合的UI组件,遵循单一职责原则,具有清晰的接口和适当的状态管理。在使用此技能时包括创建React组件、Vue组件或其他框架组件,定义组件属性和接口,管理组件状态,构建可重用的UI元素,使用组件文件(*.tsx, *.jsx, *.vue, *.svelte, components/*, ui/*),实现组件组合模式,封装组件逻辑,记录组件API,根据需要保持本地状态或提升状态,设计组件层次结构,或将单体组件重构为更小的组件。在构建新组件、重构现有组件结构、审查组件设计模式或确保组件可维护和可重用时应用此技能。

📖 中文导读:设计和构建可重用、可组合的UI组件,遵循单一职责原则,具有清晰的接口和适当的状态管理。在使用此技能时包括创建React组件、Vue组件或其他框架组件,定义组件属性和接口,管理组件状态,构建可重用的UI元素,使用组件文件(*.tsx, *.jsx, *.vue, *.svelte, components/*, ui/*),实现组件组合模式,封装组件逻辑,记录组件API,根据需要保持本地状态或提升状态,设计组件层次结构,或将单体组件重构为更小的组件。在构建新组件、重构现有组件结构、审查组件设计模式或确保组件可维护和可重用时应用此技能。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: Frontend Components description: Design and build reusable, composable UI components following single responsibility principle with clear interfaces and proper state management. Use this skill when creating React components, Vue components, or other framework components, defining component props and interfaces, managing component state, building reusable UI elements, working with component files (*.tsx, *.jsx, .vue, .svelte, components/, ui/), implementing component composition patterns, encapsulating component logic, documenting component APIs, keeping state local or lifting it up when needed, designing component hierarchies, or refactoring monolithic components into smaller pieces. Apply this skill when building new components, refactoring existing component structures, reviewing component design patterns, or ensuring components are maintainable and reusable.

Frontend Components

When to use this skill

  • When creating or modifying component files (e.g., *.tsx, *.jsx, *.vue, *.svelte, components/*, ui/*)
  • When designing new UI components or refactoring existing ones
  • When defining component props, interfaces, or type definitions
  • When managing component state (useState, useReducer, reactive state, etc.)
  • When implementing component composition (combining smaller components into larger ones)
  • When building reusable UI elements that can be used across different contexts
  • When encapsulating component logic and keeping implementation details private
  • When documenting component usage, props, and providing examples
  • When deciding whether to keep state local or lift it up to parent components
  • When splitting large, complex components into smaller, focused ones
  • When naming components with clear, descriptive names
  • When reviewing component architecture for maintainability and reusability

This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle frontend components.

Instructions

For details, refer to the information provided in these files:

Component Architecture

frontend components

Aesthetic Excellence (for visual components)

frontend aesthetics - Apply when building UI components to ensure distinctive design choices in typography, colors, animations, and backgrounds.