From harness-claude
Guides Nuxt 3 auto-imports for composables, components, and utilities, enabling zero import statements. Covers directories, config, disabling, naming, and troubleshooting.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Use composables, components, and utilities in Nuxt without writing any import statements
Guides Vue 3 apps with Composition API, Nuxt 3 auto-imports, Pinia state management, composables, reactivity, and single-file components.
Guides Nuxt 3 full-stack Vue development covering directory structure, config, CLI, routing, data fetching with useFetch, modules, composables, server routes, rendering modes, and deployment.
Share bugs, ideas, or general feedback.
Use composables, components, and utilities in Nuxt without writing any import statements
ref, computed, useState, useFetch, or custom composables.vue filescomposables/ — any function exported from a file in this directory is auto-imported by name. Use named exports for tree-shaking.components/ — components are auto-imported using their file path as the component name (e.g., components/base/Button.vue becomes <BaseButton />).utils/ — exported functions are auto-imported globally.ref, computed, watch, reactive, etc.) and Nuxt composables (useFetch, useRoute, useState, etc.) are always auto-imported — never import them manually.imports.dirs in nuxt.config.ts:// nuxt.config.ts
export default defineNuxtConfig({
imports: {
dirs: ['stores', 'services'],
},
});
imports.autoImport: false. To disable per-file, add // @ts-nocheck or restructure to use explicit imports.#imports for explicit imports in edge cases (e.g., Vitest tests that run outside Nuxt context):import { ref, computed } from '#imports';
.nuxt/types/imports.d.ts — regenerate with nuxt prepare when stale.Nuxt's auto-import system is powered by unplugin-auto-import and unplugin-vue-components. At build time, Nuxt scans the configured directories and generates TypeScript declaration files in .nuxt/ that declare each composable and component as a global. The result: zero import statements in application code while retaining full type safety.
Component naming convention:
The component name is derived from its path relative to components/. Nested directories are flattened using PascalCase concatenation:
components/
ui/
Card.vue → <UiCard />
button/
Primary.vue → <UiButtonPrimary />
base/
Input.vue → <BaseInput />
Lazy-loading components:
Prefix with Lazy to defer loading until the component is mounted:
<LazyHeavyChart v-if="showChart" />
Explicit disabling for testing:
Vitest runs outside Nuxt's build pipeline, so auto-imports are unavailable by default. Use @nuxt/test-utils or import from #imports:
// In test files
import { mountSuspended } from '@nuxt/test-utils/runtime';
When NOT to use auto-imports:
server/ — server routes use a separate auto-import layer with different ruleshttps://nuxt.com/docs/guide/concepts/auto-imports