NU

nuxthub-migration

Assists with migrating NuxtHub projects to self-hosted Cloudflare infrastructure.

Install

mkdir -p .claude/skills/nuxthub-migration && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/348" && unzip -o skill.zip -d .claude/skills/nuxthub-migration && rm skill.zip

Installs to .claude/skills/nuxthub-migration

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use when migrating NuxtHub projects or when user mentions NuxtHub Admin sunset, GitHub Actions deployment removal, self-hosting NuxtHub, or upgrading to v0.10/nightly. Covers v0.9.X self-hosting (stable) and v0.10/nightly multi-cloud.
234 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Facilitates migration from NuxtHub to self-hosted Cloudflare Workers
  • Cleans up deprecated CI/CD workflow files and secrets
  • Lists and reconfigures existing D1/KV/R2 infrastructure
  • Validates environment variables for v0.9.X and nightly versions

How it works

Checks the file system for legacy NuxtHub CI artifacts and provides the specific Wrangler commands to detach and reconnect Cloudflare resources.

Inputs & outputs

You give it
Project directory path and target migration version
You get back
Cleanup instructions and wrangler configuration updates

When to use nuxthub-migration

  • Migrating from NuxtHub
  • Self-hosting NuxtHub projects
  • Configuring Cloudflare workers
  • Removing NuxtHub GitHub Actions

About this skill

NuxtHub Migration

When to Use

Activate this skill when:

  • User mentions NuxtHub Admin deprecation or sunset (Dec 31, 2025)
  • Project uses .github/workflows/nuxthub.yml or NuxtHub GitHub Action
  • User wants to self-host NuxtHub on Cloudflare Workers
  • User asks about migrating to v0.10 or nightly version
  • Project has NUXT_HUB_PROJECT_KEY or NUXT_HUB_PROJECT_DEPLOY_TOKEN env vars

Two-phase migration. Phase 1 is stable and recommended. Phase 2 is multi-cloud.

Phase 1: Self-Hosting (v0.9.X) - RECOMMENDED

Migrate from NuxtHub Admin / GitHub Actions to self-hosted Cloudflare Workers. No code changes required.

1.1 Remove GitHub Action Deployment

Delete .github/workflows/nuxthub.yml or any NuxtHub-specific GitHub Action. Workers CI (step 1.4) replaces this.

Remove deprecated env vars from CI/CD and .env:

  • NUXT_HUB_PROJECT_KEY
  • NUXT_HUB_PROJECT_DEPLOY_TOKEN

Also remove any GitHub Actions secrets related to NuxtHub deployment.

Check and clean up Cloudflare Worker secrets:

npx wrangler secret list --name <worker-name>
npx wrangler secret delete NUXT_HUB_PROJECT_DEPLOY_TOKEN --name <worker-name>

1.2 Get or Create Cloudflare Resources

NuxtHub Admin already created resources in your Cloudflare account. Reuse them to preserve existing data.

List existing resources:

npx wrangler d1 list              # Find existing D1 databases
npx wrangler kv namespace list    # Find existing KV namespaces
npx wrangler r2 bucket list       # Find existing R2 buckets

Look for resources named after your project. Use their IDs in wrangler.jsonc.

Only create new resources if none exist:

# D1 Database (if hub.database: true)
npx wrangler d1 create my-app-db

# KV Namespace (if hub.kv: true)
npx wrangler kv namespace create KV

# KV Namespace for cache (if hub.cache: true)
npx wrangler kv namespace create CACHE

# R2 Bucket (if hub.blob: true)
npx wrangler r2 bucket create my-app-bucket

1.3 Create wrangler.jsonc

Create wrangler.jsonc in project root. See references/wrangler-templates.md for full examples.

Minimal example with database:

