frontend-components

DevanB 的头像作者 DevanB

构建具有单一职责、清晰的属性接口、适当的状态管理和最小耦合的可重用、可组合的UI组件。当创建或编辑React组件(.tsx、.jsx文件)、设计带有属性的组件API、实现组件组成模式、管理本地组件状态、构建shadcn/ui组件、在resources/js/Components/中创建共享UI组件、实现组件文档或将大型组件重构为更小、更专注的组件时使用此技能。

📖 中文导读:构建具有单一职责、清晰的属性接口、适当的状态管理和最小耦合的可重用、可组合的UI组件。当创建或编辑React组件(.tsx、.jsx文件)、设计带有属性的组件API、实现组件组成模式、管理本地组件状态、构建shadcn/ui组件、在resources/js/Components/中创建共享UI组件、实现组件文档或将大型组件重构为更小、更专注的组件时使用此技能。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: Frontend Components description: Build reusable, composable UI components with single responsibilities, clear prop interfaces, proper state management, and minimal coupling. Use this skill when creating or editing React components (.tsx, .jsx files), when designing component APIs with props, when implementing component composition patterns, when managing local component state, when building shadcn/ui components, when creating shared UI components in resources/js/Components/, when implementing component documentation, or when refactoring large components into smaller, focused pieces.

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 new React components in .tsx or .jsx files
  • When editing existing components in resources/js/Components/ or similar directories
  • When designing component prop interfaces and TypeScript types
  • When implementing component composition by combining smaller components
  • When managing component state (useState, useReducer, etc.)
  • When building or customizing shadcn/ui components
  • When creating reusable UI components (buttons, cards, modals, forms, etc.)
  • When refactoring monolithic components into smaller, focused pieces
  • When implementing component documentation or usage examples
  • When deciding between local state and lifting state up to parent components
  • When defining component naming conventions
  • When encapsulating component internal logic and exposing minimal APIs

Instructions

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