nuxt-modules

Guide Nuxt module development with defineNuxtModule, Kit utilities, and lifecycle hooks.

Updated Jun 8, 2025
One-click install
npx skills add https://github.com/noartem/kawa --skill nuxt-modules-noartem
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nuxt-modules
Source: https://github.com/noartem/kawa/tree/main/ui/.ai/skills/nuxt-modules
Command: npx skills add https://github.com/noartem/kawa --skill nuxt-modules-noartem

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Nuxt module development can be complex due to diverse module types, patterns, and tooling; this skill provides a structured, repeatable approach to building and releasing modules that extend Nuxt.

Core Features & Use Cases

  • Module anatomy: covers published npm modules, local modules, and inline/runtime extensions, with guidance on defineNuxtModule, Kit utilities, and hooks.
  • Runtime & server integration: explains how to expose components, composables, plugins, and API routes within modules, plus server extensions and middleware.
  • Testing & publishing workflows: offers best practices for E2E tests, CI/CD pipelines, and publishing modules to npm.

Quick Start

Create a minimal Nuxt module using defineNuxtModule, wire it into a sample Nuxt app, and observe the module's lifecycle hooks in action.

Frequently Asked Questions about nuxt-modules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Nuxt module using defineNuxtModule?

Defining a Nuxt module involves using the defineNuxtModule pattern to establish frontmatter metadata and wire up lifecycle hooks. This approach leverages Kit utilities to ensure robust framework extension, applicable to published npm modules, local modules, or inline integrations.

What are the different types of Nuxt modules I can build?

You can build published npm modules, local project modules, or inline runtime integrations. Each type uses the same defineNuxtModule patterns and Kit utilities but differs in how it is packaged, distributed, and wired into the host Nuxt application.

How do I expose server routes and runtime components in a Nuxt module?

Exposing server routes and runtime components in a Nuxt module requires utilizing Kit utilities and lifecycle hooks to register plugins and API endpoints. This integration ensures your module can seamlessly inject server extensions and middleware into the host application.

What is the best way to test and publish a Nuxt module?

The best way to test and publish a Nuxt module involves implementing end-to-end tests and configuring CI/CD pipelines. Following these testing and publishing workflows ensures your module is reliable before releasing it to the npm registry.

Can I use Nuxt Kit utilities for local module development without publishing to npm?

Yes, Nuxt Kit utilities work perfectly for local module development without publishing to npm. The defineNuxtModule pattern and lifecycle hooks apply equally to local modules and inline integrations, allowing you to extend your framework locally before deciding to publish.