vue3-component-decomposition
Decompose large Vue 3 components into focused SFCs and composables with explicit contracts, simple templates, and SSR-safe side effects.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Decompose large Vue 3 components into focused SFCs and composables with explicit contracts, simple templates, and SSR-safe side effects.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
shadcn-vue for Vue/Nuxt with Reka UI components and Tailwind. Use for accessible UI, Auto Form, data tables, charts, dark mode, MCP server setup, or encountering component imports, Reka UI errors.
Enforces an opinionated UI baseline to prevent AI-generated interface slop.
Keep cyclomatic complexity low; flatten control flow, extract helpers, and prefer table-driven/strategy patterns over large switches
Use API Resources with pagination and conditional fields; keep response shapes stable and cache-friendly
Portable storage configuration across S3/R2/MinIO with optional CDN—env toggles, path-style endpoints, and URL generation
Replace hardcoded values with constants, enums, and configuration for maintainability; use PHP 8.1+ enums and config files
| name | vue3-component-decomposition |
| description | Decompose large Vue 3 components into focused SFCs and composables with explicit contracts, simple templates, and SSR-safe side effects. |
| source | https://vuejs.org/guide/reusability/composables.html |
Break large Vue 3 components into smaller, testable units without losing readability.
setup() or <script setup> grows hard to scanview (markup/presentational)state (refs/reactive/computed)effects (watch/watchEffect/lifecycle)io (API calls)props, emits, slots).:key with v-for and do not combine v-if with v-for on the same element.slots for variable UI regions over boolean prop explosion.use prefix (useOrdersTable, useUserFilters).toValue().toValue() in watchEffect() (or watch refs/getters directly).onMounted() and always clean up in onUnmounted().src/
components/
feature/
OrdersPage.vue # orchestrator
OrdersToolbar.vue # presentational controls
OrdersTable.vue # table rendering
OrdersTableRow.vue # row rendering
composables/
useOrdersQuery.ts # fetch/pagination/sort
useOrdersFilters.ts # filter state and derived query
useOrdersSelection.ts # row selection logic