vue

Refactor Vue 3 Single-File Components to Composition API with TypeScript.

4|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/rbaumier/skills --skill vue-rbaumier
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue
Source: https://github.com/rbaumier/skills/tree/main/vue
Command: npx skills add https://github.com/rbaumier/skills --skill vue-rbaumier

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provide a consistent, opinionated set of rules and playbooks to refactor, review, and author Vue 3 Single-File Components so they are type-safe, reactive-correct, and architected for maintainability and performance.

Core Features & Use Cases

  • Enforces Composition API SFCs with <script setup lang="ts">, typed props/emits/models, and predictable composable extraction.
  • Captures reactivity best practices: use ref/shallowRef/reactive appropriately, avoid destructuring reactive objects, prefer computed for derived values, and explain .value vs template unwrapping.
  • Guides SFC structure, template safety (v-html sanitization), stable v-for keys, v-if/v-else usage, component splitting for CRUD features, and performance-first recommendations (when to virtualize, memoize, or keep things simple).
  • Use cases: refactoring Options API components to Composition API, running automated code-review style checks, designing feature folders and composables, and producing production-ready SFC patterns for teams.

Quick Start

Ask the assistant to refactor a Vue SFC to use <script setup lang="ts">, computed properties, typed props/emits, and extract state into composables.

Frequently Asked Questions about vue

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor a Vue component to use Composition API with script setup?

Vue reactivity best practices require using ref or shallowRef appropriately, avoiding destructuring of reactive objects, and preferring computed for derived values. You must understand .value usage in scripts versus template unwrapping to prevent reactivity loss.

What is the correct structure for Vue 3 Single-File Components?

Correct Vue 3 Single-File Component structure enforces a predictable SFC section order and splits components for CRUD features. It requires stable v-for keys, safe v-html sanitization, and explicit props and events contracts to ensure type safety and maintainability.

Can I use TypeScript with Vue composables and typed props?

Yes, you can use TypeScript with Vue composables by applying <script setup lang="ts"> and defining explicit props and events contracts. Typed defineProps and defineEmits ensure strict type checking for composable-driven state across your application.

When should I use shallowRef instead of ref in Vue 3?

Use shallowRef instead of ref in Vue 3 for performance optimization when dealing with large objects that do not need deep reactivity. It prevents deep tracking overhead, keeping things simple when deep property changes are unnecessary for the component's rendering logic.

Why does destructuring reactive objects break Vue reactivity?

Destructuring reactive objects breaks Vue reactivity because primitive values lose their reactive proxies when extracted. To maintain reactivity, keep reactive objects intact and use composables or computed properties to expose specific values without losing the reactive reference.