Install this skill
npx skills add onmax/nuxt-skillsWorks across Claude Code, Cursor, Codex, Copilot & Antigravity
Nuxt modules allow developers to extend the core framework functionality by injecting custom logic, components, or configuration into a project. By using the 'defineNuxtModule' function and the official Nuxt Kit, these modules can automate setup, modify internal build steps, or add global runtime utilities. They function at different integration levels: inline within a configuration file for quick patches, inside a local directory for project-specific needs, or as external packages shared across multiple applications. Unlike standard Vue plugins, modules operate at the build-time stage, granting control over the Nuxt build process itself, such as adding auto-imports, modifying Vite configurations, or registering server middleware. This capability is essential for creating reusable infrastructure that integrates deeply with the Nuxt ecosystem while maintaining clean, modular project boundaries.
When to Use This Skill
- β’Creating reusable UI libraries that require global configuration or styling
- β’Abstracting complex third-party API integrations into a plug-and-play module
- β’Standardizing security headers or middleware across a company's fleet of sites
- β’Automating the setup of database drivers or SDKs during application startup
How to Invoke This Skill
Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:
- βCreate a new Nuxt module using the starter template
- βHow do I use Nuxt Kit to modify the project build
- βInitialize a local module in my Nuxt project
- βAdd a custom server hook to my Nuxt module
- βHow to register auto-imports from a custom Nuxt module
Pro Tips
- π‘Always leverage `defineNuxtModule` and Nuxt Kit utilities for consistent API and future-proof compatibility.
- π‘Implement comprehensive E2E tests for your modules to ensure stability across different Nuxt versions and configurations, especially when extending core features.
- π‘Consider integrating with Nuxt DevTools to provide better debugging capabilities and enhance the developer experience for users of your module.
What this skill does
- β’Injecting custom server middleware or API routes into Nuxt applications
- β’Registering global components and composables automatically for auto-importing
- β’Hooking into the Nuxt build lifecycle to modify Vite or Webpack configurations
- β’Extending the user's nuxt.config object programmatically
- β’Adding custom Nitro server plugins for backend application logic
When not to use it
- βWhen a standard Vue plugin or simple utility function suffices without build-time access
- βFor simple style modifications that can be handled via CSS or global UI components
Example workflow
- Initialize the module structure using the nuxi module starter template
- Define module functionality within src/module.ts using defineNuxtModule
- Implement runtime logic within the src/runtime directory
- Test the module implementation using the built-in playground environment
- Execute the module test suite to verify end-to-end integration
Prerequisites
- βNode.js environment
- βFamiliarity with Nuxt framework architecture
- βUnderstanding of the Nuxt Kit API
Pitfalls & limitations
- !Accidentally creating excessive build-time overhead by performing heavy logic in the module entry point
- !Conflicts between multiple modules attempting to mutate the same configuration properties
- !Difficulty debugging modules since they run during the build process rather than the client browser
FAQ
How it compares
While manual configuration involves repetitive edits to nuxt.config, building a module provides a structured, testable, and automated way to manage extensions at scale.
π Full skill instructions β original source: onmax/nuxt-skills
Guide for creating Nuxt modules that extend framework functionality.
**Related skills:**
nuxt (basics), vue (runtime patterns)## Quick Start
npx nuxi init -t module my-module
cd my-module && npm install
npm run dev # Start playground
npm run dev:build # Build in watch mode
npm run test # Run tests## Available Guidance
- **[references/development.md](references/development.md)** - Module anatomy, defineNuxtModule, Kit utilities, hooks
- **[references/testing-and-publishing.md](references/testing-and-publishing.md)** - E2E testing, best practices, releasing, publishing
- **[references/ci-workflows.md](references/ci-workflows.md)** - Copy-paste CI/CD workflow templates
**Load based on context:**
- Building module features? β [references/development.md](references/development.md)
- Testing or publishing? β [references/testing-and-publishing.md](references/testing-and-publishing.md)
- CI workflow templates? β [references/ci-workflows.md](references/ci-workflows.md)
## Module Types
| Type | Location | Use Case |
| --------- | ---------------- | -------------------------------- |
| Published | npm package |
@nuxtjs/, nuxt- distribution || Local |
modules/ dir | Project-specific extensions || Inline |
nuxt.config.ts | Simple one-off hooks |## Project Structure
my-module/
βββ src/
β βββ module.ts # Entry point
β βββ runtime/ # Injected into user's app
β βββ components/
β βββ composables/
β βββ plugins/
β βββ server/
βββ playground/ # Dev testing
βββ test/fixtures/ # E2E tests## Resources
- [Module Guide](https://nuxt.com/docs/guide/going-further/modules)
- [Nuxt Kit](https://nuxt.com/docs/api/kit)
- [Module Starter](https://github.com/nuxt/starter/tree/module)
How to Use This Skill Unit
Option A: Project-Specific (Recommended)
- Click "Download" above
- In your project, create the directory:
.agent/skills/nuxt-modules/ - Save the file as
SKILL.md - The agent will automatically discover the skill based on its description.
Option B: Global Installation (All Agents)
Save the file to these locations to make it available across all projects:
- Claude Code:
~/.claude/skills/onmax/nuxt-skills/nuxt-modules/SKILL.md - Cursor:
~/.cursor/skills/onmax/nuxt-skills/nuxt-modules/SKILL.md - Antigravity:
~/.gemini/antigravity/skills/onmax/nuxt-skills/nuxt-modules/SKILL.md
π Install with CLI:npx skills add onmax/nuxt-skills