스킬 frontend-components
📦

frontend-components

안전

使用最佳實踐構建可重用的前端組件

또한 다음에서 사용할 수 있습니다: DevanB

前端組件開發經常導致緊密耦合的代碼,難以維護和重用。此技能指導 Claude Code 創建模塊化、可組合的 UI 組件,遵循單一職責原則並具有適當的封裝。

지원: Claude Codex Code(CC)
📊 71 적절함
1

스킬 ZIP 다운로드

2

Claude에서 업로드

설정 → 기능 → 스킬 → 스킬 업로드로 이동

3

토글을 켜고 사용 시작

테스트해 보기

"frontend-components" 사용 중입니다. Create a reusable Card component in React with header, content, and footer sections

예상 결과:

創建的組件具有適當的 TypeScript 接口、header 和 footer 的可選 props、用於內容的 children prop,以及組件 API 的清晰文檔

"frontend-components" 사용 중입니다. Refactor this 300-line component into smaller focused components

예상 결과:

原始組件被拆分為 5 個較小的組件,每個組件都具有單一職責、清晰的 props 接口和改進的可測試性,同時保持相同的功能

"frontend-components" 사용 중입니다. Add state management to this form component following best practices

예상 결과:

表單組件更新為受控輸入、適當的狀態提升、將驗證邏輯分離到 hooks 中,以及用於父組件通信的清晰事件處理程序 props

보안 감사

안전
v6 • 1/21/2026

This skill is safe for publication. All 16 static findings were false positives from pattern matching on Markdown file extensions and documentation paths. The skill contains only documentation guidance for frontend component development with no executable code or security risks.

2
스캔된 파일
282
분석된 줄 수
0
발견 사항
6
총 감사 수
보안 문제를 찾지 못했습니다
감사자: claude 감사 이력 보기 →

품질 점수

38
아키텍처
100
유지보수성
87
콘텐츠
32
커뮤니티
100
보안
91
사양 준수

만들 수 있는 것

組件庫開發

構建一個設計系統,包含可重用的按鈕、卡片、模態框和表單組件,這些組件遵循一致的模式,並接受可配置的 props 以適應不同的使用場景。

重構舊版組件

將大型、單體的組件分解為更小、更專注的單元,這些單元更容易測試、維護,並可在應用程序的不同部分重用。

新功能開發

使用結構良好的組件創建新的 UI 功能,這些組件具有清晰的 props、最小的狀態和適當的封裝,並能無縫集成到現有架構中。

이 프롬프트를 사용해 보세요

創建基本組件
Create a reusable Button component in React with TypeScript that accepts variant, size, and disabled props
重構組件結構
Refactor this UserProfile component into smaller components following single responsibility principle
添加組件 Props
Add proper TypeScript interfaces for this Modal component with required title, optional footer, and children props
構建組合組件
Create a DataTable component that composes Header, Row, and Cell components with proper state management for sorting and filtering

모범 사례

  • 在實現之前使用 TypeScript 或 PropTypes 定義清晰的組件接口
  • 保持組件專注於單一職責,並將邏輯提取到自定義 hooks 中
  • 使用組合優於繼承,並將狀態提升到組件樹中的適當級別

피하기

  • 避免在不考慮 context 或狀態管理的情況下創建深層嵌套的 prop drilling 鏈
  • 不要在沒有清晰分離的情況下將業務邏輯與展示組件混合
  • 對於將被重用的組件,絕不要跳過 prop 驗證或 TypeScript 接口

자주 묻는 질문

此技能支持哪些前端框架?
此技能支持 React、Vue、Svelte 和標準 web components。它專注於適用於各種框架的通用組件設計原則。
此技能是否需要外部文檔才能工作?
此技能引用 agent-os/standards/frontend/components.md 的外部標準。雖然它提供了一般指導,但要完全發揮效果需要此文檔可用。
此技能能否幫助優化組件性能?
此技能專注於結構化最佳實踐,如適當的封裝和狀態管理。框架特定的優化(如 React.memo 或 Vue computed properties)應單獨處理。
此技能如何處理組件樣式?
此技能專注於組件結構和邏輯,而非樣式方法。它適用於任何樣式方法,如 CSS modules、styled-components 或 Tailwind。
我可以使用此技能重構現有組件嗎?
是的,此技能既適用於創建新組件,也適用於將現有組件重構為更小、更易維護的單元,遵循單一職責原則。
此技能是否支持 TypeScript?
是的,此技能完全支持 TypeScript,並鼓勵為組件 props 和接口提供適當的類型定義以確保類型安全。

개발자 세부 정보

파일 구조

📄 SKILL.md