/frontend:component-logicfrom frontend
把業務邏輯從前端元件抽成可復用單元的做法——單一職責、reactive 輸入、side effect 隔離、清楚介面型別。附 Vue 3 composable 寫法附錄。Use when extracting business logic over 50 lines or creating reusable component logic;觸發:「抽 composable」「抽 hook」「這段邏輯太長要拆」「可復用邏輯」「component logic」。
Ships in frontend. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
把業務邏輯從元件抽成介面乾淨、可獨立測試的單元(Vue 叫 composable、React 叫 hook、Svelte 叫 store/function)。
先看專案的 package.json dependencies(vue、react、svelte、@angular/core 等)與目錄結構,對照下表載入附錄,並在回報第一行寫「附錄:<檔名>」。
| 偵測到 | 附錄 |
|---|---|
dependencies 有 vue | ${CLAUDE_PLUGIN_ROOT}/references/stacks/vue.md |
react、svelte、@angular/core | 目前沒有附錄,走下方退路 |
沒有對應附錄:照本 skill 的通用方法,加上專案既有程式的寫法(先找 2–3 個同類檔當樣板;有裝 workspace 就照 workspace:convention-first(可選,沒裝就自己 grep 既有實作當樣板))。做完問使用者要不要把這次的寫法整理成新附錄 references/stacks/<stack>.md,回報寫「附錄:無(照既有程式)」。
動手前先確認要抽的邏輯是否已有現成單元:共享元件庫、utils 層、既有 composables/hooks 目錄常已提供確認對話框、breakpoint、主題之類的通用邏輯。先查再建,別重複造輪子。
好處:可脫離元件 context 獨立測試、跨 UI 情境復用、state 與行為分離。
兩者的 Vue 寫法見附錄。
50 行業務邏輯已抽出
frontend-architecture:分層與重構整體策略runtime-debug:抽出後在執行期驗證行為What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
4 skills in this plugin
/frontend-architecture前端架構決策——分層合規、元件選型、依賴方向檢查、大型元件重構、狀態管理與資料取得原則、效能策略。附 Vue 3 附錄。Use when making frontend architecture decisions, checking layer violations, or planning refactoring;觸發:「前端架構」「分層違規」「元件該放哪層」「重構這個大元件」「architecture review」「狀態放哪」。/i18n前端 i18n 違規偵測與翻譯 key 組織——系統性掃出硬寫字串、依 feature 而非元件組織 key、處理 template literal 的部分硬寫。附 Vue 3 附錄。Use when refactoring pages, creating new features, or fixing i18n violations;觸發:「i18n 違規」「這頁還有硬寫中文」「翻譯 key 怎麼組織」「補 i18n」「國際化」。/runtime-debug用瀏覽器 DevTools(chrome-devtools MCP)除錯執行中的前端——console error 分流、API request 檢查、前端 state 檢視、realtime 連線、視覺回歸、表單互動、router。附 Vue 3 附錄(Vue DevTools、Pinia、TanStack Query 檢視)。Use when debugging the running frontend via browser DevTools;觸發:「除錯執行中的前端」「頁面壞了幫我看」「看 console error」「檢查 API 請求」「inspect state」。npx claudepluginhub kerryhuang/plugharbor --plugin frontend