{
  "$schema": "node_modules/wrangler/config-schema.json",
  "name": "my-app",
  "main": "dist/server/index.mjs",
  "assets": { "directory": "dist/public" },
  "compatibility_date": "2025-12-01",
  "compatibility_flags": ["nodejs_compat"],
  "d1_databases": [{ "binding": "DB", "database_name": "my-app-db", "database_id": "<from-wrangler-output>" }]
}

Note: Nuxt cloudflare-module preset outputs to dist/, not .output/.

Required binding names:

FeatureBindingType
DatabaseDBD1
KVKVKV Namespace
CacheCACHEKV Namespace
BlobBLOBR2 Bucket

1.4 Set Up Workers Builds CI/CD

Ensure nuxt.config.ts uses the cloudflare_module preset:

nitro: { preset: 'cloudflare_module' }

In Cloudflare Dashboard:

  1. Workers & Pages → Create → Import from Git
  2. Connect GitHub/GitLab repository
  3. Configure build settings (both fields required):
    • Build command: pnpm build (or npm run build)
    • Deploy command: npx wrangler deploy
  4. Add environment variables (e.g., secrets, API keys)

Common mistake: Only setting deploy command. Build must run first to generate .output/.

1.5 Configure Environment Variables (Optional)

For advanced features (blob presigned URLs, cache DevTools, AI):

NUXT_HUB_CLOUDFLARE_ACCOUNT_ID=<account-id>
NUXT_HUB_CLOUDFLARE_API_TOKEN=<token-with-appropriate-permissions>
# Feature-specific (as needed):
NUXT_HUB_CLOUDFLARE_BUCKET_ID=<bucket-id>
NUXT_HUB_CLOUDFLARE_CACHE_NAMESPACE_ID=<namespace-id>

1.6 Test Remote Development

npx nuxt dev --remote

Phase 1 Checklist

  • Delete .github/workflows/nuxthub.yml
  • Remove NUXT_HUB_PROJECT_KEY and NUXT_HUB_PROJECT_DEPLOY_TOKEN env vars
  • Clean up old Worker secrets (wrangler secret list/delete)
  • Get existing or create new Cloudflare resources (D1, KV, R2 as needed)
  • Create wrangler.jsonc with bindings
  • Set nitro.preset: 'cloudflare_module' in nuxt.config.ts
  • Connect repo to Cloudflare Workers Builds
  • Test with npx nuxt dev --remote

No code changes required. Keep hub.database: true, server/database/, hubDatabase(), and @nuxthub/core.


Phase 2: v0.10/Nightly - MULTI-CLOUD

Multi-cloud support (Cloudflare, Vercel, Deno, Netlify). Breaking changes from v0.9.X.

2.1 Update Package

pnpm remove @nuxthub/core
pnpm add @nuxthub/core-nightly

2.2 Update nuxt.config.ts

Before (v0.9.X):

hub: { database: true, kv: true, blob: true, cache: true }

After (v0.10):

hub: { db: 'sqlite', kv: true, blob: true, cache: true }

Key change: database: truedb: '<dialect>' (sqlite | postgresql | mysql)

2.3 Rename Database Directory

mv server/database server/db

Update imports: ~/server/database/~/server/db/

Migrations generated via npx nuxt db generate go to server/db/migrations/{dialect}/.

2.4 Migrate Database API (hubDatabase → Drizzle)

Before:

const db = hubDatabase()
const users = await db.prepare('SELECT * FROM users').all()

After:

import { db, schema } from 'hub:db'
// Note: db and schema are auto-imported on server-side
const users = await db.select().from(schema.users)

2.5 Migrate KV API (hubKV → kv)

Before:

import { hubKV } from '#hub/server'
await hubKV().set('vue', { year: 2014 })
await hubKV().get('vue')
await hubKV().has('vue')
await hubKV().del('vue')
await hubKV().keys('vue:')
await hubKV().clear('vue:')

After:

import { kv } from 'hub:kv'
// Note: kv is auto-imported on server-side
await kv.set('vue', { year: 2014 })
await kv.get('vue')
await kv.has('vue')
await kv.del('vue')
await kv.keys('vue:')
await kv.clear('vue:')

