vue-typescript

Build Vue 3 components with TypeScript and the Composition API.

Updated Mar 3, 2026
One-click install
npx skills add https://github.com/jacexh/skills --skill vue-typescript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue-typescript
Source: https://github.com/jacexh/skills/tree/main/skills/vue-typescript
Command: npx skills add https://github.com/jacexh/skills --skill vue-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides clear, production-ready patterns and examples to eliminate common pitfalls when building Vue 3 applications with TypeScript, reducing type errors, inconsistent state management, and untyped component interfaces so teams can move faster with confidence.

Core Features & Use Cases

  • Script setup with TypeScript: patterns for typed props, emits, and generic components to improve component safety and reusability.
  • Composables and data fetching: guidance for creating reusable composable hooks, typed return shapes, and reactive state management.
  • Pinia stores and typed router: examples for defining typed Pinia stores, extracting store state with storeToRefs, and typing route params and navigation.
  • Form validation and integration: recommended approach to combine VeeValidate with Zod for type-safe validation schemas.
  • Use Case: Migrate a legacy Options API component to script setup with TypeScript, extract shared logic into composables, and wire it to a typed Pinia store and route.

Quick Start

Ask the assistant to refactor a Vue single-file component to use script setup with TypeScript, add typed props and emits, extract reusable composables, and connect it to a typed Pinia store and typed routes.

Frequently Asked Questions about vue-typescript

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

FAQPage Schema
How do I define typed props and emits in Vue 3 script setup components?

You can define typed props and emits in Vue 3 script setup using TypeScript generics with defineProps and defineEmits, which ensures strict type safety and improves component reusability across your application.

What is the best way to extract typed state from a Pinia store in Vue 3?

The best way to extract typed state from a Pinia store is using the storeToRefs function, which destructures store properties while preserving reactivity and maintaining full TypeScript type inference for state and getters.

How do I create reusable composables with TypeScript for data fetching in Vue 3?

Create reusable composables for data fetching in Vue 3 by defining functions that return typed reactive state and explicit return shapes, ensuring predictable type inference throughout your component logic.

Can I use VeeValidate with Zod for type-safe form validation in Vue 3?

Yes, you can integrate VeeValidate with Zod in Vue 3 to establish type-safe validation schemas, bridging runtime form validation with compile-time TypeScript type checking for robust data integrity.

How do I type route params and navigation with Vue Router in TypeScript?

Type route params and navigation in Vue Router by applying TypeScript definitions to route configurations, enabling strict type checking for dynamic route parameters and safe programmatic navigation.

How do I migrate a Vue Options API component to script setup with TypeScript?

To migrate a Vue Options API component to script setup with TypeScript, refactor data and methods into reactive refs and functions, wire shared logic to composables, and connect it to a typed Pinia store.