Vue

From Esposter/Esposter · View interactive version

Vue is an AI agent skill from the GitHub repository Esposter/Esposter. Apply when writing or reviewing .vue files, or rendering a date or time. Esposter's Vue 3 single-file-component conventions.

How to use this skill

Skill file

Vue Conventions

Settled — do not re-propose

Ordering — `references/ordering.md`

Macros defineSlots → defineModel → defineProps → defineEmits (a defineOptions before them; vue/define-macros-order enforces it), then every const, defineExpose last; declarations run macros → page metadata → framework value composables → Pinia stores → everything else; attributes run v-for/:key → ref → v-model → class → attributify → valued props (alphabetical) → bare booleans → @event. The exceptions to each, and the typing defineModel and defineSlots take, are that page.

Single-use functions must be inlined — `references/inline-handlers.md`

Read it when naming, extracting or reviewing a function used once. A single-use function that only defers a block must be inlined; the discriminator is whether its name states its _trigger_ (onMount, handleX — inline it, including template handlers however long) or its _result_ (getFooType — keep it, single use is fine). The page owns every form of ceremony, the template-scope exception, and the list of legitimate keeps.

v-model, Inputs and Forms — `references/forms.md`

Read it when an input needs the split :model-value + @update:model-value form, or when a form handles both create and edit (the isCreate prop, a single values ref).

Template Conventions

Props, Refs & Computed

Reading the auth session — `references/auth-session.md`

Read it when anything needs the signed-in user. Two call forms, and the access shape follows the form: await useAuthSession() in async SSR-relevant context (session.value?.user.id), useSessionData() wherever you can't await, same shape; the bare authClient.useSession() is lint-banned for mismatching on hydration.

When (not) to `watch` — `references/watch-decision-tree.md`

Read it before writing any watch, or when a local ref mirrors a prop/store value. Reach for a watcher only after the page's cases 1–4 are ruled out.

Lifecycle hooks and the browser — `references/lifecycle-and-ssr.md`

A browser global read at setup scope runs on the server too, and the failure is a render that never reaches the client. Placing a lifecycle hook, or touching window, document or anything else the server does not have, is that page.

The Options API runtime is compiled out — `references/options-api.md`

Ours are <script setup> only (scripts/src/services/oxlint/selectorBan/syntaxes/restrictedComponentApiSyntaxes.ts). vue.optionsApi is off and stays off, so a _dependency_ shipping Options API .vue components mounts and then dereferences off undefined with nothing thrown to name the cause. Every Vitest worker runs the same Vue, so a component test mounting one fails as the app does. Read the page before adding one, or when a node_modules component renders blank.

Dates Are `<NuxtTime>` — `references/dates.md`

Every rendered date is a <NuxtTime>; the date-formatting ban inside a .vue and the hand-written time element are lint errors (vue/no-restricted-syntax, vue/no-restricted-html-elements). Standard: openspec/specs/architecture/date-time-display/design.md. Read the page for what the lint rule can't say — options rather than format strings, what bare title really renders, and the client-rendered message list as the one exception.

Reference pages

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.