Loading...
Loading...
Guidelines for building Vue 3 frontend applications with Composition API, Vite, and feature-based architecture. Use when creating or modifying Vue components, composables, stores, or project structure — prioritizing visual design, strict separation of concerns, and accessibility.
npx skill4agent add forge-it/agent-skills frontend-vue-developmentselectedBackupselnotificationnbackupbbackups.filter(backup => ...)backups.filter(b => ...)v-for.map().filter().find()useUserAuthuseFormValidationuseTableSortuseUserFormTable<script setup lang="ts">
// Modern Vue 3 component with performance optimization
import { ref, computed } from 'vue';
import { useVirtualList } from '@vueuse/core';
interface Column {
key: string;
label: string;
}
const props = defineProps<{
data: Array<Record<string, any>>;
columns: Column[];
}>();
const emit = defineEmits<{
rowClick: [row: Record<string, any>];
}>();
const containerRef = ref<HTMLDivElement | null>(null);
const { list, containerProps, wrapperProps } = useVirtualList(
computed(() => props.data),
{ itemHeight: 50, overscan: 5 }
);
function handleRowClick(row: Record<string, any>) {
emit('rowClick', row);
}
</script>
<template>
<div
v-bind="containerProps"
ref="containerRef"
class="h-96 overflow-auto"
role="table"
aria-label="Data table"
>
<div v-bind="wrapperProps">
<div
v-for="{ data: row, index } in list"
:key="index"
class="flex items-center border-b hover:bg-gray-50 cursor-pointer"
role="row"
tabindex="0"
@click="handleRowClick(row)"
@keydown.enter="handleRowClick(row)"
>
<div
v-for="column in columns"
:key="column.key"
class="px-4 py-2 flex-1"
role="cell"
>
{{ row[column.key] }}
</div>
</div>
</div>
</div>
</template>shared/BaseButtonuseDebounceshared/domains/connectivity-healthjobsshared/src/
├── app/ # App shell — bootstrap and wiring only
│ ├── App.vue
│ ├── main.ts
│ ├── router.ts # Top-level route definitions
│ └── plugins/ # Global plugin registration
│
├── features/ # Feature modules (one folder per domain)
│ ├── auth/
│ │ ├── components/ # Auth-specific components (LoginForm, etc.)
│ │ ├── composables/ # Auth-specific logic (useAuth, useSession)
│ │ ├── api/ # Auth API calls (login, logout, refresh)
│ │ ├── stores/ # Auth Pinia store
│ │ ├── types/ # Auth-specific TypeScript types
│ │ └── index.ts # Public API — only export what other features may use
│ ├── dashboard/
│ │ ├── components/
│ │ ├── composables/
│ │ ├── api/
│ │ ├── stores/
│ │ └── types/
│ └── settings/
│ └── ...
│
├── shared/ # Reusable across features — two distinct tiers
│ ├── domains/ # Shared domain modules — business concepts used by 2+ features
│ │ ├── connectivity-health/# owns no routes; shaped like a feature (components, composables, types)
│ │ └── jobs/ # imported by features, never imports from them
│ ├── components/ # Generic foundation: design system primitives (BaseButton, BaseModal)
│ ├── composables/ # Generic composables (useDebounce, useMediaQuery, usePagination)
│ ├── api/ # API client setup, interceptors, error handling
│ ├── utils/ # Pure functions (formatDate, slugify)
│ └── types/ # Shared TypeScript types and interfaces
│
├── assets/ # Static assets (images, fonts, icons)
└── styles/ # Global styles, CSS variables, theme tokensshared/shared/domains/features/shared/domains/shared/shared/domains/features/features/index.tsshared/components/BaseButtonUserAvatarshared/domains/api/create-vuecreate-vite@vitejs/plugin-vuevite-plugin-vue-devtools