vue-expert-js by jeffallan/claude-skills
npx skills add https://github.com/jeffallan/claude-skills --skill vue-expert-js资深 Vue 专家,使用 JavaScript 和 JSDoc 类型注解(而非 TypeScript)构建 Vue 3 应用程序。
<script setup>(无 lang="ts")构建,必要时使用 .mjs 模块@typedef、@param、@returns、@type)以实现完整的类型覆盖;然后运行带有 JSDoc 插件(eslint-plugin-jsdoc)的 ESLint 来验证覆盖率 — 在继续之前修复所有缺失或格式错误的注解广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
根据上下文加载详细指导:
| 主题 | 参考 | 加载时机 |
|---|---|---|
| JSDoc 类型注解 | references/jsdoc-typing.md | JSDoc 类型、@typedef、@param、类型提示 |
| 组合式函数 | references/composables-patterns.md | 自定义组合式函数、ref、reactive、生命周期钩子 |
| 组件 | references/component-architecture.md | props、emits、slots、provide/inject |
| 状态管理 | references/state-management.md | Pinia、存储、响应式状态 |
| 测试 | references/testing-patterns.md | Vitest、组件测试、模拟 |
对于共享的 Vue 概念,请参考 vue-expert:
vue-expert/references/composition-api.md - 核心响应式模式vue-expert/references/components.md - Props、emits、slotsvue-expert/references/state-management.md - Pinia 存储<script setup>
/**
* @typedef {Object} UserCardProps
* @property {string} name - 用户的显示名称
* @property {number} age - 用户的年龄
* @property {boolean} [isAdmin=false] - 用户是否拥有管理员权限
*/
/** @type {UserCardProps} */
const props = defineProps({
name: { type: String, required: true },
age: { type: Number, required: true },
isAdmin: { type: Boolean, default: false },
})
/**
* @typedef {Object} UserCardEmits
* @property {(id: string) => void} select - 当卡片被选中时触发
*/
const emit = defineEmits(['select'])
/** @param {string} id */
function handleSelect(id) {
emit('select', id)
}
</script>
<template>
<div @click="handleSelect(props.name)">
{{ props.name }} ({{ props.age }})
</div>
</template>
// composables/useCounter.mjs
import { ref, computed } from 'vue'
/**
* @typedef {Object} CounterState
* @property {import('vue').Ref<number>} count - 响应式计数值
* @property {import('vue').ComputedRef<boolean>} isPositive - 当 count > 0 时为 true
* @property {() => void} increment - 按步长增加计数
* @property {() => void} reset - 将计数重置为初始值
*/
/**
* 用于具有可配置步长的简单计数器的组合式函数。
* @param {number} [initial=0] - 起始值
* @param {number} [step=1] - 每次调用时的增量
* @returns {CounterState}
*/
export function useCounter(initial = 0, step = 1) {
/** @type {import('vue').Ref<number>} */
const count = ref(initial)
const isPositive = computed(() => count.value > 0)
function increment() {
count.value += step
}
function reset() {
count.value = initial
}
return { count, isPositive, increment, reset }
}
// types/user.mjs
/**
* @typedef {Object} User
* @property {string} id - UUID
* @property {string} name - 完整显示名称
* @property {string} email - 联系邮箱
* @property {'admin'|'viewer'} role - 访问级别
*/
// 在其他文件中导入方式:
// /** @type {import('./types/user.mjs').User} */
<script setup> 的组合式 API.mjs 扩展名表示 ES 模块@param 和 @returns 注解@typedef@type 注解<script setup lang="ts">).ts 文件扩展名require()当使用 JavaScript 实现 Vue 功能时:
<script setup>(无 lang 属性)和 JSDoc 类型注解的 props/emits 的组件文件@typedef 定义@param 和 @returns 注解的组合式函数Vue 3 组合式 API、JSDoc、ESM 模块、Pinia、Vue Router 4、Vite、VueUse、Vitest、Vue Test Utils、JavaScript ES2022+
每周安装量
763
代码仓库
GitHub 星标数
7.2K
首次出现时间
2026年1月20日
安全审计
安装于
opencode636
gemini-cli617
codex604
claude-code596
github-copilot570
cursor561
Senior Vue specialist building Vue 3 applications with JavaScript and JSDoc typing instead of TypeScript.
<script setup> (no lang="ts"), .mjs modules where needed@typedef, @param, @returns, @type) for full type coverage; then run ESLint with the JSDoc plugin (eslint-plugin-jsdoc) to verify coverage — fix any missing or malformed annotations before proceedingLoad detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| JSDoc Typing | references/jsdoc-typing.md | JSDoc types, @typedef, @param, type hints |
| Composables | references/composables-patterns.md | custom composables, ref, reactive, lifecycle hooks |
| Components | references/component-architecture.md | props, emits, slots, provide/inject |
| State | references/state-management.md | Pinia, stores, reactive state |
| Testing | references/testing-patterns.md |
For shared Vue concepts, defer to vue-expert:
vue-expert/references/composition-api.md - Core reactivity patternsvue-expert/references/components.md - Props, emits, slotsvue-expert/references/state-management.md - Pinia stores<script setup>
/**
* @typedef {Object} UserCardProps
* @property {string} name - Display name of the user
* @property {number} age - User's age
* @property {boolean} [isAdmin=false] - Whether the user has admin rights
*/
/** @type {UserCardProps} */
const props = defineProps({
name: { type: String, required: true },
age: { type: Number, required: true },
isAdmin: { type: Boolean, default: false },
})
/**
* @typedef {Object} UserCardEmits
* @property {(id: string) => void} select - Emitted when the card is selected
*/
const emit = defineEmits(['select'])
/** @param {string} id */
function handleSelect(id) {
emit('select', id)
}
</script>
<template>
<div @click="handleSelect(props.name)">
{{ props.name }} ({{ props.age }})
</div>
</template>
// composables/useCounter.mjs
import { ref, computed } from 'vue'
/**
* @typedef {Object} CounterState
* @property {import('vue').Ref<number>} count - Reactive count value
* @property {import('vue').ComputedRef<boolean>} isPositive - True when count > 0
* @property {() => void} increment - Increases count by step
* @property {() => void} reset - Resets count to initial value
*/
/**
* Composable for a simple counter with configurable step.
* @param {number} [initial=0] - Starting value
* @param {number} [step=1] - Amount to increment per call
* @returns {CounterState}
*/
export function useCounter(initial = 0, step = 1) {
/** @type {import('vue').Ref<number>} */
const count = ref(initial)
const isPositive = computed(() => count.value > 0)
function increment() {
count.value += step
}
function reset() {
count.value = initial
}
return { count, isPositive, increment, reset }
}
// types/user.mjs
/**
* @typedef {Object} User
* @property {string} id - UUID
* @property {string} name - Full display name
* @property {string} email - Contact email
* @property {'admin'|'viewer'} role - Access level
*/
// Import in other files with:
// /** @type {import('./types/user.mjs').User} */
<script setup>.mjs extension for ES modules when needed@param and @returns@typedef for complex object shapes shared across files@type annotations for reactive variables<script setup lang="ts">).ts file extensionsrequire() in Vue filesWhen implementing Vue features in JavaScript:
<script setup> (no lang attribute) and JSDoc-typed props/emits@typedef definitions for complex prop or state shapes@param and @returns annotationsVue 3 Composition API, JSDoc, ESM modules, Pinia, Vue Router 4, Vite, VueUse, Vitest, Vue Test Utils, JavaScript ES2022+
Weekly Installs
763
Repository
GitHub Stars
7.2K
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode636
gemini-cli617
codex604
claude-code596
github-copilot570
cursor561
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
103,800 周安装
| Vitest, component testing, mocking |