Back to Rules
Vue.js

Nuxt 3 TypeScript Nuxt UI Best Practices: Essential Coding Rules for Vue Developers

Claude Directory November 29, 2025
0 copies 2 downloads

Unlock expert guidelines for building scalable Nuxt 3 apps with TypeScript and Nuxt UI. Follow these rewritten best practices for clean code, optimal data fetching, and responsive styling to boost performance and maintainability.

Rule Content
1. **Prioritize Clean and Modular TypeScript Code**: Craft readable, scalable TypeScript that favors functional and declarative styles over classes. Break down logic into reusable modules to adhere to DRY principles and reduce repetition.

2. **Leverage Composition API with <script setup>**: Always opt for the Composition API in <script setup> format for components. Extract shared client-side logic and state into composables for reuse across your Nuxt app.

3. **Harness Nuxt 3 Auto-Imports**: Skip manual imports for essentials like ref, useState, or useRouter since Nuxt 3 handles them automatically. Integrate VueUse utilities for enhanced reactivity, but rely on @nuxtjs/color-mode and useColorMode() for theme switching.

4. **Handle Server-Side Tasks Securely**: Place database ops, auth, and sensitive logic in the server/api directory. Access environment-specific configs via useRuntimeConfig() for seamless server-client usage.

5. **Optimize SEO and Assets**: Implement useHead() and useSeoMeta() for metadata. Use <NuxtImage> or <NuxtPicture> for images, Nuxt Icons module for icons, and app.config.ts for global theme settings.

6. **Master Data Fetching Strategies**:
   - Employ useFetch() for SSR-friendly fetches with auto-caching and URL-reactive updates.
   - Choose $fetch() for client-only calls in handlers without SSR needs.
   - Apply useAsyncData() for advanced scenarios like multi-API merges or custom error/caching logic.
   - Add server: false to skip SSR, or lazy: true to delay non-essential loads post-render.

7. **Adopt Consistent Naming Patterns**: Name composables as useMyComposable(). Use PascalCase for component files (e.g., MyComponent.vue). Stick to named exports for functions to improve clarity.

8. **Excel in TypeScript Practices**: Define interfaces preferentially over types for superior extensibility. Replace enums with maps for safer, more adaptable typing. Build functional components with strong TypeScript integration.

9. **Build Responsive UIs with Nuxt UI and Tailwind**: Combine Nuxt UI components with Tailwind CSS for styling. Apply mobile-first responsive designs using Tailwind utilities for adaptive layouts.

Comments

More Rules

View all
AI/ML

GLM-4.7 Optimized Config & System Prompt Designer

Expert system prompt for designing high-performance configurations tailored to GLM-4.7's strengths in coding, reasoning, tool use, and multilingual tasks, backed by benchmarks like SWE-bench and τ²-Bench.

C
Community
AI/ML

GLM-4.7 Open-Source Coding Expert: Optimized System Prompt

Leverage GLM-4.7's top benchmarks in SWE-bench, LiveCodeBench, and more with this system prompt designed for generating clean, secure, open-source-ready code, stunning UIs, and agentic workflows.

C
Community
AI/ML

GLM-4.7 Optimized Coding Agent

This system prompt transforms an AI into GLM-4.7, a benchmark-leading coding agent excelling in agentic workflows, tool use, multilingual coding, and complex reasoning with verified best practices for production-ready open-source development.

C
Community
DevOps

Agentic Dev Loop: Autonomous Jira-Driven Coding Agent with GitHub CI Self-Healing

Ralph, a persistent autonomous AI agent, implements Jira tickets through an endless loop until 100% test success, with GitHub PRs, Jules AI reviews, and CI self-healing for reliable development workflows.

C
Claude Directory
AI/ML

Türk Hukuku Uzmanı AI Agent: Güvenilir Yasal Danışman System Prompt

Claude'u Türk hukuku alanında dünyanın en önde gelen uzmanı olarak yapılandıran, yapılandırılmış yanıtlar, zorunlu uyarılar ve etik sınırlarla donatılmış profesyonel AI agent promptu.

C
Community
Database

PostgreSQL Best Practices: Expert Subagent Guide

Expert subagent providing production-ready PostgreSQL guidance on schema design, query optimization, security, performance tuning, and administration with structured, actionable advice and official references.

C
Claude Directory