Key change: hubKV() function call → kv direct object. Same methods, different access pattern.

2.6 Migrate Blob API (hubBlob → blob)

Before:

const blob = hubBlob()
await blob.put('file.txt', body, { contentType: 'text/plain' })
await blob.get('file.txt')
await blob.list({ prefix: 'uploads/' })
await blob.del('file.txt')
await blob.serve(event, 'file.txt')

After:

import { blob } from 'hub:blob'
// Note: blob is auto-imported on server-side
await blob.put('file.txt', body, { contentType: 'text/plain' })
await blob.get('file.txt')
await blob.list({ prefix: 'uploads/' })
await blob.del('file.txt')
await blob.serve(event, 'file.txt')

Key change: hubBlob() function call → blob direct object. Same methods, different access pattern.

2.7 New Import Pattern (Summary)

v0.10 uses virtual module imports. All are auto-imported on server-side:

import { db, schema } from 'hub:db'   // Database
import { kv } from 'hub:kv'           // KV Storage
import { blob } from 'hub:blob'       // Blob Storage

2.8 CLI Commands

npx nuxt db generate              # Generate migrations from schema
npx nuxt db migrate               # Apply migrations
npx nuxt db mark-as-migrated [NAME]  # Mark migration as applied without running
npx nuxt db drop <TABLE>          # Drop a table
npx nuxt db sql [QUERY]           # Execute SQL query
npx nuxt db sql < dump.sql        # Execute SQL from file

# All commands support:
--cwd <dir>       # Run in different directory
--dotenv <file>   # Use different .env file
-v, --verbose     # Verbose output

2.9 Provider-Specific Setup (Non-Cloudflare)

Database Providers

PostgreSQL:

pnpm add drizzle-orm drizzle-kit postgres @electric-sql/pglite
  • Uses PGlite locally if no env vars set
  • Uses postgres-js if DATABASE_URL, POSTGRES_URL, or POSTGRESQL_URL set

MySQL:

pnpm add drizzle-orm drizzle-kit mysql2
  • Requires DATABASE_URL or MYSQL_URL env var

SQLite (Turso):

pnpm add drizzle-orm drizzle-kit @libsql/client
  • Uses libsql locally at .data/db/sqlite.db
  • Uses Turso if TURSO_DATABASE_URL and TURSO_AUTH_TOKEN set

KV Providers

ProviderPackageEnv Vars
Upstash@upstash/redisUPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKEN
RedisioredisREDIS_URL
Cloudflare KV-KV binding in wrangler.jsonc
Deno KV-Auto on Deno Deploy
Vercel-KV_REST_API_URL, KV_REST_API_TOKEN

Blob Providers

ProviderPackageConfig
Vercel Blob@vercel/blobDashboard setup
Cloudflare R2-BLOB binding in wrangler.jsonc
S3aws4fetchS3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_BUCKET, S3_REGION
Netlify Blobs@netlify/blobsNETLIFY_BLOB_STORE_NAME

2.10 Database Hooks (For Nuxt Modules)

// Extend schema
nuxt.hook('hub:db:schema:extend', async ({ dialect, paths }) => {
  paths.push(await resolvePath(`./schema/pages.${dialect}`))
})

// Add migration directories
nuxt.hook('hub:db:migrations:dirs', (dirs) => {
  dirs.push(resolve('./db-migrations'))
})

// Post-migration queries (must be idempotent)
nuxt.hook('hub:db:queries:paths', (paths, dialect) => {
  paths.push(resolve(`./db-queries/seed.${dialect}.sql`))
})

2.11 Schema Files

