Community程式設計與開發github.com

antfu/vue-best-practices

在 Vue.js 任務中必須使用。強烈建議採用組合式 API(Composition API)搭配 `<script setup>` 與 TypeScript 作為標準作法。涵蓋 Vue 3、SSR、Volar、vue-tsc。在處理任何 Vue、.vue 檔案、Vue Router、Pinia 或搭配 Vue 的 Vite 工作時載入此技能。除非專案明確要求選項式 API,否則一律使用組合式 API。

vue-best-practices 是什麼?

此技能為 Vue.js 開發任務提供了一套嚴格的標準與最佳實踐。它強制要求以組合式 API(Composition API)搭配 `<script setup>` 語法糖及 TypeScript 作為專案的預設開發模式,除非專案已有明確的選項式 API(Options API)要求。該技能涵蓋了 Vue 3 生態系統中的關鍵工具與函式庫,包括服務端渲染(SSR)、Volar 語言支援工具以及 vue-tsc 型別檢查,並建議在 Vue Router、Pinia 狀態管理,或基於 Vite 的 Vue 專案中啟用。透過此技能,AI 代理能夠自動生成符合業界最新標準的 Vue 程式碼,確保程式碼風格一致性,並減少因 API 選擇混亂導致的技術債,從而提升開發效率與專案可維護性。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/antfu/skills/tree/main/skills/vue-best-practices

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

在你喜歡的 AI 中提問

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

說明文件

vue-best-practices 是做什麼的?

在 Vue.js 任務中必須使用。強烈建議採用組合式 API(Composition API)搭配 <script setup> 與 TypeScript 作為標準作法。涵蓋 Vue 3、SSR、Volar、vue-tsc。在處理任何 Vue、.vue 檔案、Vue Router、Pinia 或搭配 Vue 的 Vite 工作時載入此技能。除非專案明確要求選項式 API,否則一律使用組合式 API。

Individual skills in this repo

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

antfu/antfu

Anthony Fu's opinionated tooling and conventions for JavaScript/TypeScript projects. Use when setting up new projects, configuring ESLint/Prettier alternatives, monorepos, library publishing, or when the user mentions Anthony Fu's preferences.

antfu/nuxt

Nuxt full-stack Vue framework with SSR, auto-imports, and file-based routing. Use when working with Nuxt apps, server routes, useFetch, middleware, or hybrid rendering.

antfu/pinia

Pinia official Vue state management library, type-safe and extensible. Use when defining stores, working with state/getters/actions, or implementing store patterns in Vue apps.

antfu/pnpm

Node.js package manager with strict dependency resolution. Use when running pnpm specific commands, configuring workspaces, or managing dependencies with catalogs, patches, or overrides.

antfu/slidev

Create and present web-based slidedecks for developers using Slidev with Markdown, Vue components, code highlighting, animations, and interactive features. Use when building technical presentations, conference talks, code walkthroughs, teaching materials, or developer decks.

antfu/tsdown

Bundle TypeScript and JavaScript libraries with blazing-fast speed powered by Rolldown. Use when building libraries, generating type declarations, bundling for multiple formats, or migrating from tsup.

antfu/turborepo

Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries. Use when user: configures tasks/workflows/pipelines, creates packages, sets up monorepo, shares code between apps, runs changed/affected packages, debugs cache, or has apps/packages directories.

antfu/unocss

UnoCSS instant atomic CSS engine, superset of Tailwind CSS. Use when configuring UnoCSS, writing utility rules, shortcuts, or working with presets like Wind, Icons, Attributify.

antfu/vite

Vite build tool configuration, plugin API, SSR, and Vite 8 Rolldown migration. Use when working with Vite projects, vite.config.ts, Vite plugins, or building libraries/SSR apps with Vite.

antfu/vitepress

VitePress static site generator powered by Vite and Vue. Use when building documentation sites, configuring themes, or writing Markdown with Vue components.

antfu/vitest

Vitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.

antfu/vue

Vue 3 Composition API, script setup macros, reactivity system, and built-in components. Use when writing Vue SFCs, defineProps/defineEmits/defineModel, watchers, or using Transition/Teleport/Suspense/KeepAlive.

antfu/vue-router-best-practices

Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.

antfu/vue-testing-best-practices

Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.

antfu/vueuse-functions

Apply VueUse composables where appropriate to build concise, maintainable Vue.js / Nuxt features.

antfu/web-design-guidelines

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

相關技能