vue-expert
它能做什么
它指导 AI 构建 Vue 3 组件、状态存储和 Nuxt 项目。适用于使用 Vue 的网页开发者。
适用场景
- ✓当你用组合式 API 构建 Vue 3 界面时。
- ✓当你要用服务器渲染或静态生成设置 Nuxt 3 网站时。
- ✓当你想用 Quasar 或 Capacitor 把 Vue 应用打包成移动应用时。
技能链接
https://github.com/Jeffallan/claude-skills/blob/main/skills/vue-expert/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我用可复用的组合式函数和 Pinia 存储构建一个 Vue 3 仪表盘。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会规划组件结构,使用 Vue 的响应式工具编写代码,运行类型检查,然后运行组件测试。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Vue Expert
Senior Vue specialist with deep expertise in Vue 3 Composition API, reactivity system, and modern Vue ecosystem.
Core Workflow
- Analyze requirements - Identify component hierarchy, state needs, routing
- Design architecture - Plan composables, stores, component structure
- Implement - Build components with Composition API and proper reactivity
- Validate - Run
vue-tsc --noEmitfor type errors; verify reactivity with Vue DevTools. If type errors are found: fix each issue and re-runvue-tsc --noEmituntil the output is clean before proceeding - Optimize - Minimize re-renders, optimize computed properties, lazy load
- Test - Write component tests with Vue Test Utils and Vitest. If tests fail: inspect failure output, identify whether the root cause is a component bug or an incorrect test assertion, fix accordingly, and re-run until all tests pass
Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Composition API | references/composition-api.md |
ref, reactive, computed, watch, lifecycle |
| Components | references/components.md |
Props, emits, slots, provide/inject |
| State Management | references/state-management.md |
Pinia stores, actions, getters |
| Nuxt 3 | references/nuxt.md |
SSR, file-based routing, useFetch, Fastify, hydration |
| TypeScript | references/typescript.md |
Typing props, generic components, type safety |
| Mobile & Hybrid | references/mobile-hybrid.md |
Quasar, Capacitor, PWA, service worker, mobile |
| Build Tooling | references/build-tooling.md |
Vite config, sourcemaps, optimization, bundling |
Quick Example
Minimal component demonstrating preferred patterns:
<script setup lang="ts">
import { ref, computed } from 'vue'
const props = defineProps<{ initialCount?: number }>()
const count = ref(props.initialCount ?? 0)
const doubled = computed(() => count.value * 2)
function increment() {
count.value++
}
</script>
<template>
<button @click="increment">Count: {{ count }} (doubled: {{ doubled }})</button>
</template>
Constraints
MUST DO
- Use Composition API (NOT Options API)
- Use
<script setup>syntax for components - Use type-safe props with TypeScript
- Use
ref()for primitives,reactive()for objects - Use
computed()for derived state - Use proper lifecycle hooks (onMounted, onUnmounted, etc.)
- Implement proper cleanup in composables
- Use Pinia for global state management
MUST NOT DO
- Use Options API (data, methods, computed as object)
- Mix Composition API with Options API
- Mutate props directly
- Create reactive objects unnecessarily
- Use watch when computed is sufficient
- Forget to cleanup watchers and effects
- Access DOM before onMounted
- Use Vuex (deprecated in favor of Pinia)
Output Templates
When implementing Vue features, provide:
- Component file with
<script setup>and TypeScript - Composable if reusable logic exists
- Pinia store if global state needed
- Brief explanation of reactivity decisions
Knowledge Reference
Vue 3 Composition API, Pinia, Nuxt 3, Vue Router 4, Vite, VueUse, TypeScript, Vitest, Vue Test Utils, SSR/SSG, reactive programming, performance optimization
Maintained by @jeffallan, Principal Consultant at Synergetic Solutions
常见问题
它运行哪些类型检查?
它运行 vue-tsc 来查找类型错误,因此适合使用该工具的 Vue 项目。
它能帮忙处理 Nuxt 吗?
能。它涵盖用于服务端渲染、静态网站和基于文件路由的 Nuxt 3。
它涵盖离线应用吗?
涵盖。它涵盖 Service Worker 等 PWA 功能。
详情
作者的原始描述
Builds Vue 3 components with Composition API patterns, configures Nuxt 3 SSR/SSG projects, sets up Pinia stores, scaffolds Quasar/Capacitor mobile apps, implements PWA features, and optimises Vite builds. Use when creating Vue 3 applications with Composition API, writing reusable composables, managing state with Pinia, building hybrid mobile apps with Quasar or Capacitor, configuring service workers, or tuning Vite configuration and TypeScript integration.
repo: Jeffallan/claude-skills
热度
- GitHub 星标
- 12k
- 排名
- #11468
- 许可证
- MIT
- 更新时间
- 2026/10/30
评论
- …
同一仓库的更多技能
angular-architect
12k帮你的智能体构建 Angular 17 及更新版本的应用,包括独立组件、懒加载路由、NgRx 状态管理、RxJS 模式和性能优化。
api-designer
12k帮你的智能体设计 REST 或 GraphQL API,并编写 OpenAPI 3.1 规范,包括资源、分页、错误格式和版本控制规则。
architecture-designer
12k帮你的智能体设计系统架构、比较模式和技术,并编写架构决策记录,解释每个选择的理由。
atlassian-mcp
12k帮你的智能体通过 MCP 搜索和更新 Jira 问题及 Confluence 页面,包括 JQL 和 CQL 查询、冲刺和文档同步。