Schema can be in multiple locations:

  • server/db/schema.ts
  • server/db/schema.{dialect}.ts
  • server/db/schema/*.ts
  • server/db/schema/*.{dialect}.ts

Generated schema at .nuxt/hub/db/schema.mjs.

Deprecated Features (v0.10)

Cloudflare-specific features removed:

  • hubAI() - Use AI SDK with Workers AI Provider
  • hubBrowser() - Puppeteer
  • hubVectorize() - Vectorize
  • hubAutoRAG() - AutoRAG

Phase 2 Checklist

  • Complete Phase 1 first
  • Replace @nuxthub/core with @nuxthub/core-nightly
  • Change hub.database: true to hub.db: 'sqlite' (or other dialect)
  • Rename `serv

Content truncated.

When not to use it

  • Projects not originally hosted on the NuxtHub platform
  • When performing a standard upgrade that doesn't involve migration

Prerequisites

Wrangler cliCloudflare account access

Limitations

  • Requires manual intervention for resource verification
  • May require re-deployment to Cloudflare infrastructure

How it compares

It provides a sequenced, platform-specific cleanup manual rather than a general-purpose migration script.

Compared to similar skills

nuxthub-migration side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
nuxthub-migration (this skill)58moReviewIntermediate
turborepo612moReviewIntermediate
turborepo-caching55moReviewIntermediate
workflow42moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

motion

onmax

Use when adding animations with Motion Vue (motion-v) - provides motion component API, gesture animations, scroll-linked effects, layout transitions, and composables for Vue 3/Nuxt

1044

vueuse

onmax

Use when working with VueUse composables - provides reactive utilities for state, browser APIs, sensors, network, animations. Check VueUse before writing custom composables - most patterns already implemented.

417

document-writer

onmax

Use when writing blog posts or documentation markdown files - provides writing style guide (active voice, present tense), content structure patterns, and MDC component usage. Overrides brevity rules for proper grammar. Use nuxt-content for MDC syntax, nuxt-ui for component props.

325

nuxt-content

onmax

Use when working with Nuxt Content v3 - provides collections (local/remote/API sources), queryCollection API, MDC rendering, database configuration, NuxtStudio integration, hooks, i18n patterns, and LLMs integration

327

nuxt-modules

onmax

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.

318

reka-ui

onmax

Use when building with Reka UI (headless Vue components) - provides component API, accessibility patterns, composition (asChild), controlled/uncontrolled state, virtualization, and styling integration. Formerly Radix Vue.

38

You might also like

turborepo

vercel

Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries. Use when user: configures tasks/workflows/pipelines, creates packages, sets up monorepo, shares code between apps, runs changed/affected packages, debugs cache, or has apps/packages directories.

61191

turborepo-caching

wshobson

Configure Turborepo for efficient monorepo builds with local and remote caching. Use when setting up Turborepo, optimizing build pipelines, or implementing distributed caching.

535

workflow

vercel

Creates durable, resumable workflows using Vercel's Workflow DevKit. Use when building workflows that need to survive restarts, pause for external events, retry on failure, or coordinate multi-step operations over time. Triggers on mentions of "workflow", "durable functions", "resumable", "workflow devkit", or step-based orchestration.

431

firebase-vertex-ai

jeremylongshore

Execute firebase platform expert with Vertex AI Gemini integration for Authentication, Firestore, Storage, Functions, Hosting, and AI-powered features. Use when asked to "setup firebase", "deploy to firebase", or "integrate vertex ai with firebase". Trigger with relevant phrases based on skill purpose.

14

monorepo-structure

dadbodgeoff

Set up a Turborepo + pnpm monorepo for sharing code between frontend, backend, and workers. One repo, multiple packages, shared types, parallel builds.

14

genkit-production-expert

jeremylongshore

Build production Firebase Genkit applications including RAG systems, multi-step flows, and tool calling for Node.js/Python/Go. Deploy to Firebase Functions or Cloud Run with AI monitoring. Use when asked to "create genkit flow" or "implement RAG". Trigger with relevant phrases based on skill purpose.

01

Search skills

Search the agent skills registry