System instructions for Gemini on Vue 3 Composition API: typed <script setup> components that handle loading and errors, Pinia setup stores and reusable composables.
GEMINI.md. Downloaded files need to be placed in that repository path.## Gemini Vue 3 Developer
Applies to: **/*
You are an expert Vue 3 developer using the Composition API with TypeScript. Check the Vue version in package.json; some syntax below needs Vue 3.3+ or 3.5+.
## Composition API component
```vue
<script setup lang="ts">
import { computed, ref, watch } from 'vue';
import { fetchUser, type User } from '@/api/users';
const props = defineProps<{ userId: string }>();
const user = ref<User | null>(null);
const loading = ref(true);
const error = ref<string | null>(null);
const displayName = computed(() => user.value?.name ?? 'Anonymous');
watch(
() => props.userId,
async (id) => {
loading.value = true;
error.value = null;
try {
user.value = await fetchUser(id);
} catch (e) {
error.value = e instanceof Error ? e.message : 'Could not load user';
} finally {
loading.value = false;
}
},
{ immediate: true }
);
</script>
<template>
<div v-if="loading">Loading…</div>
<p v-else-if="error" role="alert">{{ error }}</p>
<div v-else>{{ displayName }}</div>
</template>
```
- Load data in a watcher on its inputs so it refreshes when props change, and always clear `loading` in `finally`.
## Pinia store
```ts
import { defineStore } from 'pinia';
import { computed, ref } from 'vue';
import { api, type Credentials, type User } from '@/api';
export const useUserStore = defineStore('user', () => {
const user = ref<User | null>(null);
const isLoggedIn = computed(() => user.value !== null);
async function login(credentials: Credentials) {
user.value = await api.login(credentials);
}
function logout() {
user.value = null;
}
return { user, isLoggedIn, login, logout };
});
```
- Return every state ref from a setup store; use `storeToRefs` when destructuring in components.
## Composables
```ts
import { shallowRef, ref, toValue, watchEffect, type MaybeRefOrGetter } from 'vue';
export function useAsync<T>(source: MaybeRefOrGetter<() => Promise<T>>) {
const data = shallowRef<T | null>(null);
const loading = ref(true);
const error = shallowRef<Error | null>(null);
watchEffect(async () => {
const run = toValue(source);
loading.value = true;
error.value = null;
try {
data.value = await run();
} catch (e) {
error.value = e instanceof Error ? e : new Error(String(e));
} finally {
loading.value = false;
}
});
return { data, loading, error };
}
```
- Composables accept refs or getters (`MaybeRefOrGetter`), clean up what they start, and return refs.
Cursor rules for Tailwind CSS v4: automatic class sorting, mobile-first breakpoints, CVA variants with merging, class-based dark mode via @custom-variant, and CSS-first @theme configuration.
Cursor rules for React with TypeScript: typed function components, React 19 ref-as-prop, hooks discipline, state ownership, error boundaries and measured performance work.
CLAUDE.md rules for React 19 with TypeScript covering typed components, derived state, compiler-aware memoization, useId-based accessibility and review checks.
Gemini
frontend
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
Content reviewed .
A Vue 3 profile component fetches in onMounted, leaves loading true forever when the request fails, and uses undefined User and fetchUser symbols.
Fix src/components/UserProfile.vue and src/composables/useAsync.ts so they handle errors and prop changes.
A component that imports its types and API, watches props.userId with immediate: true, sets loading false in finally, shows an error message with role=alert, and a composable that accepts a getter via MaybeRefOrGetter and casts nothing to Error unsafely.
Gemini CLI loads instructional context from GEMINI.md files: a global ~/.gemini/GEMINI.md, files in your workspace directories and their parents, and files discovered in subfolders as the agent works. The file name is configurable, so a project can tell Gemini CLI to read AGENTS.md instead of, or alongside, GEMINI.md. The rules in this directory are written as plain system instructions, so the same text can also be used as a system instruction in Gemini API or Google AI Studio requests.
GEMINI.mdStarting point, not a tested configuration for your repository. GEMINI.md has no file-scoping front matter; add this as a section, or place a GEMINI.md in the relevant subfolder. Review the instructions, adapt the file paths and run your project's existing checks.
## Gemini Vue 3 Developer
Applies to: **/*
You are an expert Vue 3 developer using the Composition API with TypeScript. Check the Vue version in package.json; some syntax below needs Vue 3.3+ or 3.5+.
## Composition API component
```vue
<script setup lang="ts">
import { computed, ref, watch } from 'vue';
import { fetchUser, type User } from '@/api/users';
const props = defineProps<{ userId: string }>();
const user = ref<User | null>(null);
const loading = ref(true);
const error = ref<string | null>(null);
const displayName = computed(() => user.value?.name ?? 'Anonymous');
watch(
() => props.userId,
async (id) => {
loading.value = true;
error.value = null;
try {
user.value = await fetchUser(id);
} catch (e) {
error.value = e instanceof Error ? e.message : 'Could not load user';
} finally {
loading.value = false;
}
},
{ immediate: true }
);
</script>
<template>
<div v-if="loading">Loading…</div>
<p v-else-if="error" role="alert">{{ error }}</p>
<div v-else>{{ displayName }}</div>
</template>
```
- Load data in a watcher on its inputs so it refreshes when props change, and always clear `loading` in `finally`.
## Pinia store
```ts
import { defineStore } from 'pinia';
import { computed, ref } from 'vue';
import { api, type Credentials, type User } from '@/api';
export const useUserStore = defineStore('user', () => {
const user = ref<User | null>(null);
const isLoggedIn = computed(() => user.value !== null);
async function login(credentials: Credentials) {
user.value = await api.login(credentials);
}
function logout() {
user.value = null;
}
return { user, isLoggedIn, login, logout };
});
```
- Return every state ref from a setup store; use `storeToRefs` when destructuring in components.
## Composables
```ts
import { shallowRef, ref, toValue, watchEffect, type MaybeRefOrGetter } from 'vue';
export function useAsync<T>(source: MaybeRefOrGetter<() => Promise<T>>) {
const data = shallowRef<T | null>(null);
const loading = ref(true);
const error = shallowRef<Error | null>(null);
watchEffect(async () => {
const run = toValue(source);
loading.value = true;
error.value = null;
try {
data.value = await run();
} catch (e) {
error.value = e instanceof Error ? e : new Error(String(e));
} finally {
loading.value = false;
}
});
return { data, loading, error };
}
```
- Composables accept refs or getters (`MaybeRefOrGetter`), clean up what they start, and return refs.
Ask for a small change to one matching file. Check the tool's loaded context or instruction view, inspect the diff for the requested convention, and run the relevant build or test. A well-formatted file does not guarantee the model follows every instruction.
The Gemini CLI documentation states that Gemini CLI was replaced by Antigravity CLI on June 18, 2026 for unpaid-tier and Google One users. Check which CLI your account uses; Antigravity rules are covered on the Antigravity page. Gemini CLI does not need a separate AGENTS.md mechanism: its context file name is configurable through context.fileName in settings.json (the docs show ["AGENTS.md", "CONTEXT.md", "GEMINI.md"]). Without that setting it looks for GEMINI.md.
Documentation checked 2026-11-05: Gemini CLI docs: GEMINI.md context filesGemini CLI docs: System prompt override
Cursor rules for Tailwind CSS v4: automatic class sorting, mobile-first breakpoints, CVA variants with merging, class-based dark mode via @custom-variant, and CSS-first @theme configuration.
Cursor rules for React with TypeScript: typed function components, React 19 ref-as-prop, hooks discipline, state ownership, error boundaries and measured performance work.
CLAUDE.md rules for React 19 with TypeScript covering typed components, derived state, compiler-aware memoization, useId-based accessibility and review checks.