alpha

Sets Vue 3 development standards for a coding assistant: Composition API, script setup, reactivity, Pinia, Vue Router, TypeScript, testing, performance and security.
description: 'Comprehensive Vue 3 development standards and best practices: Composition API, <script setup>, the full reactivity system, compiler macros (defineModel/defineSlots/defineOptions), built-in components (Teleport/Suspense/Transition/KeepAlive), provide/inject, composables, Pinia, Vue Router, TypeScript, testing, performance, SSR, and security.'
applyTo: '**/.vue, **/.ts, **/.js, **/.css, **/*.scss'
Authoritative guidance for building production-grade Vue 3 applications. Default to the Composition API with <script setup lang="ts">, the modern reactivity system, and the official ecosystem (Pinia, Vue Router, Vite, Vitest). Prefer the idioms below over legacy Options API and Vue 2 patterns.
useTemplateRef, useId, and reactive props destructuring where the project's version allows).<script setup lang="ts"> single-file components (SFCs) as the default authoring style.<script setup> — it is more concise, faster, and has better type inference than setup() or the Options API.<script setup>, then <template>, then <style scoped>.UserCard, not Card) to avoid clashing with native elements.types/ module.defineProps<T>() — declare typed props from a TypeScript interface/type for full inference.withDefaults(defineProps<T>(), { ... }) — provide prop defaults (or use reactive props destructuring with defaults in 3.5+).defineEmits<{ change: [id: number]; update: [value: string] }>() — declare typed events.defineModel<T>() (3.4+) — the canonical way to implement v-model on a component; supports multiple models, arguments, and modifiers.defineExpose({ ... }) — explicitly expose a public imperative API; expose nothing by default.defineSlots<{ default(props: { item: T }): any }>() — type named/scoped slots.defineOptions({ name, inheritAttrs }) — set component options inside <script setup>.defineModel, or derive local state with computed/ref.ref() for primitives and single replaceable references; access via .value in script (auto-unwrapped in templates).reactive() for deep-reactive objects/collections; never destructure it directly (breaks reactivity) — use toRefs()/toRef().computed() for derived values; keep getters pure and side-effect free. Use writable computed (get/set) for two-way derived state.computed over watch whenever you are deriving a value rather than performing a side effect.watch(source, cb, options) for explicit dependencies; watchEffect(cb) for auto-tracked dependencies.{ immediate: true }, { deep: true }, { once: true } (3.4+), and flush: 'post' when you need the DOM updated first.onCleanup/onWatcherCleanup callback to cancel stale async work (debounce, fetch, listeners).shallowRef / shallowReactive for large or externally-managed data to skip deep tracking.readonly() to hand out immutable views of shared state.toRef / toRefs to keep reactivity when destructuring; toRaw/markRaw to opt out for non-reactive objects (e.g. class instances, 3rd-party clients).effectScope() to group and dispose related effects together (useful in composables/libraries).customRef for debounced/throttled or storage-backed refs.useXxx() functions under composables/.toValue()/MaybeRefOrGetter to normalize ref-or-plain inputs.onMounted/onUnmounted or tryOnScopeDispose) so callers don't leak.useStorage, useEventListener, useDebounceFn).onMounted, onBeforeMount, onUpdated, onBeforeUnmount, onUnmounted, onActivated/onDeactivated (with <KeepAlive>), and onErrorCaptured.onUnmounted.window, document) for SSR; run them in onMounted.:key on v-for; never use the array index when items can reorder or mutate.v-if and v-for on the same element — filter via a computed instead.v-show for frequently toggled elements; v-if for conditional mounting.v-memo to skip re-rendering of expensive static subtrees, and v-once for content that renders a single time.: (v-bind) and @ (v-on) shorthands consistently; group nodes with <template> to avoid wrapper elements.computed or methods.<slot :item="item" /> + #default="{ item }") to expose data to the parent.v-slot (#) shorthand and dynamic slot names where appropriate.<Teleport to="body"> for modals, toasts, and tooltips that must escape overflow/stacking contexts.<Suspense> with #default/#fallback for async setup and lazy components; pair with error handling.<Transition> / <TransitionGroup> for enter/leave and list animations (set :key on grouped items).<KeepAlive> (with include/exclude/max) to cache component state across toggles; handle onActivated/onDeactivated.<component :is="..."> for dynamic components; defineAsyncComponent(() => import('...')) for code-split/lazy loading with loading/error components.InjectionKey<T> (Symbol) for safety: provide(key, value) / inject(key).undefined.readonly() when providing state that children should not mutate; expose explicit updater functions instead.mounted/updated (etc.) hooks; keep them DOM-focused (e.g. v-focus, v-click-outside).app.use(...); register global config in main.ts.ref/reactive.defineStore('user', () => { const user = ref(...); const isLoggedIn = computed(...); function login(){}; return { user, isLoggedIn, login } }).storeToRefs() to preserve reactivity; use $patch for batched mutations, $reset to restore state, and $subscribe/$onAction for cross-cutting concerns.component: () => import('...') for automatic code splitting.beforeEach, beforeEnter, beforeRouteLeave) for auth and unsaved-changes checks; always resolve/next() exactly once.route.meta (typed) for per-route config like requiresAuth.useRoute() and navigate via useRouter(); treat route.params as reactive (watch it, don't cache).scrollBehavior for predictable scroll restoration; enable typed routes where available.ref<User | null>(null).useTemplateRef<HTMLInputElement>('input') (3.5+) or ref<HTMLInputElement | null>(null).<script setup lang="ts" generic="T">.InjectionKey<T>; type Pinia stores via their inferred return types.<style scoped>; use :deep(), :slotted(), and :global() selectors deliberately.v-bind() in <style> to drive CSS from reactive state; prefer CSS custom properties for theming.<style module>) for class-name isolation in larger teams.v-model (and defineModel for custom inputs); use modifiers .lazy, .number, .trim.onErrorCaptured for component-tree boundaries and app.config.errorHandler for a global hook.<Suspense> + an error fallback.defineAsyncComponent, dynamic import()).computed for caching, v-memo/v-once for static subtrees, and shallowRef/shallowReactive for big datasets.vue-virtual-scroller); paginate or window large data.aria-label); associate labels with inputs.v-html; sanitize (e.g. DOMPurify) if it is unavoidable.:is/:href/:src from untrusted sources; validate URLs (block javascript: schemes).VITE_-prefixed env vars intentionally meant to be public.createTestingPinia; stub router and async boundaries as needed.vue-tsc for type-checking in CI.eslint-plugin-vue) and Prettier; enable Volar/Vue official extension for the best DX.import.meta.env with VITE_-prefixed variables.reactive()/Pinia stores without toRefs/storeToRefs.watch for values that should be computed.v-if together with v-for on one element; using array index as :key.onUnmounted cleanup.v-html.© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com


