[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79MQ5ZA58Q0JB3Y02BQG1NF":3,"skill-same:01M79MQ5ZA58Q0JB3Y02BQG1NF":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M79MQ5ZA58Q0JB3Y02BQG1NF","nuxthub",null,"Use when building NuxtHub v0.10.6 applications - provides database (Drizzle ORM with sqlite\u002Fpostgresql\u002Fmysql), KV storage, blob storage, and cache APIs. Covers configuration, schema definition, migrations, multi-cloud deployment (Cloudflare, Vercel), and the new hub:db, hub:kv, hub:blob virtual module imports.","ruilopesm\u002Fethglobal","ruilopesm","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F76881129?v=4","01M79MHW406AQA3HHHTGSQ525R","Rui Lopes","01M79MHW4MVFE0EXHQVF3P4N2M",0,"MIT","https:\u002F\u002Fgithub.com\u002Fruilopesm\u002Fethglobal\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fnuxthub\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: nuxthub\ndescription: Use when building NuxtHub v0.10.6 applications - provides database (Drizzle ORM with sqlite\u002Fpostgresql\u002Fmysql), KV storage, blob storage, and cache APIs. Covers configuration, schema definition, migrations, multi-cloud deployment (Cloudflare, Vercel), and the new hub:db, hub:kv, hub:blob virtual module imports.\nlicense: MIT\n---\n\n# NuxtHub v0.10.6\n\nFull-stack Nuxt framework with database, KV, blob, and cache. Multi-cloud support (Cloudflare, Vercel, Deno, Netlify).\n\n**For Nuxt server patterns:** use `nuxt` skill (server.md)\n**For content with database:** use `nuxt-content` skill\n\n## Loading Files\n\n**Consider loading these reference files based on your task:**\n\n- [ ] [references\u002Fwrangler-templates.md](references\u002Fwrangler-templates.md) - if manually configuring wrangler.jsonc for Cloudflare deployment\n- [ ] [references\u002Fproviders.md](references\u002Fproviders.md) - if deploying to Vercel, Netlify, Deno, AWS, or configuring external database\u002Fstorage providers\n\n**DO NOT load all files at once.** Load only what's relevant to your current task.\n\n## Installation\n\n```bash\nnpx nuxi module add hub\n```\n\n## Configuration\n\n```ts\n\u002F\u002F nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: ['@nuxthub\u002Fcore'],\n  hub: {\n    db: 'sqlite', \u002F\u002F 'sqlite' | 'postgresql' | 'mysql'\n    kv: true,\n    blob: true,\n    cache: true,\n    dir: '.data', \u002F\u002F local storage directory\n    remote: false \u002F\u002F use production bindings in dev (v0.10+)\n  }\n})\n```\n\n### Advanced Config\n\n```ts\nhub: {\n  db: {\n    dialect: 'postgresql',\n    driver: 'postgres-js', \u002F\u002F Optional: auto-detected\n    casing: 'snake_case',  \u002F\u002F camelCase JS -> snake_case DB (v0.10.3+)\n    migrationsDirs: ['server\u002Fdb\u002Fcustom-migrations\u002F'],\n    applyMigrationsDuringBuild: true, \u002F\u002F default\n    replica: { \u002F\u002F Read replica support (v0.10.6+)\n      connection: { connectionString: process.env.DATABASE_REPLICA_URL }\n    }\n  },\n  remote: true \u002F\u002F Use production Cloudflare bindings in dev (v0.10+)\n}\n```\n\n**remote mode:** When enabled, connects to production D1\u002FKV\u002FR2 during local development instead of local emulation. Useful for testing with production data.\n\n**Database replica (v0.10.6+):** Configure read replicas to distribute database load. Queries use replicas automatically while writes go to primary.\n\n## Database\n\nType-safe SQL via Drizzle ORM. `db` and `schema` are auto-imported on server-side.\n\n### Schema Definition\n\nPlace in `server\u002Fdb\u002Fschema.ts` or `server\u002Fdb\u002Fschema\u002F*.ts`:\n\n```ts\n\u002F\u002F server\u002Fdb\u002Fschema.ts (SQLite)\nimport { integer, sqliteTable, text } from 'drizzle-orm\u002Fsqlite-core'\n\nexport const users = sqliteTable('users', {\n  id: integer().primaryKey({ autoIncrement: true }),\n  name: text().notNull(),\n  email: text().notNull().unique(),\n  createdAt: integer({ mode: 'timestamp' }).notNull()\n})\n```\n\nPostgreSQL variant:\n\n```ts\nimport { pgTable, serial, text, timestamp } from 'drizzle-orm\u002Fpg-core'\n\nexport const users = pgTable('users', {\n  id: serial().primaryKey(),\n  name: text().notNull(),\n  email: text().notNull().unique(),\n  createdAt: timestamp().notNull().defaultNow()\n})\n```\n\n### Database API\n\n```ts\n\u002F\u002F db and schema are auto-imported on server-side\nimport { db, schema } from 'hub:db'\n\n\u002F\u002F Select\nconst users = await db.select().from(schema.users)\nconst user = await db.query.users.findFirst({ where: eq(schema.users.id, 1) })\n\n\u002F\u002F Insert\nconst [newUser] = await db.insert(schema.users).values({ name: 'John', email: 'john@example.com' }).returning()\n\n\u002F\u002F Update\nawait db.update(schema.users).set({ name: 'Jane' }).where(eq(schema.users.id, 1))\n\n\u002F\u002F Delete\nawait db.delete(schema.users).where(eq(schema.users.id, 1))\n```\n\n### Migrations\n\n```bash\nnpx nuxt db generate                  # Generate migrations from schema\nnpx nuxt db migrate                   # Apply pending migrations\nnpx nuxt db sql \"SELECT * FROM users\" # Execute raw SQL\nnpx nuxt db drop \u003CTABLE>              # Drop a specific table\nnpx nuxt db drop-all                  # Drop all tables (v0.10+)\nnpx nuxt db squash                    # Squash migrations into one (v0.10+)\nnpx nuxt db mark-as-migrated [NAME]   # Mark as migrated without running\n```\n\nMigrations auto-apply during `npx nuxi dev` and `npx nuxi build`. Tracked in `_hub_migrations` table.\n\n### Database Providers\n\n| Dialect    | Local                | Production                                                         |\n| ---------- | -------------------- | ------------------------------------------------------------------ |\n| sqlite     | `.data\u002Fdb\u002Fsqlite.db` | D1 (Cloudflare), Turso (`TURSO_DATABASE_URL`, `TURSO_AUTH_TOKEN`)  |\n| postgresql | PGlite               | postgres-js (`DATABASE_URL`), neon-http (v0.10.2+, `DATABASE_URL`) |\n| mysql      | -                    | mysql2 (`DATABASE_URL`, `MYSQL_URL`)                               |\n\n## KV Storage\n\nKey-value storage. `kv` is auto-imported on server-side.\n\n```ts\nimport { kv } from 'hub:kv'\n\nawait kv.set('key', { data: 'value' })\nawait kv.set('key', value, { ttl: 60 }) \u002F\u002F TTL in seconds\nconst value = await kv.get('key')\nconst exists = await kv.has('key')\nawait kv.del('key')\nconst keys = await kv.keys('prefix:')\nawait kv.clear('prefix:')\n```\n\nConstraints: max value 25 MiB, max key 512 bytes.\n\n### KV Providers\n\n| Provider      | Package          | Env Vars                                             |\n| ------------- | ---------------- | ---------------------------------------------------- |\n| Upstash       | `@upstash\u002Fredis` | `UPSTASH_REDIS_REST_URL`, `UPSTASH_REDIS_REST_TOKEN` |\n| Redis         | `ioredis`        | `REDIS_URL`                                          |\n| Cloudflare KV | -                | `KV` binding in wrangler.jsonc                       |\n| Deno KV       | -                | Auto on Deno Deploy                                  |\n| Vercel        | -                | `KV_REST_API_URL`, `KV_REST_API_TOKEN`               |\n\n## Blob Storage\n\nFile storage. `blob` is auto-imported on server-side.\n\n### Blob API\n\n```ts\nimport { blob } from 'hub:blob'\n\n\u002F\u002F Upload\nconst result = await blob.put('path\u002Ffile.txt', body, {\n  contentType: 'text\u002Fplain',\n  access: 'public', \u002F\u002F 'public' | 'private' (v0.10.2+)\n  addRandomSuffix: true,\n  prefix: 'uploads'\n})\n\u002F\u002F Returns: { pathname, contentType, size, httpEtag, uploadedAt }\n\n\u002F\u002F Download\nconst file = await blob.get('path\u002Ffile.txt') \u002F\u002F Returns Blob or null\n\n\u002F\u002F List\nconst { blobs, cursor, hasMore, folders } = await blob.list({ prefix: 'uploads\u002F', limit: 10, folded: true })\n\n\u002F\u002F Serve (with proper headers)\nreturn blob.serve(event, 'path\u002Ffile.txt')\n\n\u002F\u002F Delete\nawait blob.del('path\u002Ffile.txt')\nawait blob.del(['file1.txt', 'file2.txt']) \u002F\u002F Multiple\n\n\u002F\u002F Metadata only\nconst meta = await blob.head('path\u002Ffile.txt')\n```\n\n### Upload Helpers\n\n```ts\n\u002F\u002F Server: Validate + upload handler\nexport default eventHandler(async (event) => {\n  return blob.handleUpload(event, {\n    formKey: 'files',\n    multiple: true,\n    ensure: { maxSize: '10MB', types: ['image\u002Fpng', 'image\u002Fjpeg'] },\n    put: { addRandomSuffix: true, prefix: 'images' }\n  })\n})\n\n\u002F\u002F Validate before manual upload\nensureBlob(file, { maxSize: '10MB', types: ['image'] })\n\n\u002F\u002F Multipart upload for large files (>10MB)\nexport default eventHandler(async (event) => {\n  return blob.handleMultipartUpload(event) \u002F\u002F Route: \u002Fapi\u002Ffiles\u002Fmultipart\u002F[action]\u002F[...pathname]\n})\n```\n\n### Vue Composables\n\n```ts\n\u002F\u002F Simple upload\nconst upload = useUpload('\u002Fapi\u002Fupload')\nconst result = await upload(inputElement)\n\n\u002F\u002F Multipart with progress\nconst mpu = useMultipartUpload('\u002Fapi\u002Ffiles\u002Fmultipart')\nconst { completed, progress, abort } = mpu(file)\n```\n\n### Blob Providers\n\n| Provider      | Package        | Config                                                               |\n| ------------- | -------------- | -------------------------------------------------------------------- |\n| Cloudflare R2 | -              | `BLOB` binding in wrangler.jsonc                                     |\n| Vercel Blob   | `@vercel\u002Fblob` | `BLOB_READ_WRITE_TOKEN`                                              |\n| S3            | `aws4fetch`    | `S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`, `S3_BUCKET`, `S3_REGION` |\n\n## Cache\n\nResponse and function caching.\n\n### Route Handler Caching\n\n```ts\nexport default cachedEventHandler((event) => {\n  return { data: 'cached', date: new Date().toISOString() }\n}, {\n  maxAge: 60 * 60, \u002F\u002F 1 hour\n  getKey: event => event.path\n})\n```\n\n### Function Caching\n\n```ts\nexport const getStars = defineCachedFunction(\n  async (event: H3Event, repo: string) => {\n    const data = await $fetch(`https:\u002F\u002Fapi.github.com\u002Frepos\u002F${repo}`)\n    return data.stargazers_count\n  },\n  { maxAge: 3600, name: 'ghStars', getKey: (event, repo) => repo }\n)\n```\n\n### Cache Invalidation\n\n```ts\n\u002F\u002F Remove specific\nawait useStorage('cache').removeItem('nitro:functions:getStars:repo-name.json')\n\n\u002F\u002F Clear by prefix\nawait useStorage('cache').clear('nitro:handlers')\n```\n\nCache key pattern: `${group}:${name}:${getKey(...args)}.json` (defaults: group='nitro', name='handlers'|'functions'|'routes')\n\n## Deployment\n\n### Cloudflare\n\nNuxtHub auto-generates `wrangler.json` from your hub config - no manual wrangler.jsonc required:\n\n```ts\n\u002F\u002F nuxt.config.ts\nexport default defineNuxtConfig({\n  hub: {\n    db: {\n      dialect: 'sqlite',\n      driver: 'd1',\n      connection: { databaseId: '\u003Cdatabase-id>' }\n    },\n    kv: {\n      driver: 'cloudflare-kv-binding',\n      namespaceId: '\u003Ckv-namespace-id>'\n    },\n    cache: {\n      driver: 'cloudflare-kv-binding',\n      namespaceId: '\u003Ccache-namespace-id>'\n    },\n    blob: {\n      driver: 'cloudflare-r2',\n      bucketName: '\u003Cbucket-name>'\n    }\n  }\n})\n```\n\n**Observability (recommended):** Enable logging for production deployments:\n\n```jsonc\n\u002F\u002F wrangler.jsonc (optional)\n{\n  \"observability\": {\n    \"logs\": {\n      \"enabled\": true,\n      \"head_sampling_rate\": 1,\n      \"invocation_logs\": true,\n      \"persist\": true\n    }\n  }\n}\n```\n\nCreate resources via Cloudflare dashboard or CLI:\n\n```bash\nnpx wrangler d1 create my-db              # Get database-id\nnpx wrangler kv namespace create KV       # Get kv-namespace-id\nnpx wrangler kv namespace create CACHE    # Get cache-namespace-id\nnpx wrangler r2 bucket create my-bucket   # Get bucket-name\n```\n\nDeploy: Create [Cloudflare Workers project](https:\u002F\u002Fdash.cloudflare.com\u002F?to=\u002F:account\u002Fworkers-and-pages\u002Fcreate), link Git repo. Bindings auto-configured at build time.\n\n**Environments:** Use `CLOUDFLARE_ENV=preview` for preview deployments.\n\nSee [references\u002Fwrangler-templates.md](references\u002Fwrangler-templates.md) for manual wrangler.jsonc patterns and [references\u002Fproviders.md](references\u002Fproviders.md) for all provider configurations.\n\n### Other Providers\n\nSee [references\u002Fproviders.md](references\u002Fproviders.md) for detailed deployment patterns for:\n\n- **Vercel:** Postgres, Turso, Vercel Blob, Vercel KV\n- **Netlify:** External databases, S3, Upstash Redis\n- **Deno Deploy:** Deno KV\n- **AWS\u002FSelf-hosted:** S3, RDS, custom configs\n\n### D1 over HTTP\n\nQuery D1 from non-Cloudflare hosts:\n\n```ts\nhub: {\n  db: { dialect: 'sqlite', driver: 'd1-http' }\n}\n```\n\nRequires: `NUXT_HUB_CLOUDFLARE_ACCOUNT_ID`, `NUXT_HUB_CLOUDFLARE_API_TOKEN`, `NUXT_HUB_CLOUDFLARE_DATABASE_ID`\n\n## Build-time Hooks\n\n```ts\n\u002F\u002F Extend schema\nnuxt.hook('hub:db:schema:extend', async ({ dialect, paths }) => {\n  paths.push(await resolvePath(`.\u002Fschema\u002Fcustom.${dialect}`))\n})\n\n\u002F\u002F Add migration directories\nnuxt.hook('hub:db:migrations:dirs', (dirs) => {\n  dirs.push(resolve('.\u002Fdb-migrations'))\n})\n\n\u002F\u002F Post-migration queries (idempotent)\nnuxt.hook('hub:db:queries:paths', (paths, dialect) => {\n  paths.push(resolve(`.\u002Fseed.${dialect}.sql`))\n})\n```\n\n## Type Sharing\n\n```ts\n\u002F\u002F shared\u002Ftypes\u002Fdb.ts\nimport type { users } from '~\u002Fserver\u002Fdb\u002Fschema'\n\nexport type User = typeof users.$inferSelect\nexport type NewUser = typeof users.$inferInsert\n```\n\n## WebSocket \u002F Realtime\n\nEnable experimental WebSocket:\n\n```ts\n\u002F\u002F nuxt.config.ts\nnitro: { experimental: { websocket: true } }\n```\n\n```ts\n\u002F\u002F server\u002Froutes\u002Fws\u002Fchat.ts\nexport default defineWebSocketHandler({\n  open(peer) {\n    peer.subscribe('chat')\n    peer.publish('chat', 'User joined')\n  },\n  message(peer, message) {\n    peer.publish('chat', message.text())\n  },\n  close(peer) {\n    peer.unsubscribe('chat')\n  }\n})\n```\n\n## Deprecated (v0.10)\n\nRemoved Cloudflare-specific features:\n\n- `hubAI()` -> Use AI SDK with Workers AI Provider\n- `hubBrowser()` -> Puppeteer\n- `hubVectorize()` -> Vectorize\n- NuxtHub Admin -> Sunset Dec 31, 2025\n- `npx nuxthub deploy` -> Use wrangler deploy\n\n## Quick Reference\n\n| Feature  | Import                                | Access                             |\n| -------- | ------------------------------------- | ---------------------------------- |\n| Database | `import { db, schema } from 'hub:db'` | `db.select()`, `db.insert()`, etc. |\n| KV       | `import { kv } from 'hub:kv'`         | `kv.get()`, `kv.set()`, etc.       |\n| Blob     | `import { blob } from 'hub:blob'`     | `blob.put()`, `blob.get()`, etc.   |\n\nAll are auto-imported on server-side.\n\n## Resources\n\n- [Installation](https:\u002F\u002Fhub.nuxt.com\u002Fdocs\u002Fgetting-started\u002Finstallation)\n- [Migration from v0.9](https:\u002F\u002Fhub.nuxt.com\u002Fdocs\u002Fgetting-started\u002Fmigration)\n- [Database](https:\u002F\u002Fhub.nuxt.com\u002Fdocs\u002Fdatabase)\n- [Blob](https:\u002F\u002Fhub.nuxt.com\u002Fdocs\u002Fblob)\n- [KV](https:\u002F\u002Fhub.nuxt.com\u002Fdocs\u002Fkv)\n- [Cache](https:\u002F\u002Fhub.nuxt.com\u002Fdocs\u002Fcache)\n- [Deploy](https:\u002F\u002Fhub.nuxt.com\u002Fdocs\u002Fgetting-started\u002Fdeploy)\n","# NuxtHub v0.10.6\n\nFull-stack Nuxt framework with database, KV, blob, and cache. Multi-cloud support (Cloudflare, Vercel, Deno, Netlify).\n\n**For Nuxt server patterns:** use `nuxt` skill (server.md)\n**For content with database:** use `nuxt-content` skill\n\n## Loading Files\n\n**Consider loading these reference files based on your task:**\n\n- [ ] [references\u002Fwrangler-templates.md](references\u002Fwrangler-templates.md) - if manually configuring wrangler.jsonc for Cloudflare deployment\n- [ ] [references\u002Fproviders.md](references\u002Fproviders.md) - if deploying to Vercel, Netlify, Deno, AWS, or configuring external database\u002Fstorage providers\n\n**DO NOT load all files at once.** Load only what's relevant to your current task.\n\n## Installation\n\n```bash\nnpx nuxi module add hub\n```\n\n## Configuration\n\n```ts\n\u002F\u002F nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: ['@nuxthub\u002Fcore'],\n  hub: {\n    db: 'sqlite', \u002F\u002F 'sqlite' | 'postgresql' | 'mysql'\n    kv: true,\n    blob: true,\n    cache: true,\n    dir: '.data', \u002F\u002F local storage directory\n    remote: false \u002F\u002F use production bindings in dev (v0.10+)\n  }\n})\n```\n\n### Advanced Config\n\n```ts\nhub: {\n  db: {\n    dialect: 'postgresql',\n    driver: 'postgres-js', \u002F\u002F Optional: auto-detected\n    casing: 'snake_case',  \u002F\u002F camelCase JS -> snake_case DB (v0.10.3+)\n    migrationsDirs: ['server\u002Fdb\u002Fcustom-migrations\u002F'],\n    applyMigrationsDuringBuild: true, \u002F\u002F default\n    replica: { \u002F\u002F Read replica support (v0.10.6+)\n      connection: { connectionString: process.env.DATABASE_REPLICA_URL }\n    }\n  },\n  remote: true \u002F\u002F Use production Cloudflare bindings in dev (v0.10+)\n}\n```\n\n**remote mode:** When enabled, connects to production D1\u002FKV\u002FR2 during local development instead of local emulation. Useful for testing with production data.\n\n**Database replica (v0.10.6+):** Configure read replicas to distribute database load. Queries use replicas automatically while writes go to primary.\n\n## Database\n\nType-safe SQL via Drizzle ORM. `db` and `schema` are auto-imported on server-side.\n\n### Schema Definition\n\nPlace in `server\u002Fdb\u002Fschema.ts` or `server\u002Fdb\u002Fschema\u002F*.ts`:\n\n```ts\n\u002F\u002F server\u002Fdb\u002Fschema.ts (SQLite)\nimport { integer, sqliteTable, text } from 'drizzle-orm\u002Fsqlite-core'\n\nexport const users = sqliteTable('users', {\n  id: integer().primaryKey({ autoIncrement: true }),\n  name: text().notNull(),\n  email: text().notNull().unique(),\n  createdAt: integer({ mode: 'timestamp' }).notNull()\n})\n```\n\nPostgreSQL variant:\n\n```ts\nimport { pgTable, serial, text, timestamp } from 'drizzle-orm\u002Fpg-core'\n\nexport const users = pgTable('users', {\n  id: serial().primaryKey(),\n  name: text().notNull(),\n  email: text().notNull().unique(),\n  createdAt: timestamp().notNull().defaultNow()\n})\n```\n\n### Database API\n\n```ts\n\u002F\u002F db and schema are auto-imported on server-side\nimport { db, schema } from 'hub:db'\n\n\u002F\u002F Select\nconst users = await db.select().from(schema.users)\nconst user = await db.query.users.findFirst({ where: eq(schema.users.id, 1) })\n\n\u002F\u002F Insert\nconst [newUser] = await db.insert(schema.users).values({ name: 'John', email: 'john@example.com' }).returning()\n\n\u002F\u002F Update\nawait db.update(schema.users).set({ name: 'Jane' }).where(eq(schema.users.id, 1))\n\n\u002F\u002F Delete\nawait db.delete(schema.users).where(eq(schema.users.id, 1))\n```\n\n### Migrations\n\n```bash\nnpx nuxt db generate                  # Generate migrations from schema\nnpx nuxt db migrate                   # Apply pending migrations\nnpx nuxt db sql \"SELECT * FROM users\" # Execute raw SQL\nnpx nuxt db drop \u003CTABLE>              # Drop a specific table\nnpx nuxt db drop-all                  # Drop all tables (v0.10+)\nnpx nuxt db squash                    # Squash migrations into one (v0.10+)\nnpx nuxt db mark-as-migrated [NAME]   # Mark as migrated without running\n```\n\nMigrations auto-apply during `npx nuxi dev` and `npx nuxi build`. Tracked in `_hub_migrations` table.\n\n### Database Providers\n\n| Dialect    | Local                | Production                                                         |\n| ---------- | -------------------- | ------------------------------------------------------------------ |\n| sqlite     | `.data\u002Fdb\u002Fsqlite.db` | D1 (Cloudflare), Turso (`TURSO_DATABASE_URL`, `TURSO_AUTH_TOKEN`)  |\n| postgresql | PGlite               | postgres-js (`DATABASE_URL`), neon-http (v0.10.2+, `DATABASE_URL`) |\n| mysql      | -                    | mysql2 (`DATABASE_URL`, `MYSQL_URL`)                               |\n\n## KV Storage\n\nKey-value storage. `kv` is auto-imported on server-side.\n\n```ts\nimport { kv } from 'hub:kv'\n\nawait kv.set('key', { data: 'value' })\nawait kv.set('key', value, { ttl: 60 }) \u002F\u002F TTL in seconds\nconst value = await kv.get('key')\nconst exists = await kv.has('key')\nawait kv.del('key')\nconst keys = await kv.keys('prefix:')\nawait kv.clear('prefix:')\n```\n\nConstraints: max value 25 MiB, max key 512 bytes.\n\n### KV Providers\n\n| Provider      | Package          | Env Vars                                             |\n| ------------- | ---------------- | ---------------------------------------------------- |\n| Upstash       | `@upstash\u002Fredis` | `UPSTASH_REDIS_REST_URL`, `UPSTASH_REDIS_REST_TOKEN` |\n| Redis         | `ioredis`        | `REDIS_URL`                                          |\n| Cloudflare KV | -                | `KV` binding in wrangler.jsonc                       |\n| Deno KV       | -                | Auto on Deno Deploy                                  |\n| Vercel        | -                | `KV_REST_API_URL`, `KV_REST_API_TOKEN`               |\n\n## Blob Storage\n\nFile storage. `blob` is auto-imported on server-side.\n\n### Blob API\n\n```ts\nimport { blob } from 'hub:blob'\n\n\u002F\u002F Upload\nconst result = await blob.put('path\u002Ffile.txt', body, {\n  contentType: 'text\u002Fplain',\n  access: 'public', \u002F\u002F 'public' | 'private' (v0.10.2+)\n  addRandomSuffix: true,\n  prefix: 'uploads'\n})\n\u002F\u002F Returns: { pathname, contentType, size, httpEtag, uploadedAt }\n\n\u002F\u002F Download\nconst file = await blob.get('path\u002Ffile.txt') \u002F\u002F Returns Blob or null\n\n\u002F\u002F List\nconst { blobs, cursor, hasMore, folders } = await blob.list({ prefix: 'uploads\u002F', limit: 10, folded: true })\n\n\u002F\u002F Serve (with proper headers)\nreturn blob.serve(event, 'path\u002Ffile.txt')\n\n\u002F\u002F Delete\nawait blob.del('path\u002Ffile.txt')\nawait blob.del(['file1.txt', 'file2.txt']) \u002F\u002F Multiple\n\n\u002F\u002F Metadata only\nconst meta = await blob.head('path\u002Ffile.txt')\n```\n\n### Upload Helpers\n\n```ts\n\u002F\u002F Server: Validate + upload handler\nexport default eventHandler(async (event) => {\n  return blob.handleUpload(event, {\n    formKey: 'files',\n    multiple: true,\n    ensure: { maxSize: '10MB', types: ['image\u002Fpng', 'image\u002Fjpeg'] },\n    put: { addRandomSuffix: true, prefix: 'images' }\n  })\n})\n\n\u002F\u002F Validate before manual upload\nensureBlob(file, { maxSize: '10MB', types: ['image'] })\n\n\u002F\u002F Multipart upload for large files (>10MB)\nexport default eventHandler(async (event) => {\n  return blob.handleMultipartUpload(event) \u002F\u002F Route: \u002Fapi\u002Ffiles\u002Fmultipart\u002F[action]\u002F[...pathname]\n})\n```\n\n### Vue Composables\n\n```ts\n\u002F\u002F Simple upload\nconst upload = useUpload('\u002Fapi\u002Fupload')\nconst result = await upload(inputElement)\n\n\u002F\u002F Multipart with progress\nconst mpu = useMultipartUpload('\u002Fapi\u002Ffiles\u002Fmultipart')\nconst { completed, progress, abort } = mpu(file)\n```\n\n### Blob Providers\n\n| Provider      | Package        | Config                                                               |\n| ------------- | -------------- | -------------------------------------------------------------------- |\n| Cloudflare R2 | -              | `BLOB` binding in wrangler.jsonc                                     |\n| Vercel Blob   | `@vercel\u002Fblob` | `BLOB_READ_WRITE_TOKEN`                                              |\n| S3            | `aws4fetch`    | `S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`, `S3_BUCKET`, `S3_REGION` |\n\n## Cache\n\nResponse and function caching.\n\n### Route Handler Caching\n\n```ts\nexport default cachedEventHandler((event) => {\n  return { data: 'cached', date: new Date().toISOString() }\n}, {\n  maxAge: 60 * 60, \u002F\u002F 1 hour\n  getKey: event => event.path\n})\n```\n\n### Function Caching\n\n```ts\nexport const getStars = defineCachedFunction(\n  async (event: H3Event, repo: string) => {\n    const data = await $fetch(`https:\u002F\u002Fapi.github.com\u002Frepos\u002F${repo}`)\n    return data.stargazers_count\n  },\n  { maxAge: 3600, name: 'ghStars', getKey: (event, repo) => repo }\n)\n```\n\n### Cache Invalidation\n\n```ts\n\u002F\u002F Remove specific\nawait useStorage('cache').removeItem('nitro:functions:getStars:repo-name.json')\n\n\u002F\u002F Clear by prefix\nawait useStorage('cache').clear('nitro:handlers')\n```\n\nCache key pattern: `${group}:${name}:${getKey(...args)}.json` (defaults: group='nitro', name='handlers'|'functions'|'routes')\n\n## Deployment\n\n### Cloudflare\n\nNuxtHub auto-generates `wrangler.json` from your hub config - no manual wrangler.jsonc required:\n\n```ts\n\u002F\u002F nuxt.config.ts\nexport default defineNuxtConfig({\n  hub: {\n    db: {\n      dialect: 'sqlite',\n      driver: 'd1',\n      connection: { databaseId: '\u003Cdatabase-id>' }\n    },\n    kv: {\n      driver: 'cloudflare-kv-binding',\n      namespaceId: '\u003Ckv-namespace-id>'\n    },\n    cache: {\n      driver: 'cloudflare-kv-binding',\n      namespaceId: '\u003Ccache-namespace-id>'\n    },\n    blob: {\n      driver: 'cloudflare-r2',\n      bucketName: '\u003Cbucket-name>'\n    }\n  }\n})\n```\n\n**Observability (recommended):** Enable logging for production deployments:\n\n```jsonc\n\u002F\u002F wrangler.jsonc (optional)\n{\n  \"observability\": {\n    \"logs\": {\n      \"enabled\": true,\n      \"head_sampling_rate\": 1,\n      \"invocation_logs\": true,\n      \"persist\": true\n    }\n  }\n}\n```\n\nCreate resources via Cloudflare dashboard or CLI:\n\n```bash\nnpx wrangler d1 create my-db              # Get database-id\nnpx wrangler kv namespace create KV       # Get kv-namespace-id\nnpx wrangler kv namespace create CACHE    # Get cache-namespace-id\nnpx wrangler r2 bucket create my-bucket   # Get bucket-name\n```\n\nDeploy: Create [Cloudflare Workers project](https:\u002F\u002Fdash.cloudflare.com\u002F?to=\u002F:account\u002Fworkers-and-pages\u002Fcreate), link Git repo. Bindings auto-configured at build time.\n\n**Environments:** Use `CLOUDFLARE_ENV=preview` for preview deployments.\n\nSee [references\u002Fwrangler-templates.md](references\u002Fwrangler-templates.md) for manual wrangler.jsonc patterns and [references\u002Fproviders.md](references\u002Fproviders.md) for all provider configurations.\n\n### Other Providers\n\nSee [references\u002Fproviders.md](references\u002Fproviders.md) for detailed deployment patterns for:\n\n- **Vercel:** Postgres, Turso, Vercel Blob, Vercel KV\n- **Netlify:** External databases, S3, Upstash Redis\n- **Deno Deploy:** Deno KV\n- **AWS\u002FSelf-hosted:** S3, RDS, custom configs\n\n### D1 over HTTP\n\nQuery D1 from non-Cloudflare hosts:\n\n```ts\nhub: {\n  db: { dialect: 'sqlite', driver: 'd1-http' }\n}\n```\n\nRequires: `NUXT_HUB_CLOUDFLARE_ACCOUNT_ID`, `NUXT_HUB_CLOUDFLARE_API_TOKEN`, `NUXT_HUB_CLOUDFLARE_DATABASE_ID`\n\n## Build-time Hooks\n\n```ts\n\u002F\u002F Extend schema\nnuxt.hook('hub:db:schema:extend', async ({ dialect, paths }) => {\n  paths.push(await resolvePath(`.\u002Fschema\u002Fcustom.${dialect}`))\n})\n\n\u002F\u002F Add migration directories\nnuxt.hook('hub:db:migrations:dirs', (dirs) => {\n  dirs.push(resolve('.\u002Fdb-migrations'))\n})\n\n\u002F\u002F Post-migration queries (idempotent)\nnuxt.hook('hub:db:queries:paths', (paths, dialect) => {\n  paths.push(resolve(`.\u002Fseed.${dialect}.sql`))\n})\n```\n\n## Type Sharing\n\n```ts\n\u002F\u002F shared\u002Ftypes\u002Fdb.ts\nimport type { users } from '~\u002Fserver\u002Fdb\u002Fschema'\n\nexport type User = typeof users.$inferSelect\nexport type NewUser = typeof users.$inferInsert\n```\n\n## WebSocket \u002F Realtime\n\nEnable experimental WebSocket:\n\n```ts\n\u002F\u002F nuxt.config.ts\nnitro: { experimental: { websocket: true } }\n```\n\n```ts\n\u002F\u002F server\u002Froutes\u002Fws\u002Fchat.ts\nexport default defineWebSocketHandler({\n  open(peer) {\n    peer.subscribe('chat')\n    peer.publish('chat', 'User joined')\n  },\n  message(peer, message) {\n    peer.publish('chat', message.text())\n  },\n  close(peer) {\n    peer.unsubscribe('chat')\n  }\n})\n```\n\n## Deprecated (v0.10)\n\nRemoved Cloudflare-specific features:\n\n- `hubAI()` -> Use AI SDK with Workers AI Provider\n- `hubBrowser()` -> Puppeteer\n- `hubVectorize()` -> Vectorize\n- NuxtHub Admin -> Sunset Dec 31, 2025\n- `npx nuxthub deploy` -> Use wrangler deploy\n\n## Quick Reference\n\n| Feature  | Import                                | Access                             |\n| -------- | ------------------------------------- | ---------------------------------- |\n| Database | `import { db, schema } from 'hub:db'` | `db.select()`, `db.insert()`, etc. |\n| KV       | `import { kv } from 'hub:kv'`         | `kv.get()`, `kv.set()`, etc.       |\n| Blob     | `import { blob } from 'hub:blob'`     | `blob.put()`, `blob.get()`, etc.   |\n\nAll are auto-imported on server-side.\n\n## Resources\n\n- [Installation](https:\u002F\u002Fhub.nuxt.com\u002Fdocs\u002Fgetting-started\u002Finstallation)\n- [Migration from v0.9](https:\u002F\u002Fhub.nuxt.com\u002Fdocs\u002Fgetting-started\u002Fmigration)\n- [Database](https:\u002F\u002Fhub.nuxt.com\u002Fdocs\u002Fdatabase)\n- [Blob](https:\u002F\u002Fhub.nuxt.com\u002Fdocs\u002Fblob)\n- [KV](https:\u002F\u002Fhub.nuxt.com\u002Fdocs\u002Fkv)\n- [Cache](https:\u002F\u002Fhub.nuxt.com\u002Fdocs\u002Fcache)\n- [Deploy](https:\u002F\u002Fhub.nuxt.com\u002Fdocs\u002Fgetting-started\u002Fdeploy)\n",{"name":5,"license":15,"description":7},"main","24e9b0f0228a4c139f41ac18151c6b4fac3ca12a",".agents\u002Fskills\u002Fnuxthub","https:\u002F\u002Fgithub.com\u002Fruilopesm\u002Fethglobal","https:\u002F\u002Fgithub.com\u002Fruilopesm","cv.ruilopesm.com","Master's Student, Researcher and Invited Assistant Professor. Interested in Distributed Systems and Storage Systems.","2026-07-26 10:59:51",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add ruilopesm\u002Fethglobal --skill nuxthub",{"tool":38,"command":39},"bunx","bunx skills add ruilopesm\u002Fethglobal --skill nuxthub",{"tool":41,"command":42},"pnpm","pnpm dlx skills add ruilopesm\u002Fethglobal --skill nuxthub","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fruilopesm\u002Fethglobal\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fnuxthub\u002FSKILL.md",true,[46,52],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fproviders.md","REFERENCE","参考文档",5810,"https:\u002F\u002Fgithub.com\u002Fruilopesm\u002Fethglobal\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fnuxthub\u002Freferences\u002Fproviders.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fwrangler-templates.md",4540,"https:\u002F\u002Fgithub.com\u002Fruilopesm\u002Fethglobal\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fnuxthub\u002Freferences\u002Fwrangler-templates.md",[57,64,72,79,87],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M79MQDTQDED2G6JBH4VHAD5V","vue","Use when editing .vue files, creating Vue 3 components, writing composables, or testing Vue code - provides Composition API patterns, props\u002Femits best practices, VueUse integration, and reactive destructuring guidance","https:\u002F\u002Fgithub.com\u002Fruilopesm\u002Fethglobal\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fvue\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M79MQ9QQKM6K38V8SAV7EPK7","setup-solidity-contracts","Set up a Solidity smart contract project with OpenZeppelin Contracts. Use when users need to: (1) create a new Hardhat or Foundry project, (2) install OpenZeppelin Contracts dependencies for Solidity, (3) configure remappings for Foundry, or (4) understand Solidity import conventions for OpenZeppelin.","AGPL-3.0","https:\u002F\u002Fgithub.com\u002Fruilopesm\u002Fethglobal\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fsetup-solidity-contracts\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M79MQ1V6HA401HHCA6P5AH6M","nuxt","Nuxt application development and maintenance. Use for project structure, pages and routing, data fetching, SSR-safe state, middleware, plugins, server routes, runtime config, route rules, layers, built-in components, hydration, upgrades, and testing.","https:\u002F\u002Fgithub.com\u002Fruilopesm\u002Fethglobal\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fnuxt\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":83,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M79MJ61XF2BREFDEB5TPBVE0","drizzle-best-practices","Use this skill whenever the user is working with Drizzle ORM on PostgreSQL. This covers any mention of Drizzle, drizzle-orm, drizzle-kit, drizzle-zod, `pgTable`, `defineRelations`, `relations()`, `db.select()`, `db.query`, or insert\u002Fupdate\u002Fdelete against Postgres.\n\nTypical intents to trigger on:\n- Designing or debugging Postgres table schemas, columns, identity PKs, enums, JSONB, arrays\n- Modeling one-to-many or many-to-many relations and join tables in Drizzle\n- Writing, optimizing, or preparing Drizzle queries (placeholders, `.prepare()`)\n- Generating Zod validators from Drizzle tables\n- Setting up TypeScript + Postgres projects (Neon, Supabase, postgres.js, node-postgres) with Drizzle\n- Migrating from Prisma, TypeORM, or Sequelize **to Drizzle**\n- Resolving Drizzle type errors; choosing between v1 RC and 0.45.x APIs\n\nDo NOT trigger for Drizzle with MySQL\u002FSQLite, raw SQL without an ORM, or other ORMs when Drizzle is not the target.","https:\u002F\u002Fgithub.com\u002Fruilopesm\u002Fethglobal\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdrizzle-best-practices\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fruilopesm\u002Fethglobal\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdrizzle-best-practices\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M79MHZBQZX07WK4XHBHEF5NG","develop-secure-contracts","Develop secure smart contracts using OpenZeppelin Contracts libraries. Use when users need to integrate OpenZeppelin library components — including token standards (ERC20, ERC721, ERC1155), access control (Ownable, AccessControl, AccessManager), security primitives (Pausable, ReentrancyGuard), governance (Governor, timelocks), or accounts (multisig, account abstraction) — into existing or new contracts. Covers pattern discovery from library source, CLI contract generators, and library-first integration. Supports Solidity, Cairo, Stylus, Stellar, and Sui Move.","https:\u002F\u002Fgithub.com\u002Fruilopesm\u002Fethglobal\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdevelop-secure-contracts\u002FSKILL.md",[],[]]