frontend-components

majiayu000 的头像作者 majiayu000

设计具有单一职责、清晰的属性接口、最小化状态管理和适当封装的可复用UI组件。在创建或修改React组件、Vue组件、Svelte组件、Web组件或任何模块化UI构建块时使用此技能。在设计组件API、管理组件状态、将较小组件组合成较大UI、记录组件使用、实现组件生命周期方法或确保组件在不同上下文中可复用时使用此技能。在处理位于components/、src/components/或app/components/等组件目录中的.jsx、.tsx、.vue、.svelte文件时使用此技能。

📖 中文导读:设计具有单一职责、清晰的属性接口、最小化状态管理和适当封装的可复用UI组件。在创建或修改React组件、Vue组件、Svelte组件、Web组件或任何模块化UI构建块时使用此技能。在设计组件API、管理组件状态、将较小组件组合成较大UI、记录组件使用、实现组件生命周期方法或确保组件在不同上下文中可复用时使用此技能。在处理位于components/、src/components/或app/components/等组件目录中的.jsx、.tsx、.vue、.svelte文件时使用此技能。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: Frontend Components description: Design reusable, composable UI components with single responsibility, clear props interfaces, minimal state management, and proper encapsulation. Use this skill when creating or modifying React components, Vue components, Svelte components, web components, or any modular UI building blocks. Use this when designing component APIs with props and defaults, managing component state, composing smaller components into larger UIs, documenting component usage, implementing component lifecycle methods, or ensuring components are reusable across different contexts. Use this when working on .jsx, .tsx, .vue, .svelte files in component directories like components/, src/components/, or app/components/.

Frontend Components

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.

When to use this skill:

  • When creating or editing component files in directories like components/, src/components/, app/components/
  • When building React (.jsx, .tsx), Vue (.vue), Svelte (.svelte), or other framework components
  • When designing component props interfaces with clear types and sensible defaults
  • When managing component-level state and deciding when to lift state up
  • When composing smaller components together to build complex UIs
  • When implementing component lifecycle methods (useEffect, onMount, etc.)
  • When ensuring components have single responsibility and focused purpose
  • When creating reusable components that work across different contexts
  • When documenting component usage, props, and providing code examples
  • When encapsulating component implementation details and exposing clean APIs
  • When refactoring large components into smaller, more manageable pieces

Instructions

For details, refer to the information provided in this file: frontend components