leeovery/agentic-skills/nuxt-server-data
Claude Code and agent skill by leeovery/agentic-skills
- community
Checking that the SKILL.md file is still in the repository.
Server-side data layer with Drizzle ORM + Cloudflare D1 + NuxtHub. Use when designing schema, generating and applying migrations, querying from Nitro routes, sharing types between client and server, or testing DB writes.
Install
npx vskill@latest install leeovery/agentic-skills/nuxt-server-dataSKILL.md
Nuxt Server Data
The server-side persistence layer for a Nuxt + NuxtHub + Cloudflare app. Drizzle ORM models the schema in TypeScript, NuxtHub auto-exposes a db handle, D1 is the runtime database.
This is the server-side counterpart to `nuxt-repositories` — repositories are the client-side API access layer; this skill covers what's behind the API.
When to use
- Designing a Drizzle schema for D1 / SQLite
- Generating and applying migrations (local + remote)
- Querying inside Nitro server routes (
server/api/*.post.ts) - Sharing types between client and server via
shared/types/ - Avoiding the wrangler-deploy migration gotcha (migrations do NOT auto-apply)
- Testing DB writes with isolation seams
Reference files
- [drizzle-d1.md](references/drizzle-d1.md) — schema definition (
sqliteTable, json columns,notNull, defaults), querying patterns (select,insert,count, joins), Drizzle conventions - [nuxt-hub.md](references/nuxt-hub.md) —
hub.dbconfig, the auto-importeddbandschemaexports, migration generation (nuxt-hub db generate), the_hub_migrationstable, local vs remote migration apply, the build-then-wrangler script pattern - [server-types.md](references/server-types.md) —
shared/utils/andshared/types/for cross-side type reuse, Drizzle's inferred row types, request/response shape sharing with Zod
Stack at a glance
Quick example
Notice: db is auto-imported by NuxtHub — no import { db } from ... line. Schema is imported by name (submissions) from ../db/schema.
Critical: migrations don't auto-apply
Neither nuxt build, wrangler deploy, nor Cloudflare Workers Builds run migrations. You apply them manually from a local checkout:
Detail in nuxt-hub.md. This is the single biggest footgun in the stack — if you're seeing "no such table" on prod after a deploy, you forgot this step.
Anti-patterns
- ❌ Querying from
shared/utils/— that code runs in the client bundle too. Server queries go inserver/only. - ❌ Importing
dbexplicitly — it's auto-imported by NuxtHub; an explicit import path is a sign you're working against the framework. - ❌ Putting raw SQL strings inline for filtering — use Drizzle's
eq/and/gtoperators; they're typed against your schema. - ❌ Running migrations against
--remotefrom a CI environment — CI doesn't have your wrangler auth and the build script indb:migrate:remotedoes. Run it locally. - ❌ Reaching for
vi.mock('~/server/db')in tests — seenuxt-testing/test-seams.mdfor the env-guarded seam pattern.
Related
- [nuxt-config](../nuxt-config/references/cloudflare-deployment.md) — Cloudflare Workers deployment,
wrangler.jsongeneration, secrets vs vars - [nuxt-forms](../nuxt-forms/references/marketing-forms.md) — the
contact.post.tsroute that consumes thesubmissionstable - [nuxt-testing](../nuxt-testing/references/test-seams.md) — DB test isolation seam (
/api/_dev/db) - [nuxt-repositories](../nuxt-repositories/SKILL.md) — client-side API access (the layer above this one)
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingnuxt/skills/nuxt-server-data/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/leeovery/agentic-skills/nuxt-server-data)