Compétences frontend-components
📦

frontend-components

Sûr

使用最佳实践构建可复用的React组件

Également disponible depuis: EIS-ITS

没有清晰的标准,创建可维护的前端组件可能具有挑战性。本技能指导Claude Code构建具有单一职责、清晰的属性接口和正确的组合模式的React组件。

Prend en charge: Claude Codex Code(CC)
📊 70 Adéquat
1

Télécharger le ZIP du skill

2

Importer dans Claude

Allez dans Paramètres → Capacités → Skills → Importer un skill

3

Activez et commencez à utiliser

Tester

Utilisation de "frontend-components". Create a simple Card component with a header, body, and footer section

Résultat attendu:

创建一个具有适当TypeScript接口(CardProps)的Card组件,将关注点分离到CardHeader、CardBody和CardFooter子组件中,实现允许灵活内容的组合模式,并为每个组件API包含JSDoc文档。

Utilisation de "frontend-components". Refactor this 300-line UserDashboard component following component best practices

Résultat attendu:

分析组件以识别不同的关注点,提取更小的专注组件如UserStats、ActivityFeed和QuickActions,将共享状态提升到父组件,为每个提取的组件创建清晰的属性接口,并在保持相同功能的同时提高可维护性。

Audit de sécurité

Sûr
v6 • 1/21/2026

This skill contains only documentation and guidance for React component development. All 21 static findings are false positives from pattern matching on metadata fields, markdown formatting, and file paths. No executable code, network operations, or security vulnerabilities detected.

2
Fichiers analysés
349
Lignes analysées
0
résultats
6
Total des audits
Aucun problème de sécurité trouvé

Score de qualité

38
Architecture
100
Maintenabilité
87
Contenu
21
Communauté
100
Sécurité
91
Conformité aux spécifications

Ce que vous pouvez construire

构建新的UI组件库

创建新设计系统的前端开发人员可以使用本技能确保所有组件在属性、状态管理和组合方面遵循一致的模式。

重构遗留组件

现代化代码库的团队可以利用本技能将大型组件分解为更小、职责更明确且可测试性更好的组件。

新团队成员入职

开发团队可以使用本技能向新开发人员教授组件架构标准,确保从第一天起整个团队的代码质量保持一致。

Essayez ces prompts

创建新组件
Create a Button component in resources/js/Components/ with variants for primary, secondary, and ghost styles. Include proper TypeScript props and follow component best practices.
重构大型组件
Refactor the UserProfileForm component to separate concerns. Extract form fields into smaller components and improve state management.
设计组件API
Design the prop interface for a DataTable component that needs to support sorting, filtering, pagination, and custom cell renderers. Show me the TypeScript types.
自定义shadcn组件
Customize the shadcn/ui Dialog component to add a confirm action footer with cancel and submit buttons. Maintain the existing composition pattern.

Bonnes pratiques

  • 始终为组件属性定义TypeScript接口,以确保类型安全并提供更好的开发体验
  • 保持组件专注于单一职责,当复杂性超过100行时提取子组件
  • 使用组合模式组合较小的组件,而不是构建具有许多条件分支的大型单体组件

Éviter

  • 避免创建具有超过5-7个属性的组件,因为这表明组件可能承担了太多职责
  • 不要在组件文件内混合业务逻辑和展示代码。将逻辑提取到自定义钩子或工具函数中
  • 当只需要特定字段时,切勿将整个状态对象作为属性传递。这会造成不必要的耦合和重新渲染

Foire aux questions

本技能强制执行什么样的组件文件结构?
本技能指导Claude Code将共享组件放在resources/js/Components/或类似目录中,对TypeScript React组件使用.tsx扩展名,并遵循组件名与文件名匹配的命名约定。
本技能是否适用于Vue或Angular组件?
不,本技能专门为React组件开发设计。它专注于React模式,如钩子、JSX组合和React特定的状态管理方法。
本技能如何帮助处理shadcn/ui组件?
本技能提供了在保持组合模式的同时自定义和扩展shadcn/ui组件的指导。它帮助您在不破坏其设计原则的基础上构建shadcn组件。
本技能会自动修复我代码中的组件问题吗?
本技能指导Claude Code如何正确编写组件。您需要请Claude Code创建或重构组件,它将遵循本技能中定义的标准。
本技能推荐哪些TypeScript模式?
本技能鼓励定义明确的属性接口,对变体属性使用区分联合类型,避免使用any类型,并利用TypeScript实用类型进行组件API设计。
我可以自定义本技能执行的组件标准吗?
本技能引用了一个外部标准文档。您可以通过更新项目中agent-os/standards/frontend/components.md的引用文档文件来修改组件标准。

Détails du développeur

Structure de fichiers

📄 SKILL.md