Index of every page on this site: llms.txt
All skills
onmax avatar

/nuxt-modules

@2e74504 official
by Maxonmax/nuxt-skills722 stars
38
Run it yourself

Use when creating Nuxt modules: (1) Published npm modules (@nuxtjs/, nuxt-), (2) Local project modules (modules/ directory), (3) Runtime extensions (components, composables, plugins), (4) Server extensions (API routes, middleware), (5) Releasing/publishing modules to npm, (6) Setting up CI/CD workflows for modules. Provides defineNuxtModule patterns, Kit utilities, hooks, E2E testing, and release automation.

Use this Skill: https://skilld.dev/gh/onmax/nuxt-skills/nuxt-modules

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesci-workflows.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

CI Workflow Templates

Copy-paste templates for GitHub Actions.

Contents


ci.yml

Runs lint, typecheck, and tests on every push/PR/tag.

name: ci

on:
  push:
    branches: [main]
    tags: ['v*']
  pull_request:
    branches: [main]

jobs:
  ci:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: pnpm

      - run: pnpm install
      - run: pnpm dev:prepare
      - run: pnpm lint
      - run: pnpm typecheck
      - run: pnpm test

pkg.yml

Publishes preview packages for every PR via pkg-pr-new.

name: pkg.new

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  pkg:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: pnpm

      - run: pnpm install
      - run: pnpm dev:prepare
      - run: pnpm prepack
      - run: pnpm dlx pkg-pr-new publish

release.yml

Triggered by tag push. Waits for CI, then publishes to npm via OIDC + creates GitHub release.

name: release

permissions:
  id-token: write
  contents: write
  actions: read

on:
  push:
    tags:
      - 'v*'

jobs:
  wait-for-ci:
    runs-on: ubuntu-latest
    steps:
      - name: Wait for CI to complete
        uses: lewagon/wait-on-check-action@v1.3.4
        with:
          ref: ${{ github.sha }}
          check-name: ci
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          wait-interval: 10

  release:
    needs: wait-for-ci
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: pnpm/action-setup@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 24
          cache: pnpm
          registry-url: 'https://registry.npmjs.org'

      - run: pnpm install
      - run: pnpm dev:prepare
      - run: pnpm prepack

      - name: GitHub Release
        run: pnpm dlx changelogithub
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

      - name: Publish to npm
        run: npm publish --provenance --access public

npm Trusted Publishing Setup (OIDC)

Preferred method - No NPM_TOKEN secret needed. Uses OIDC for secure, tokenless authentication.

Requirements

  1. Node.js 24+ (npm 11.5.1+ required for OIDC - Node 22 has npm 10.x which fails)
  2. Workflow permissions: id-token: write
  3. Publish command: must include --provenance flag
  4. package.json: must have repository field for provenance verification
  5. npm 2FA setting: "Require 2FA or granular access token" (first option, allows tokens)

package.json Requirements

Each package must have a repository field or provenance verification fails:

{
  "name": "my-package",
  "repository": { "type": "git", "url": "git+https://github.com/org/repo.git" }
}

Setup Steps

  1. Open package settings: https://www.npmjs.com/package/<PACKAGE_NAME>/access
  2. Scroll to "Publishing access" section
  3. Click "Add GitHub Actions" under Trusted Publishers
  4. Fill in the form:
    • Owner: <github-org-or-username>
    • Repository: <repo-name>
    • Workflow file: release.yml
    • Environment: (leave empty)
  5. Click "Add"

Repeat for each package in your monorepo.

Troubleshooting

Error Cause Fix
"Access token expired or revoked" E404 npm version too old Use Node.js 24 (npm 11.5.1+)
ENEEDAUTH Missing registry-url Add registry-url: 'https://registry.npmjs.org' to setup-node
"repository.url is empty" E422 Missing repository field Add repository to package.json
"npm/xyz not configured as trusted publisher" Mismatch in config Check owner, repo, workflow filename match exactly

Verify Setup

The workflow uses OIDC when:

  • id-token: write permission is set
  • --provenance flag is used
  • No NODE_AUTH_TOKEN env var is set

npm automatically detects GitHub Actions and authenticates via OIDC.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts10d5 checks · Risk SAFE
  • Gen Agent Trust Hub10d

    This skill is a safe and high-quality guide for Nuxt module development. It correctly implements security best practices, such as recommending OIDC for CI/CD workflows and providing safe patterns for template generation.

  • Socket10d

    No alerts

  • Snyk10d

    Risk: LOW · No issues

  • Runlayer8mo

    4 files scanned · No issues

  • ZeroLeaks6mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 2e74504. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 2 weeks ago

README badge

README badge for onmax/nuxt-skills/nuxt-modules

Instructs Claude on building Nuxt modules using defineNuxtModule, Kit utilities, and hooks to extend Nuxt with components, composables, plugins, server routes, and middleware. Covers published npm modules, local project modules, E2E testing patterns, and release automation workflows.

Generated from the current SKILL.md.

Does this skill cover local modules in the modules/ directory?
Yes. The skill covers published npm modules, local project modules in the modules/ directory, and inline modules defined in nuxt.config.ts.
What testing approach does this skill teach?
The skill provides E2E testing patterns and best practices via the testing-and-publishing reference, though you load it only when needed for your task.
Does this include CI/CD setup?
Yes. The skill includes copy-paste CI/CD workflow templates in the ci-workflows reference for automating module testing and release.
Can I use this skill to publish a module to npm?
Yes. The testing-and-publishing reference covers releasing and publishing modules to npm registries with @nuxtjs/ or nuxt- naming conventions.
Does this cover runtime extensions like components and composables?
Yes. The skill covers injecting components, composables, plugins, and server extensions (API routes, middleware) into user applications via the runtime/ directory.

Generated from the current SKILL.md. These answers refresh after source changes.