跳到正文
cccskills
免费在 GitHub 公开

vue-expert-js

Build Vue 3 applications using JavaScript and JSDoc comments that describe data types. Create components and reusable logic, configure Vite, routing, and state management, and check annotations and behavior with ESLint and Vitest.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Creates Vue 3 components, builds vanilla JS composables, configures Vite projects, and sets up routing and state management using JavaScript only — no TypeScript. Generates JSDoc-typed code with @typedef, @param, and @returns annotations for full type coverage without a TS compiler. Use when building Vue 3 applications with JavaScript only (no TypeScript), when projects require JSDoc-based type hints, when migrating from Vue 2 Options API to Composition API in JS, or when teams prefer vanilla JavaScript, .mjs modules, or need quick prototypes without TypeScript setup.

查看安装方法

适用场景

  • Build Vue 3 interfaces using JavaScript
  • Add JSDoc type hints to components and shared logic
  • Migrate Vue 2 Options API code to Composition API
  • Configure Vite, routing, and state management
  • Prototype without setting up TypeScript

包含的文件(6)

  • SKILL.md6.1 KB
  • references/component-architecture.md4.6 KB
  • references/composables-patterns.md4.2 KB
  • references/jsdoc-typing.md10.8 KB
  • references/state-management.md5.4 KB
  • references/testing-patterns.md5.6 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Vue Expert (JavaScript)

Senior Vue specialist building Vue 3 applications with JavaScript and JSDoc typing instead of TypeScript.

Core Workflow

  1. Design architecture — Plan component structure and composables with JSDoc type annotations
  2. Implement — Build with <script setup> (no lang="ts"), .mjs modules where needed
  3. Annotate — Add comprehensive JSDoc comments (@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 proceeding
  4. Test — Verify with Vitest using JavaScript files; confirm JSDoc coverage on all public APIs; if tests fail, revisit the relevant composable or component, correct the logic or annotation, and re-run until the suite is green

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
JSDoc Typingreferences/jsdoc-typing.mdJSDoc types, @typedef, @param, type hints
Composablesreferences/composables-patterns.mdcustom composables, ref, reactive, lifecycle hooks
Componentsreferences/component-architecture.mdprops, emits, slots, provide/inject
Statereferences/state-management.mdPinia, stores, reactive state
Testingreferences/testing-patterns.mdVitest, component testing, mocking

For shared Vue concepts, defer to vue-expert:

  • ../vue-expert/references/composition-api.md - Core reactivity patterns
  • ../vue-expert/references/components.md - Props, emits, slots
  • ../vue-expert/references/state-management.md - Pinia stores

Code Patterns

Component with JSDoc-typed props and emits

<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>

Composable with @typedef, @param, and @returns

// 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 }
}

@typedef for a complex object used across files

// 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} */

Constraints

MUST DO

  • Use Composition API with <script setup>
  • Use JSDoc comments for type documentation
  • Use .mjs extension for ES modules when needed
  • Annotate every public function with @param and @returns
  • Use @typedef for complex object shapes shared across files
  • Use @type annotations for reactive variables
  • Follow vue-expert patterns adapted for JavaScript

MUST NOT DO

  • Use TypeScript syntax (no <script setup lang="ts">)
  • Use .ts file extensions
  • Skip JSDoc types for public APIs
  • Use CommonJS require() in Vue files
  • Ignore type safety entirely
  • Mix TypeScript files with JavaScript in the same component

Output Templates

When implementing Vue features in JavaScript:

  1. Component file with <script setup> (no lang attribute) and JSDoc-typed props/emits
  2. @typedef definitions for complex prop or state shapes
  3. Composable with @param and @returns annotations
  4. Brief note on type coverage

Knowledge Reference

Vue 3 Composition API, JSDoc, ESM modules, Pinia, Vue Router 4, Vite, VueUse, Vitest, Vue Test Utils, JavaScript ES2022+

Maintained by @jeffallan, Principal Consultant at Synergetic Solutions

Documentation

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Build Angular 17+ applications with standalone components, routing, and shared application state. Covers reactive data handling with RxJS, performance improvements, and unit and integration tests, with code and explanations of architecture choices.

中文简介正在准备中。当前显示英语简介。

  • Building Angular screens with standalone components
  • Managing shared application state with NgRx
  • Configuring lazy-loaded routes and access guards
Jeffallan/claude-skills1.2万2026年10月17日 更新

Design REST or GraphQL APIs by defining data relationships, requests, responses, and authentication. Produce OpenAPI specifications, machine-readable API descriptions, with consistent errors, pagination, and versioning plans, then validate contracts using a mock server.

中文简介正在准备中。当前显示英语简介。

  • Designing a new API from business requirements
  • Creating and validating OpenAPI specifications
  • Standardizing errors and paginated responses
Jeffallan/claude-skills1.2万2026年10月17日 更新

Design or review a system’s overall structure, compare technology choices, and plan for growth and failures. Produce architecture diagrams and Architecture Decision Records, documents that explain key choices, alternatives, and their consequences.

中文简介正在准备中。当前显示英语简介。

  • Designing the overall structure of a new system
  • Comparing monolith and microservices architectures
  • Recording technology decisions and alternatives
Jeffallan/claude-skills1.2万2026年10月17日 更新

Connect AI agents to Jira and Confluence through MCP, a protocol for accessing external tools. This skill guides issue searches and updates, page management, sprint workflows, authentication setup, and troubleshooting of Atlassian integrations.

中文简介正在准备中。当前显示英语简介。

  • Find Jira issues by assignee or status
  • Search and update Confluence pages
  • Turn meeting notes into Jira ticket updates
Jeffallan/claude-skills1.2万2026年10月17日 更新

Design controlled failure experiments for distributed systems to examine how services recover. Produce failure injection scripts, monitoring plans, rollback procedures, and exercise guides, then turn findings into documented improvements.

中文简介正在准备中。当前显示英语简介。

  • Planning controlled failure experiments
  • Testing recovery after Kubernetes Pod failures
  • Checking service behavior under network delays
Jeffallan/claude-skills1.2万2026年10月17日 更新

Design and implement command-line tools with subcommands, options, interactive prompts, and progress indicators. Get command structures, configuration handling, clear error messages, and shell completion scripts, with guidance for automated use and testing across operating systems.

中文简介正在准备中。当前显示英语简介。

  • Build a command-line tool with subcommands and options
  • Add interactive prompts and progress indicators
  • Provide bash, zsh, and fish command completion
Jeffallan/claude-skills1.2万2026年10月17日 更新

查看 Jeffallan 的全部技能

报告此技能的问题