Heartbroken man kneels in rain as woman turns away
Draws a cinematic heartbreak scene of a man kneeling in a storm as a woman sits turned away, with symbolic keepsakes and split cool and warm lighting.
image-prompt, gemini, photorealistic, cinematic, rain, dramatic-lighting, poster, widescreen, moody, couple, man, woman, cityscape, night-scene, multi-panel, low-angle, still-life, romance, album-cover, for-artists, long-form, structured-output, negative-space, flowers

Macro shot of a vintage wristwatch between fingers
Generates a moody macro video of a vintage wristwatch held between fingers, with fine surface wear, warm grazing light and a subtly moving second hand.
video-prompt, kling, macro, product-video, cinematic, bokeh, dramatic-lighting, moody, close-up, slow-motion, film-grain, photorealistic, single-take, camera-movement, video-ad, for-filmmakers, still-life, vintage, jewelry, widescreen

Polaroid scrapbook collage of one woman in many poses
Builds a photorealistic scrapbook collage of Polaroid-style photos showing one woman in seven poses around a central portrait, with paper, tape and handwritten details.
image-prompt, gpt-image, collage, reference-image, face-reference, character-consistency, film-photography, vintage, cozy, woman, portrait, photorealistic, multi-panel, text-rendering, natural-light, soft-lighting, bokeh, candid, selfie, flowers, doodle, still-life, guardrails, long-form, for-content-creators, for-photographers, scrapbook
Loading reviews…
Loading comments…