xiaohongshu
xiaohongshu
vuejs-best-practices
Vue 3 and Nuxt 3 performance optimization and best practices. This skill should be used when writing, reviewing, or refactoring Vue.js code to ensure optimal performance patterns. Triggers on tasks involving Vue components, Nuxt pages, Composition API, Pinia state management, or performance impro...
Full skill instructions
Comprehensive performance optimization guide for Vue 3 and Nuxt 3 applications. Contains 50+ rules across 10 categories, prioritized by impact to guide automated refactoring and code generation.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Reactivity Optimization | CRITICAL | reactivity- |
| 2 | Bundle Size Optimization | CRITICAL | bundle- |
| 3 | Nuxt 3 Server Performance | HIGH | nuxt- |
| 4 | Component Design Patterns | HIGH | component- |
| 5 | Composition API Patterns | MEDIUM-HIGH | composable- |
| 6 | State Management (Pinia) | MEDIUM-HIGH | pinia- |
| 7 | Rendering Performance | MEDIUM | rendering- |
| 8 | TypeScript Integration | MEDIUM | typescript- |
| 9 | Testing Patterns | LOW-MEDIUM | testing- |
| 10 | Advanced Patterns | LOW | advanced- |
reactivity-shallowref - Use shallowRef for large objects that don't need deep reactivityreactivity-shallowreactive - Use shallowReactive for flat objectsreactivity-computed-cache - Leverage computed for expensive calculations (auto-caching)reactivity-toraw - Use toRaw() when passing to external librariesreactivity-markraw - Use markRaw() for non-reactive objects (classes, third-party instances)reactivity-effectscope - Use effectScope() to batch cleanup of effectsbundle-tree-shaking - Import from 'vue' not internal packages (@vue/reactivity, @vue/runtime-core)bundle-async-components - Use defineAsyncComponent for heavy componentsbundle-dynamic-imports - Dynamic import() for route-level code splittingbundle-icon-imports - Import icons directly, avoid icon libraries barrel filesbundle-lodash-es - Use lodash-es with specific importsbundle-analyze - Use rollup-plugin-visualizer to identify bloatbundle-external-cdn - Externalize large libraries to CDN when appropriatenuxt-usefetch - Use useFetch/useAsyncData for SSR-friendly data fetchingnuxt-lazy-components - Prefix with Lazy for automatic lazy loadingnuxt-payload-reduce - Minimize payload with pick/transform optionsnuxt-cache-route - Use routeRules for caching strategiesnuxt-server-components - Use .server.vue for server-only componentsnuxt-prerender - Prerender static pages at build timenuxt-islands - Use Nuxt Islands for partial hydrationnuxt-nitro-cache - Leverage Nitro caching for API routescomponent-sfc-setup - Always use <script setup> syntaxcomponent-props-destructure - Use destructuring with defineProps for reactivitycomponent-emits-typed - Always define emits with TypeScriptcomponent-slots-typed - Type slots with defineSlotscomponent-expose - Use defineExpose sparingly, prefer props/emitscomponent-v-once - Use v-once for static contentcomponent-v-memo - Use v-memo for list item optimizationcomponent-teleport - Use Teleport for modals/tooltipscomposable-naming - Prefix composables with 'use' (useAuth, useFetch)composable-return-object - Return object, not array, for better DXcomposable-cleanup - Always handle cleanup in onUnmountedcomposable-async - Handle async state properly (loading, error, data)composable-ssr-safe - Check import.meta.client for browser-only codecomposable-provide-inject - Use provide/inject with InjectionKey for type safetycomposable-vueuse - Leverage VueUse before writing custom composablespinia-setup-syntax - Prefer setup stores over options storespinia-storetorefs - Use storeToRefs() to maintain reactivitypinia-actions-async - Use actions for async operations, not getterspinia-persist - Use pinia-plugin-persistedstate for persistencepinia-reset - Implement $reset for store cleanuppinia-subscribe - Use $subscribe for side effectspinia-ssr-hydration - Handle SSR hydration properly in Nuxtrendering-v-show-v-if - v-show for frequent toggles, v-if for rare conditionsrendering-key-attribute - Always use unique :key in v-for (avoid index as key)rendering-virtual-scroll - Use virtual scrolling for long lists (100+ items)rendering-keep-alive - Cache component instances with KeepAliverendering-suspense - Use Suspense for async component loading statestypescript-props-interface - Define props with interface, not typetypescript-ref-type - Explicitly type refs: ref<string>('')typescript-template-ref - Type template refs: ref<HTMLInputElement | null>(null)typescript-component-type - Use ComponentPublicInstance for component refstypescript-generic-components - Use generic components for reusable patternstypescript-strict-inject - Use InjectionKey<T> for type-safe provide/injecttypescript-event-handlers - Type event handlers properlytesting-vitest - Use Vitest for unit testing (Vue ecosystem native)testing-vue-test-utils - Use @vue/test-utils for component testingtesting-composables - Test composables in isolationtesting-pinia - Use createTestingPinia for store testingtesting-msw - Use MSW for API mockingtesting-playwright - Use Playwright for E2E with Nuxtadvanced-render-function - Use render functions for dynamic component generationadvanced-custom-directive - Create custom directives for DOM manipulationadvanced-plugin-pattern - Structure plugins with proper install functionWhat type of data?
│
├── Primitives (string, number, boolean)
│ └── ref() ✓
│
├── Objects/Arrays (need deep reactivity)
│ └── reactive() ✓
│
├── Large objects (performance critical)
│ └── shallowRef() or shallowReactive() ✓
│
└── Non-reactive data (class instances, external libs)
└── markRaw() ✓
Where is the code running?
│
├── Component/Page (need SSR + reactivity)
│ └── useFetch() or useAsyncData() ✓
│
├── Server API route
│ └── $fetch() ✓
│
├── Event handler (client-side only)
│ └── $fetch() ✓
│
└── Composable (reusable)
└── useFetch() with key ✓
What's the relationship?
│
├── Parent → Child
│ └── Props ✓
│
├── Child → Parent
│ └── Emits ✓
│
├── Siblings
│ └── Pinia store or provide/inject ✓
│
├── Deep nesting (prop drilling)
│ └── provide/inject ✓
│
└── Global state
└── Pinia store ✓
this in <script setup>$fetch in components (use useFetch)<script setup>Before shipping:
For detailed code examples, implementation patterns, and comprehensive explanations: AGENTS.md
Each section in AGENTS.md contains:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience