Vue application structure

From aj-geddes/useful-ai-prompts · View interactive version

Vue application structure is an AI agent skill from the GitHub repository aj-geddes/useful-ai-prompts. Structure Vue 3 applications using Composition API, component organization, and TypeScript. Use when building scalable Vue applications with proper separation of concerns.

How to use this skill

Skill file

Vue Application Structure

Table of Contents

Overview

Build well-organized Vue 3 applications using Composition API, proper file organization, and TypeScript for type safety and maintainability.

When to Use

Quick Start

Minimal working example:

// useCounter.ts (Composable)
import { ref, computed } from 'vue';

export function useCounter(initialValue = 0) {
  const count = ref(initialValue);

  const doubled = computed(() => count.value * 2);
  const increment = () => count.value++;
  const decrement = () => count.value--;
  const reset = () => count.value = initialValue;

  return {
    count,
    doubled,
    increment,
    decrement,
    reset
  };
}

// Counter.vue
<template>
  <div class="counter">
    <p>Count: {{ count }}</p>
    <p>Doubled: {{ doubled }}</p>
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

| Guide | Contents |

|---|---|

| Vue 3 Composition API Component | Vue 3 Composition API Component |

| Async Data Fetching Composable | Async Data Fetching Composable |

| Component Organization Structure | Component Organization Structure |

| Form Handling Composable | Form Handling Composable |

| Pinia Store (State Management) | Pinia Store (State Management) |

Best Practices

✅ DO

❌ DON'T

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.