Langsung ke konten
Skillpedia
Website & UI (frontend)12k Β· #11467

vue-expert-js

Fungsinya

Skill ini memandu AI untuk membangun komponen Vue 3, composable, dan proyek Vite tanpa TypeScript. Skill ini untuk pengembang JavaScript yang ingin memakai Vue.

Kapan dipakai

  • βœ“Saat Anda membangun aplikasi Vue 3 dan tidak ingin memakai TypeScript.
  • βœ“Saat Anda memerlukan composable dan komponen yang dapat digunakan ulang dengan JavaScript biasa.
  • βœ“Saat Anda menginginkan petunjuk tipe JSDoc dan tes untuk proyek Vue.

Link skill

https://github.com/Jeffallan/claude-skills/blob/main/skills/vue-expert-js/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/Jeffallan/claude-skills/blob/main/skills/vue-expert-js/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda membantu saya membangun komponen Vue 3 dengan JavaScript biasa dan komentar tipe yang jelas?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

AI merancang komponen, menulisnya dengan anotasi JSDoc, memeriksa anotasi dengan linter, lalu menjalankan tes Vitest.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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:

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 Vitest, 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
  • Igno
Pertanyaan umum

Apakah skill ini memakai TypeScript sama sekali?

Tidak. Skill ini memakai JavaScript biasa dan komentar JSDoc sebagai gantinya.

Alat tes apa yang dipakai?

Skill ini memakai Vitest untuk tes, termasuk tes komponen dengan Vue Test Utils.

Apa yang diperiksa linter-nya?

Skill ini menjalankan ESLint dengan plugin JSDoc untuk menemukan komentar tipe yang hilang atau salah format.

Detail

Deskripsi asli dari pembuat

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.

repo: Jeffallan/claude-skills

Popularitas

Bintang GitHub
12k
Peringkat
#11467
Lisensi
MIT
Diperbarui
30/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa