smithery/spjoshis

vue-composition-api

Master Vue 3 Composition API with setup, ref, reactive, computed, watch, and composables for building scalable reactive applications.

Installation

$ npx skills add smithery/spjoshis --skill vue-composition-api

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/spjoshis.

npx skills add smithery/spjoshis

Browse all from smithery/spjoshis

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,781 B
  • docs SUMMARY.md 160 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Vue Composition API

Master Vue 3's Composition API for building scalable, reusable, and type-safe reactive applications.

Core Concepts

Script Setup

<script setup lang="ts">
import { ref, computed } from 'vue'

const count = ref(0)
const doubled = computed(() => count.value * 2)

function increment() {
  count.value++
}
</script>

<template>
  <div>
    <p>{{ count }} x 2 = {{ doubled }}</p>
    <button @click="increment">Increment</button>
  </div>
</template>

Composables

// composables/useFetch.ts
export function useFetch<T>(url: string) {
  const data = ref<T | null>(null)
  const error = ref<Error | null>(null)
  const loading = ref(true)

  const fetchData = async () => {
    loading.value = true
    try {
      const response = await fetch(url)
      data.value = await response.json()
    } catch (e) {
      error.value = e as Error
    } finally {
      loading.value = false
    }
  }

  onMounted(fetchData)

  return { data, error, loading, refetch: fetchData }
}

Reactive State

import { reactive, toRefs } from 'vue'

const state = reactive({
  count: 0,
  message: 'Hello'
})

// Destructure while maintaining reactivity
const { count, message } = toRefs(state)

Best Practices

  1. Use ref for primitives, reactive for objects
  2. Extract reusable logic into composables
  3. Use TypeScript for type safety
  4. Implement proper cleanup in onUnmounted
  5. Use computed for derived state
  6. Leverage watchEffect for side effects

Resources