Community程式設計與開發github.com

langgenius/component-refactoring

重構 Dify 前端中高複雜度的 React 元件。當 `pnpm analyze-component --json` 顯示複雜度大於 50 或行數大於 300 時使用,或用戶要求進行程式碼拆分、鉤子提取或複雜度降低時,或 `pnpm analyze-component` 警告需在測試前重構時使用;避免用於簡單/結構良好的元件、第三方包裝器,或用戶明確要求測試但不重構時。

component-refactoring 是什麼?

此技能專注於重構 Dify 前端專案中高複雜度的 React 元件,幫助開發者降低程式碼複雜度、提升可維護性。它基於 `pnpm analyze-component --json` 的分析結果,當元件複雜度超過 50 或行數超過 300 時觸發,並支援常見的重構操作,如程式碼拆分、自訂鉤子提取及複雜度降低。該技能明確提供使用與避免情境,能有效引導 AI 代理在合適時機進行重構,避免干擾已結構良好的元件或用戶明確的測試需求。主要支援 Dify 前端專案,並以指令式分析工具為決策依據。

相容平台~Claude Code~Codex CLI~Cursor
Part ofReact
npx skills add https://github.com/langgenius/dify/tree/main/skills/component-refactoring

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

component-refactoring 是做什麼的?

重構 Dify 前端中高複雜度的 React 元件。當 pnpm analyze-component --json 顯示複雜度大於 50 或行數大於 300 時使用,或用戶要求進行程式碼拆分、鉤子提取或複雜度降低時,或 pnpm analyze-component 警告需在測試前重構時使用;避免用於簡單/結構良好的元件、第三方包裝器,或用戶明確要求測試但不重構時。

Individual skills in this repo

This repo contains 3 individual skills — each has its own dedicated page.

相關技能