ワンクリックで
vue-performance
Vue Best Practices
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Vue Best Practices
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Manages AI agent context window usage - truncation rules, clear truncation markers, and tools for chunked reading or search. Use when building or modifying agent context, system prompts, user messages, or tools that inject large content into the LLM.
Code Quality Best Practices
Caido Backend SDK Rules and Patterns
Caido Frontend SDK Rules and Patterns
Caido HTTP Proxy Overview
Vue component structure, PrimeVue, and script setup conventions
| name | vue-performance |
| description | Vue Best Practices |
<!-- Bad: Every ListItem updates when activeId changes -->
<ListItem
v-for="item in list"
:id="item.id"
:active-id="activeId" />
<!-- Good: Only items whose active status changed will update -->
<ListItem
v-for="item in list"
:id="item.id"
:active="item.id === activeId" />
// Bad: Creates new object every time, always triggers updates
const computedObj = computed(() => {
return {
isEven: count.value % 2 === 0
}
})
// Good: Returns old value if nothing changed
const computedObj = computed((oldValue) => {
const newValue = {
isEven: count.value % 2 === 0
}
if (oldValue && oldValue.isEven === newValue.isEven) {
return oldValue
}
return newValue
})
shallowRef() and shallowReactive() to opt-out of deep reactivity.const shallowArray = shallowRef([/* big list of deep objects */])
// Bad: Won't trigger updates
shallowArray.value.push(newObject)
shallowArray.value[0].foo = 1
// Good: Replace the root state
shallowArray.value = [...shallowArray.value, newObject]
shallowArray.value = [
{ ...shallowArray.value[0], foo: 1 },
...shallowArray.value.slice(1)
]
MaybeRefOrGetter<T> type for flexible function parameters that can accept refs, getters, or plain values.toValue() to extract the actual value from MaybeRefOrGetter parameters:Always handle every possible state for data fetching or async logic, using separate components for each state: loading, success, error, and empty.
Example:
<script setup lang="ts">
import { ref } from "vue";
import type { User } from "@/types";
const user = ref<User | undefined>(undefined);
const loading = ref(true);
const error = ref<Error | undefined>(undefined);
async function fetchUserData(userId: string) {
loading.value = true;
error.value = undefined;
try {
const response = await fetch(`/api/users/${userId}`);
if (!response.ok) throw new Error("Failed to fetch user data");
user.value = await response.json();
} catch (e) {
error.value = e instanceof Error ? e : new Error("Unknown error");
user.value = undefined;
} finally {
loading.value = false;
}
}
</script>
<template>
<div>
<LoadingSpinner v-if="loading" />
<ErrorMessage v-else-if="error !== undefined" :message="error.message" @retry="() => fetchUserData('replace-id')" />
<UserProfile v-else-if="user !== undefined" :user="user" />
<EmptyState v-else message="No user data available" />
</div>
</template>
This ensures each state (loading, error, data, empty) is handled explicitly and the UI never displays an inconsistent result.