agentleFS
G1JoshiG1Joshi/Agent-Skills/skills/frameworks/vue/SKILL.md

vue

Skill15 starsChanged 42 days agoMITView on GitHub

Expert Vue 3 assistance covering Composition API (<script setup>), reactivity (ref, reactive), Pinia, and Vue Router. Use when developing modern, progressive web interfaces and single-page applications.

33 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use antfu-design and nitro.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • wltn7810-dotcomSkill

    antfu-design

    antfu-style design conventions, broadened. UnoCSS-first, class-based semantic tokens with dual light/dark for tooling and devtools UIs, plus design-read, anti-slop, and micro-interaction polish for landing pages and product surfaces. Use when building or refactoring any interface with UnoCSS.

    Also in 3 projects that use this

  • SentrySkill

    nitro

    Build and deploy universal JavaScript servers with Nitro v3. Use when working with nitro.config.ts, defineNitroConfig, defineHandler, defineConfig, server.ts entry, filesystem routing, route rules, useStorage, defineCachedHandler, useDatabase, definePlugin, runtime hooks, Vercel/Cloudflare deployment, or migrating from Nitro v2/nitropack.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 28 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use <script setup lang="ts"> as the default syntax for all Vue 3 components.

    line 180
  2. Distinctive:

    Use Pinia for global state management.

    line 181
  3. Very specific:

    Use shallowRef or shallowReactive for large arrays/objects that do not need deep reactivity.

    line 182
  4. Very specific:

    Use Options API (data(), methods) in new greenfield TypeScript codebases.

    line 187
  5. Very specific:

    Use v-if and v-for on the exact same HTML element.

    line 189

“Common” is measured: kept by at least 6 in 10 of the 28 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Vue.js

Vue is a progressive framework for building user interfaces, featuring the reactive Composition API and high-performance Vapor Mode compilation.

When to Use

  • Progressive Full-Stack Web Applications: Vue 3.5+ with <script setup> and Composition API.
  • Single Page Applications (SPAs): Building fast, reactive frontends with Vue Router and Pinia.
  • Interactive Micro-Frontends & Widgets: Embedding reactive components into existing server-rendered templates.
  • Design System Implementation: Building accessible, scoped component libraries with PrimeVue or Vuetify.

Quick Start

<script setup>
import { ref, computed } from "vue";

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

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

<template>
  <button @click="increment">
    Count is: {{ count }}, Double is: {{ double }}
  </button>
</template>

Core Concepts

Composition API with <script setup> & TypeScript

Reactive primitives using ref, computed, and watch:

<!-- components/ProductCounter.vue -->
<script setup lang="ts">
import { ref, computed, watch } from "vue";

interface Props {
  initialCount?: number;
  unitPrice: number;
}

const props = withDefaults(defineProps<Props>(), {
  initialCount: 1,
});

const emit = defineEmits<{
  (e: "totalChanged", total: number): void;
}>();

const quantity = ref(props.initialCount);
const totalPrice = computed(() => quantity.value * props.unitPrice);

watch(totalPrice, (newTotal) => {
  emit("totalChanged", newTotal);
});

function increment() {
  quantity.value += 1;
}

function decrement() {
  if (quantity.value > 1) quantity.value -= 1;
}
</script>

<template>
  <div class="counter-box">
    <button @click="decrement">-</button>
    <span>{{ quantity }}</span>
    <button @click="increment">+</button>
    <p>Total: ${{ totalPrice.toFixed(2) }}</p>
  </div>
</template>

State Management with Pinia

Centralized reactive store with type inference:

// stores/cart.ts
import { defineStore } from "pinia";
import { ref, computed } from "vue";

export interface CartItem {
  id: number;
  name: string;
  price: number;
}

export const useCartStore = defineStore("cart", () => {
  const items = ref<CartItem[]>([]);

  const totalCost = computed(() =>
    items.value.reduce((sum, item) => sum + item.price, 0),
  );
  const itemCount = computed(() => items.value.length);

  function addItem(item: CartItem) {
    items.value.push(item);
  }

  function clearCart() {
    items.value = [];
  }

  return { items, totalCost, itemCount, addItem, clearCart };
});

Asynchronous Components & Suspense

Lazy-loading components for optimal code splitting:

<script setup lang="ts">
import { defineAsyncComponent } from "vue";

const HeavyChart = defineAsyncComponent(
  () => import("./HeavyAnalyticsChart.vue"),
);
</script>

<template>
  <Suspense>
    <template #default>
      <HeavyChart />
    </template>
    <template #fallback>
      <div class="loading-skeleton">Loading interactive chart...</div>
    </template>
  </Suspense>
</template>

Common Patterns

Composable Pattern with Auto-Cleanup

Problem: Encapsulating reactive stateful logic for reuse across multiple components.

Solution: Build typed composables with Vue 3 lifecycle hooks:

import { ref, onMounted, onUnmounted } from "vue";

export function useMouse() {
  const x = ref(0);
  const y = ref(0);

  function update(event: MouseEvent) {
    x.value = event.pageX;
    y.value = event.pageY;
  }

  onMounted(() => window.addEventListener("mousemove", update));
  onUnmounted(() => window.removeEventListener("mousemove", update));

  return { x, y };
}

Best Practices

Do:

  • Use <script setup lang="ts"> as the default syntax for all Vue 3 components.
  • Use Pinia for global state management; deprecate legacy Vuex.
  • Use shallowRef or shallowReactive for large arrays/objects that do not need deep reactivity.
  • Scope component CSS (<style scoped>) to avoid leaking styles across the application.

Don't:

  • Use Options API (data(), methods) in new greenfield TypeScript codebases.
  • Mutate props directly inside child components; emit events for the parent to update state.
  • Use v-if and v-for on the exact same HTML element.

Troubleshooting

ErrorCauseSolution
TypeError: Cannot set property of undefined in refForgetting .value when updating ref in JavaScript.Always read and write refs using .value in <script>: count.value++.
Reactivity lost when destructuring reactive objectDestructuring reactive({}) strips the underlying Proxy.Wrap object with toRefs(state) before destructuring.
Component emitted event but no listener registeredEvent name casing mismatch between component and parent.Use kebab-case for event listeners in templates: @update-item="handle".

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.