[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AK3NRVWC91EFFW7FMPY17A":3,"skill-same:01M7AK3NRVWC91EFFW7FMPY17A":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":39,"commitSha":40,"skillDirectory":5,"forksCount":13,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":43,"install":44,"resources":57},"01M7AK3NRVWC91EFFW7FMPY17A","cloudflare-nextjs",null,"Deploy Next.js applications (App Router and Pages Router) to Cloudflare Workers using the OpenNext adapter. This skill should be used when deploying Next.js apps with SSR, ISR, or server components to Cloudflare's serverless platform. It covers setup for both new and existing projects, configuration requirements, development workflows, integration with Cloudflare services (D1, R2, KV, Workers AI), and prevention of 10+ documented errors including worker size limits, runtime compatibility, database connection scoping, and security vulnerabilities.\n\nKeywords: Cloudflare Next.js, OpenNext Cloudflare, @opennextjs\u002Fcloudflare, Next.js Workers, Next.js App Router Cloudflare, Next.js Pages Router Cloudflare, Next.js SSR Cloudflare, Next.js ISR, server components cloudflare, server actions cloudflare, Next.js middleware workers, nextjs d1, nextjs r2, nextjs kv, Next.js deployment, opennextjs-cloudflare cli, nodejs_compat, worker size limit, next.js runtime compatibility, database connection scoping, Next.js migration cloudflare","davidanthonyn\u002Fclaude-skills","davidanthonyn","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F55152980?v=4","01M7AJ4MY8S5C2RJCGX6626J0G","01M7AJ7JE1K98GRPH9Z57Z0R0W",0,"MIT","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fcloudflare-nextjs\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: cloudflare-nextjs\ndescription: |\n  Deploy Next.js applications (App Router and Pages Router) to Cloudflare Workers using the OpenNext adapter. This skill should be used when deploying Next.js apps with SSR, ISR, or server components to Cloudflare's serverless platform. It covers setup for both new and existing projects, configuration requirements, development workflows, integration with Cloudflare services (D1, R2, KV, Workers AI), and prevention of 10+ documented errors including worker size limits, runtime compatibility, database connection scoping, and security vulnerabilities.\n\n  Keywords: Cloudflare Next.js, OpenNext Cloudflare, @opennextjs\u002Fcloudflare, Next.js Workers, Next.js App Router Cloudflare, Next.js Pages Router Cloudflare, Next.js SSR Cloudflare, Next.js ISR, server components cloudflare, server actions cloudflare, Next.js middleware workers, nextjs d1, nextjs r2, nextjs kv, Next.js deployment, opennextjs-cloudflare cli, nodejs_compat, worker size limit, next.js runtime compatibility, database connection scoping, Next.js migration cloudflare\nlicense: MIT\nmetadata:\n  version: 1.0.0\n  last_verified: 2025-10-21\n  package_versions:\n    \"@opennextjs\u002Fcloudflare\": \"^1.3.0\"\n    \"next\": \"^14.2.0 || ^15.0.0\"\n    \"wrangler\": \"latest\"\n  compatibility_requirements:\n    compatibility_date: \"2025-05-05\"\n    compatibility_flags: [\"nodejs_compat\"]\n  token_savings: \"~59%\"\n  errors_prevented: 10\n  official_docs: \"https:\u002F\u002Fopennext.js.org\u002Fcloudflare\"\n  cloudflare_guide: \"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fframework-guides\u002Fweb-apps\u002Fnextjs\u002F\"\n---\n\n# Cloudflare Next.js Deployment Skill\n\nDeploy Next.js applications to Cloudflare Workers using the OpenNext Cloudflare adapter for production-ready serverless Next.js hosting.\n\n## Use This Skill When\n\n- Deploying Next.js applications (App Router or Pages Router) to Cloudflare Workers\n- Need server-side rendering (SSR), static site generation (SSG), or incremental static regeneration (ISR) on Cloudflare\n- Migrating existing Next.js apps from Vercel, AWS, or other platforms to Cloudflare\n- Building full-stack Next.js applications with Cloudflare services (D1, R2, KV, Workers AI)\n- Need React Server Components, Server Actions, or Next.js middleware on Workers\n- Want global edge deployment with Cloudflare's network\n\n## Key Concepts\n\n### OpenNext Adapter Architecture\n\nThe **OpenNext Cloudflare adapter** (`@opennextjs\u002Fcloudflare`) transforms Next.js build output into Cloudflare Worker-compatible format. This is fundamentally different from standard Next.js deployments:\n\n- **Node.js Runtime Required**: Uses Node.js runtime in Workers (NOT Edge runtime)\n- **Dual Development Workflow**: Test in both Next.js dev server AND workerd runtime\n- **Custom Build Pipeline**: `next build` → OpenNext transformation → Worker deployment\n- **Cloudflare-Specific Configuration**: Requires wrangler.jsonc and open-next.config.ts\n\n### Critical Differences from Standard Next.js\n\n| Aspect | Standard Next.js | Cloudflare Workers |\n|--------|------------------|-------------------|\n| Runtime | Node.js or Edge | Node.js (via nodejs_compat) |\n| Dev Server | `next dev` | `next dev` + `opennextjs-cloudflare preview` |\n| Deployment | Platform-specific | `opennextjs-cloudflare deploy` |\n| Worker Size | No limit | 3 MiB (free) \u002F 10 MiB (paid) |\n| Database Connections | Global clients OK | Must be request-scoped |\n| Image Optimization | Built-in | Via Cloudflare Images |\n| Caching | Next.js cache | OpenNext config + Workers cache |\n\n## Setup Patterns\n\n### New Project Setup\n\nUse Cloudflare's `create-cloudflare` (C3) CLI to scaffold a new Next.js project pre-configured for Workers:\n\n```bash\nnpm create cloudflare@latest -- my-next-app --framework=next\n```\n\n**What this does**:\n1. Runs Next.js official setup tool (`create-next-app`)\n2. Installs `@opennextjs\u002Fcloudflare` adapter\n3. Creates `wrangler.jsonc` with correct configuration\n4. Creates `open-next.config.ts` for caching configuration\n5. Adds deployment scripts to `package.json`\n6. Optionally deploys immediately to Cloudflare\n\n**Development workflow**:\n```bash\nnpm run dev      # Next.js dev server (fast reloads)\nnpm run preview  # Test in workerd runtime (production-like)\nnpm run deploy   # Build and deploy to Cloudflare\n```\n\n### Existing Project Migration\n\nTo add the OpenNext adapter to an existing Next.js application:\n\n#### 1. Install the adapter\n\n```bash\nnpm install --save-dev @opennextjs\u002Fcloudflare\n```\n\n#### 2. Create wrangler.jsonc\n\n```jsonc\n{\n  \"name\": \"my-next-app\",\n  \"compatibility_date\": \"2025-05-05\",\n  \"compatibility_flags\": [\"nodejs_compat\"]\n}\n```\n\n**Critical configuration**:\n- `compatibility_date`: **Minimum `2025-05-05`** (for FinalizationRegistry support)\n- `compatibility_flags`: **Must include `nodejs_compat`** (for Node.js runtime)\n\n#### 3. Create open-next.config.ts\n\n```typescript\nimport { defineCloudflareConfig } from \"@opennextjs\u002Fcloudflare\";\n\nexport default defineCloudflareConfig({\n  \u002F\u002F Caching configuration (optional)\n  \u002F\u002F See: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Fcaching\n});\n```\n\n#### 4. Update package.json scripts\n\n```json\n{\n  \"scripts\": {\n    \"dev\": \"next dev\",\n    \"build\": \"next build\",\n    \"preview\": \"opennextjs-cloudflare build && opennextjs-cloudflare preview\",\n    \"deploy\": \"opennextjs-cloudflare build && opennextjs-cloudflare deploy\",\n    \"cf-typegen\": \"wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts\"\n  }\n}\n```\n\n**Script purposes**:\n- `dev`: Next.js development server (fast iteration)\n- `preview`: Build + run in workerd runtime (test before deploy)\n- `deploy`: Build + deploy to Cloudflare\n- `cf-typegen`: Generate TypeScript types for Cloudflare bindings\n\n#### 5. Ensure Node.js runtime (not Edge)\n\nRemove Edge runtime exports from your app:\n\n```typescript\n\u002F\u002F ❌ REMOVE THIS (Edge runtime not supported)\nexport const runtime = \"edge\";\n\n\u002F\u002F ✅ Use Node.js runtime (default)\n\u002F\u002F No export needed - Node.js is default\n```\n\n## Development Workflow\n\n### Dual Testing Strategy\n\n**Always test in BOTH environments**:\n\n1. **Next.js Dev Server** (`npm run dev`)\n   - Fast hot reloading\n   - Best developer experience\n   - Runs in Node.js (not production runtime)\n   - Use for rapid iteration\n\n2. **Workerd Runtime** (`npm run preview`)\n   - Runs in production-like environment\n   - Catches runtime-specific issues\n   - Slower rebuild times\n   - **Required before deployment**\n\n### When to Use Each\n\n```bash\n# Iterating on UI\u002Flogic → Use Next.js dev server\nnpm run dev\n\n# Testing integrations (D1, R2, KV) → Use preview\nnpm run preview\n\n# Before deploying → ALWAYS test preview\nnpm run preview\n\n# Deploy to production\nnpm run deploy\n```\n\n## Configuration Requirements\n\n### Wrangler Configuration\n\n**Minimum requirements** in `wrangler.jsonc`:\n\n```jsonc\n{\n  \"name\": \"your-app-name\",\n  \"compatibility_date\": \"2025-05-05\",  \u002F\u002F Minimum for FinalizationRegistry\n  \"compatibility_flags\": [\"nodejs_compat\"]  \u002F\u002F Required for Node.js runtime\n}\n```\n\n### Environment Variables for Package Exports\n\nIf using npm packages with multiple export conditions, create `.env`:\n\n```env\nWRANGLER_BUILD_CONDITIONS=\"\"\nWRANGLER_BUILD_PLATFORM=\"node\"\n```\n\nThis ensures Wrangler prioritizes the `node` export when available.\n\n### Cloudflare Bindings Integration\n\nAdd bindings in `wrangler.jsonc`:\n\n```jsonc\n{\n  \"name\": \"your-app-name\",\n  \"compatibility_date\": \"2025-05-05\",\n  \"compatibility_flags\": [\"nodejs_compat\"],\n\n  \u002F\u002F D1 Database\n  \"d1_databases\": [\n    {\n      \"binding\": \"DB\",\n      \"database_name\": \"production-db\",\n      \"database_id\": \"your-database-id\"\n    }\n  ],\n\n  \u002F\u002F R2 Storage\n  \"r2_buckets\": [\n    {\n      \"binding\": \"BUCKET\",\n      \"bucket_name\": \"your-bucket\"\n    }\n  ],\n\n  \u002F\u002F KV Storage\n  \"kv_namespaces\": [\n    {\n      \"binding\": \"KV\",\n      \"id\": \"your-kv-id\"\n    }\n  ],\n\n  \u002F\u002F Workers AI\n  \"ai\": {\n    \"binding\": \"AI\"\n  }\n}\n```\n\nAccess bindings in Next.js via `process.env`:\n\n```typescript\n\u002F\u002F app\u002Fapi\u002Froute.ts\nimport type { NextRequest } from 'next\u002Fserver';\n\nexport async function GET(request: NextRequest) {\n  \u002F\u002F Access Cloudflare bindings\n  const env = process.env as any;\n\n  \u002F\u002F D1 Database query\n  const result = await env.DB.prepare('SELECT * FROM users').all();\n\n  \u002F\u002F R2 Storage access\n  const file = await env.BUCKET.get('file.txt');\n\n  \u002F\u002F KV Storage access\n  const value = await env.KV.get('key');\n\n  \u002F\u002F Workers AI inference\n  const response = await env.AI.run('@cf\u002Fmeta\u002Fllama-3-8b-instruct', {\n    prompt: 'Hello AI'\n  });\n\n  return Response.json({ result });\n}\n```\n\n## Error Prevention (10+ Documented Errors)\n\n### 1. Worker Size Limit Exceeded (3 MiB - Free Plan)\n\n**Error**: `\"Your Worker exceeded the size limit of 3 MiB\"`\n\n**Cause**: Workers Free plan limits Worker size to 3 MiB (gzip-compressed)\n\n**Solutions**:\n- Upgrade to Workers Paid plan (10 MiB limit)\n- Analyze bundle size and remove unused dependencies\n- Use dynamic imports to code-split large dependencies\n\n**Bundle analysis**:\n```bash\nnpx opennextjs-cloudflare build\ncd .open-next\u002Fserver-functions\u002Fdefault\n# Analyze handler.mjs.meta.json with ESBuild Bundle Analyzer\n```\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting#worker-size-limits\n\n---\n\n### 2. Worker Size Limit Exceeded (10 MiB - Paid Plan)\n\n**Error**: `\"Your Worker exceeded the size limit of 10 MiB\"`\n\n**Cause**: Unnecessary code bundled into Worker\n\n**Debug workflow**:\n1. Run `npx opennextjs-cloudflare build`\n2. Navigate to `.open-next\u002Fserver-functions\u002Fdefault`\n3. Analyze `handler.mjs.meta.json` using ESBuild Bundle Analyzer\n4. Identify and remove\u002Fexternalize large dependencies\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting#worker-size-limits\n\n---\n\n### 3. FinalizationRegistry Not Defined\n\n**Error**: `\"ReferenceError: FinalizationRegistry is not defined\"`\n\n**Cause**: `compatibility_date` in wrangler.jsonc is too old\n\n**Solution**: Update `compatibility_date` to `2025-05-05` or later:\n\n```jsonc\n{\n  \"compatibility_date\": \"2025-05-05\"  \u002F\u002F Minimum for FinalizationRegistry\n}\n```\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting#finalizationregistry-is-not-defined\n\n---\n\n### 4. Cannot Perform I\u002FO on Behalf of Different Request\n\n**Error**: `\"Cannot perform I\u002FO on behalf of a different request\"`\n\n**Cause**: Database client created globally and reused across requests\n\n**Problem code**:\n```typescript\n\u002F\u002F ❌ WRONG: Global DB client\nimport { Pool } from 'pg';\nconst pool = new Pool({ connectionString: process.env.DATABASE_URL });\n\nexport async function GET() {\n  \u002F\u002F This will fail - pool created in different request context\n  const result = await pool.query('SELECT * FROM users');\n  return Response.json(result);\n}\n```\n\n**Solution**: Create database clients inside request handlers:\n\n```typescript\n\u002F\u002F ✅ CORRECT: Request-scoped DB client\nimport { Pool } from 'pg';\n\nexport async function GET() {\n  \u002F\u002F Create client within request context\n  const pool = new Pool({ connectionString: process.env.DATABASE_URL });\n  const result = await pool.query('SELECT * FROM users');\n  await pool.end();\n  return Response.json(result);\n}\n```\n\n**Alternative**: Use Cloudflare D1 (designed for Workers) instead of external databases:\n\n```typescript\n\u002F\u002F ✅ BEST: Use D1 (no connection pooling needed)\nexport async function GET(request: NextRequest) {\n  const env = process.env as any;\n  const result = await env.DB.prepare('SELECT * FROM users').all();\n  return Response.json(result);\n}\n```\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting#cannot-perform-io-on-behalf-of-a-different-request\n\n---\n\n### 5. NPM Package Import Failures\n\n**Error**: `\"Could not resolve '\u003Cpackage>'\"`\n\n**Cause**: Missing `nodejs_compat` flag or package export conditions\n\n**Solution 1**: Enable `nodejs_compat` flag:\n\n```jsonc\n{\n  \"compatibility_flags\": [\"nodejs_compat\"]\n}\n```\n\n**Solution 2**: For packages with multiple exports, create `.env`:\n\n```env\nWRANGLER_BUILD_CONDITIONS=\"\"\nWRANGLER_BUILD_PLATFORM=\"node\"\n```\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting#npm-packages-fail-to-import\n\n---\n\n### 6. Failed to Load Chunk (Turbopack)\n\n**Error**: `\"Failed to load chunk server\u002Fchunks\u002Fssr\u002F\"`\n\n**Cause**: Next.js built with Turbopack (`next build --turbo`)\n\n**Solution**: Use standard build (Turbopack not supported by adapter):\n\n```json\n{\n  \"scripts\": {\n    \"build\": \"next build\"  \u002F\u002F ✅ Correct\n    \u002F\u002F \"build\": \"next build --turbo\"  \u002F\u002F ❌ Don't use Turbopack\n  }\n}\n```\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting#failed-to-load-chunk\n\n---\n\n### 7. SSRF Vulnerability (CVE-2025-6087)\n\n**Vulnerability**: Server-Side Request Forgery via `\u002F_next\u002Fimage` endpoint\n\n**Affected versions**: `@opennextjs\u002Fcloudflare` \u003C 1.3.0\n\n**Solution**: Upgrade to version 1.3.0 or later:\n\n```bash\nnpm install --save-dev @opennextjs\u002Fcloudflare@^1.3.0\n```\n\n**Impact**: Allows unauthenticated users to proxy arbitrary remote content\n\n**Source**: https:\u002F\u002Fgithub.com\u002Fadvisories\u002FGHSA-rvpw-p7vw-wj3m\n\n---\n\n### 8. Durable Objects Binding Warnings\n\n**Warning**: `\"You have defined bindings to the following internal Durable Objects... will not work in local development, but they should work in production\"`\n\n**Cause**: OpenNext uses Durable Objects for caching (`DOQueueHandler`, `DOShardedTagCache`)\n\n**Solution**: **Safe to ignore** - warning is expected behavior\n\n**Alternative** (to suppress warning): Define Durable Objects in separate Worker with own config\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Fknown-issues#caching-durable-objects\n\n---\n\n### 9. Prisma + D1 Middleware Conflicts\n\n**Error**: Build errors when using `@prisma\u002Fclient` + `@prisma\u002Fadapter-d1` in Next.js middleware\n\n**Cause**: Database initialization in middleware context\n\n**Workaround**: Initialize Prisma client in route handlers, not middleware\n\n**Source**: https:\u002F\u002Fgithub.com\u002Fopennextjs\u002Fopennextjs-cloudflare\u002Fissues\u002F471\n\n---\n\n### 10. cross-fetch Library Errors\n\n**Error**: Errors when using libraries that depend on `cross-fetch`\n\n**Cause**: OpenNext patches deployment package causing `cross-fetch` to try using Node.js libraries when native fetch is available\n\n**Solution**: Use native `fetch` API directly instead of `cross-fetch`:\n\n```typescript\n\u002F\u002F ✅ Use native fetch\nconst response = await fetch('https:\u002F\u002Fapi.example.com\u002Fdata');\n\n\u002F\u002F ❌ Avoid cross-fetch\n\u002F\u002F import fetch from 'cross-fetch';\n```\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting\n\n---\n\n### 11. Windows Development Issues\n\n**Issue**: Full Windows support not guaranteed\n\n**Cause**: Underlying Next.js tooling issues on Windows\n\n**Solutions**:\n- Use WSL (Windows Subsystem for Linux)\n- Use virtual machine with Linux\n- Use Linux-based CI\u002FCD for deployments\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare#windows-support\n\n## Feature Support Matrix\n\n| Feature | Status | Notes |\n|---------|--------|-------|\n| **App Router** | ✅ Fully Supported | Latest App Router features work |\n| **Pages Router** | ✅ Fully Supported | Legacy Pages Router supported |\n| **Route Handlers** | ✅ Fully Supported | API routes work as expected |\n| **React Server Components** | ✅ Fully Supported | RSC fully functional |\n| **Server Actions** | ✅ Fully Supported | Server Actions work |\n| **SSG** | ✅ Fully Supported | Static Site Generation |\n| **SSR** | ✅ Fully Supported | Server-Side Rendering |\n| **ISR** | ✅ Fully Supported | Incremental Static Regeneration |\n| **Middleware** | ✅ Supported | Except Node.js middleware (15.2+) |\n| **Image Optimization** | ✅ Supported | Via Cloudflare Images |\n| **Partial Prerendering (PPR)** | ✅ Supported | Experimental in Next.js |\n| **Composable Caching** | ✅ Supported | `'use cache'` directive |\n| **Response Streaming** | ✅ Supported | Streaming responses work |\n| **`next\u002Fafter` API** | ✅ Supported | Post-response async work |\n| **Node.js Middleware (15.2+)** | ❌ Not Supported | Future support planned |\n| **Edge Runtime** | ❌ Not Supported | Use Node.js runtime |\n\n**Source**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fframework-guides\u002Fweb-apps\u002Fnextjs\u002F#next-js-supported-features\n\n## Integration with Cloudflare Services\n\n### D1 Database (SQL)\n\n```typescript\n\u002F\u002F app\u002Fapi\u002Fusers\u002Froute.ts\nimport type { NextRequest } from 'next\u002Fserver';\n\nexport async function GET(request: NextRequest) {\n  const env = process.env as any;\n\n  const result = await env.DB.prepare(\n    'SELECT * FROM users WHERE active = ?'\n  ).bind(true).all();\n\n  return Response.json(result.results);\n}\n\nexport async function POST(request: NextRequest) {\n  const env = process.env as any;\n  const { name, email } = await request.json();\n\n  const result = await env.DB.prepare(\n    'INSERT INTO users (name, email) VALUES (?, ?)'\n  ).bind(name, email).run();\n\n  return Response.json({ id: result.meta.last_row_id });\n}\n```\n\n**Wrangler config**:\n```jsonc\n{\n  \"d1_databases\": [\n    {\n      \"binding\": \"DB\",\n      \"database_name\": \"production-db\",\n      \"database_id\": \"your-database-id\"\n    }\n  ]\n}\n```\n\n**See also**: `cloudflare-d1` skill for complete D1 patterns\n\n---\n\n### R2 Storage (Object Storage)\n\n```typescript\n\u002F\u002F app\u002Fapi\u002Fupload\u002Froute.ts\nimport type { NextRequest } from 'next\u002Fserver';\n\nexport async function POST(request: NextRequest) {\n  const env = process.env as any;\n  const formData = await request.formData();\n  const file = formData.get('file') as File;\n\n  \u002F\u002F Upload to R2\n  await env.BUCKET.put(file.name, file.stream(), {\n    httpMetadata: {\n      contentType: file.type\n    }\n  });\n\n  return Response.json({ success: true, filename: file.name });\n}\n\nexport async function GET(request: NextRequest) {\n  const env = process.env as any;\n  const { searchParams } = new URL(request.url);\n  const filename = searchParams.get('file');\n\n  const object = await env.BUCKET.get(filename);\n  if (!object) {\n    return new Response('Not found', { status: 404 });\n  }\n\n  return new Response(object.body, {\n    headers: {\n      'Content-Type': object.httpMetadata?.contentType || 'application\u002Foctet-stream'\n    }\n  });\n}\n```\n\n**See also**: `cloudflare-r2` skill for complete R2 patterns\n\n---\n\n### Workers AI (Model Inference)\n\n```typescript\n\u002F\u002F app\u002Fapi\u002Fai\u002Froute.ts\nimport type { NextRequest } from 'next\u002Fserver';\n\nexport async function POST(request: NextRequest) {\n  const env = process.env as any;\n  const { prompt } = await request.json();\n\n  const response = await env.AI.run('@cf\u002Fmeta\u002Fllama-3-8b-instruct', {\n    prompt\n  });\n\n  return Response.json(response);\n}\n```\n\n**Wrangler config**:\n```jsonc\n{\n  \"ai\": {\n    \"binding\": \"AI\"\n  }\n}\n```\n\n**See also**: `cloudflare-workers-ai` skill for complete AI patterns\n\n---\n\n### KV Storage (Key-Value)\n\n```typescript\n\u002F\u002F app\u002Fapi\u002Fcache\u002Froute.ts\nimport type { NextRequest } from 'next\u002Fserver';\n\nexport async function GET(request: NextRequest) {\n  const env = process.env as any;\n  const { searchParams } = new URL(request.url);\n  const key = searchParams.get('key');\n\n  const value = await env.KV.get(key);\n  return Response.json({ key, value });\n}\n\nexport async function PUT(request: NextRequest) {\n  const env = process.env as any;\n  const { key, value, ttl } = await request.json();\n\n  await env.KV.put(key, value, { expirationTtl: ttl });\n  return Response.json({ success: true });\n}\n```\n\n**See also**: `cloudflare-kv` skill for complete KV patterns\n\n## Image Optimization\n\nNext.js image optimization works via Cloudflare Images. Configure in `open-next.config.ts`:\n\n```typescript\nimport { defineCloudflareConfig } from \"@opennextjs\u002Fcloudflare\";\n\nexport default defineCloudflareConfig({\n  imageOptimization: {\n    loader: 'cloudflare'\n  }\n});\n```\n\nUsage in components:\n\n```tsx\nimport Image from 'next\u002Fimage';\n\nexport default function Avatar() {\n  return (\n    \u003CImage\n      src=\"\u002Favatar.jpg\"\n      alt=\"User avatar\"\n      width={200}\n      height={200}\n      \u002F\u002F Automatically optimized via Cloudflare Images\n    \u002F>\n  );\n}\n```\n\n**Billing**: Cloudflare Images usage is billed separately\n\n**Docs**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fimages\u002F\n\n## Caching Configuration\n\nConfigure caching behavior in `open-next.config.ts`:\n\n```typescript\nimport { defineCloudflareConfig } from \"@opennextjs\u002Fcloudflare\";\n\nexport default defineCloudflareConfig({\n  \u002F\u002F Custom cache configuration\n  cache: {\n    \u002F\u002F Override default cache behavior\n    \u002F\u002F See: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Fcaching\n  }\n});\n```\n\n**Default behavior**: OpenNext provides sensible caching defaults\n\n**Advanced usage**: See official OpenNext caching documentation\n\n## Known Limitations\n\n### Not Yet Supported\n\n1. **Node.js Middleware (Next.js 15.2+)**\n   - Introduced in Next.js 15.2\n   - Support planned for future releases\n   - Use standard middleware for now\n\n2. **Edge Runtime**\n   - Only Node.js runtime supported\n   - Remove `export const runtime = \"edge\"` from your app\n\n3. **Full Windows Support**\n   - Development on Windows not fully guaranteed\n   - Use WSL, VM, or Linux-based CI\u002FCD\n\n### Worker Size Constraints\n\n- **Free plan**: 3 MiB limit (gzip-compressed)\n- **Paid plan**: 10 MiB limit (gzip-compressed)\n- Monitor bundle size during development\n- Use dynamic imports for code splitting\n\n### Database Connections\n\n- External database clients (PostgreSQL, MySQL) must be request-scoped\n- Cannot reuse connections across requests (Workers limitation)\n- Prefer Cloudflare D1 for database needs (designed for Workers)\n\n## Deployment\n\n### Deploy from Local Machine\n\n```bash\n# Build and deploy in one command\nnpm run deploy\n\n# Or step by step:\nnpx opennextjs-cloudflare build\nnpx opennextjs-cloudflare deploy\n```\n\n### Deploy from CI\u002FCD\n\nConfigure deployment command in your CI\u002FCD system:\n\n```bash\nnpm run deploy\n```\n\n**Examples**:\n- GitHub Actions: `.github\u002Fworkflows\u002Fdeploy.yml`\n- GitLab CI: `.gitlab-ci.yml`\n- Cloudflare Workers Builds: Auto-detects `npm run deploy`\n\n**Environment variables**: Set secrets in Cloudflare dashboard or CI\u002FCD system\n\n### Custom Domains\n\nAdd custom domain in Cloudflare dashboard:\n\n1. Navigate to Workers & Pages\n2. Select your Worker\n3. Settings → Domains & Routes\n4. Add custom domain\n\n**DNS**: Domain must be on Cloudflare (zone required)\n\n## TypeScript Support\n\nGenerate types for Cloudflare bindings:\n\n```bash\nnpm run cf-typegen\n```\n\nCreates `cloudflare-env.d.ts` with types for your bindings:\n\n```typescript\n\u002F\u002F cloudflare-env.d.ts (auto-generated)\ninterface CloudflareEnv {\n  DB: D1Database;\n  BUCKET: R2Bucket;\n  KV: KVNamespace;\n  AI: Ai;\n}\n```\n\nUse in route handlers:\n\n```typescript\nimport type { NextRequest } from 'next\u002Fserver';\n\nexport async function GET(request: NextRequest) {\n  const env = process.env as CloudflareEnv;\n  \u002F\u002F Now env.DB, env.BUCKET, etc. are typed\n}\n```\n\n## Testing\n\n### Local Testing (Development)\n\n```bash\n# Next.js dev server (fast iteration)\nnpm run dev\n```\n\n### Local Testing (Production-like)\n\n```bash\n# Workerd runtime (catches Workers-specific issues)\nnpm run preview\n```\n\n### Integration Testing\n\nAlways test in `preview` mode before deploying:\n\n```bash\n# Build and run in workerd\nnpm run preview\n\n# Test bindings (D1, R2, KV, AI)\n# Test middleware\n# Test API routes\n# Test SSR\u002FISR behavior\n```\n\n## Migration from Other Platforms\n\n### From Vercel\n\n1. Copy existing Next.js project\n2. Run existing project migration steps (above)\n3. Update environment variables in Cloudflare dashboard\n4. Replace Vercel-specific features:\n   - Vercel Postgres → Cloudflare D1\n   - Vercel Blob → Cloudflare R2\n   - Vercel KV → Cloudflare KV\n   - Vercel Edge Config → Cloudflare KV\n5. Test thoroughly with `npm run preview`\n6. Deploy with `npm run deploy`\n\n### From AWS \u002F Other Platforms\n\nSame process as Vercel migration - the adapter handles Next.js standard features automatically.\n\n## Resources\n\n### Official Documentation\n- **OpenNext Cloudflare**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\n- **Cloudflare Next.js Guide**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fframework-guides\u002Fweb-apps\u002Fnextjs\u002F\n- **Next.js Docs**: https:\u002F\u002Fnextjs.org\u002Fdocs\n\n### Troubleshooting\n- **Troubleshooting Guide**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting\n- **Known Issues**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Fknown-issues\n- **GitHub Issues**: https:\u002F\u002Fgithub.com\u002Fopennextjs\u002Fopennextjs-cloudflare\u002Fissues\n\n### Related Skills\n- `cloudflare-worker-base` - Base Worker setup with Hono + Vite + React\n- `cloudflare-d1` - D1 database integration\n- `cloudflare-r2` - R2 object storage\n- `cloudflare-kv` - KV key-value storage\n- `cloudflare-workers-ai` - Workers AI integration\n- `cloudflare-vectorize` - Vector database for RAG\n\n## Quick Reference\n\n### Essential Commands\n\n```bash\n# New project\nnpm create cloudflare@latest -- my-next-app --framework=next\n\n# Development\nnpm run dev      # Fast iteration (Next.js dev server)\nnpm run preview  # Test in workerd (production-like)\n\n# Deployment\nnpm run deploy   # Build and deploy to Cloudflare\n\n# TypeScript\nnpm run cf-typegen  # Generate binding types\n```\n\n### Critical Configuration\n\n```jsonc\n\u002F\u002F wrangler.jsonc\n{\n  \"compatibility_date\": \"2025-05-05\",  \u002F\u002F Minimum!\n  \"compatibility_flags\": [\"nodejs_compat\"]  \u002F\u002F Required!\n}\n```\n\n### Common Pitfalls\n\n1. ❌ Using Edge runtime → ✅ Use Node.js runtime\n2. ❌ Global DB clients → ✅ Request-scoped clients\n3. ❌ Old compatibility_date → ✅ Use 2025-05-05+\n4. ❌ Missing nodejs_compat → ✅ Add to compatibility_flags\n5. ❌ Only testing in `dev` → ✅ Always test `preview` before deploy\n6. ❌ Using Turbopack → ✅ Use standard Next.js build\n\n---\n\n**Production Tested**: Official Cloudflare support and active community\n**Token Savings**: ~59% vs manual setup\n**Errors Prevented**: 10+ documented issues\n**Last Verified**: 2025-10-21\n","# Cloudflare Next.js Deployment Skill\n\nDeploy Next.js applications to Cloudflare Workers using the OpenNext Cloudflare adapter for production-ready serverless Next.js hosting.\n\n## Use This Skill When\n\n- Deploying Next.js applications (App Router or Pages Router) to Cloudflare Workers\n- Need server-side rendering (SSR), static site generation (SSG), or incremental static regeneration (ISR) on Cloudflare\n- Migrating existing Next.js apps from Vercel, AWS, or other platforms to Cloudflare\n- Building full-stack Next.js applications with Cloudflare services (D1, R2, KV, Workers AI)\n- Need React Server Components, Server Actions, or Next.js middleware on Workers\n- Want global edge deployment with Cloudflare's network\n\n## Key Concepts\n\n### OpenNext Adapter Architecture\n\nThe **OpenNext Cloudflare adapter** (`@opennextjs\u002Fcloudflare`) transforms Next.js build output into Cloudflare Worker-compatible format. This is fundamentally different from standard Next.js deployments:\n\n- **Node.js Runtime Required**: Uses Node.js runtime in Workers (NOT Edge runtime)\n- **Dual Development Workflow**: Test in both Next.js dev server AND workerd runtime\n- **Custom Build Pipeline**: `next build` → OpenNext transformation → Worker deployment\n- **Cloudflare-Specific Configuration**: Requires wrangler.jsonc and open-next.config.ts\n\n### Critical Differences from Standard Next.js\n\n| Aspect | Standard Next.js | Cloudflare Workers |\n|--------|------------------|-------------------|\n| Runtime | Node.js or Edge | Node.js (via nodejs_compat) |\n| Dev Server | `next dev` | `next dev` + `opennextjs-cloudflare preview` |\n| Deployment | Platform-specific | `opennextjs-cloudflare deploy` |\n| Worker Size | No limit | 3 MiB (free) \u002F 10 MiB (paid) |\n| Database Connections | Global clients OK | Must be request-scoped |\n| Image Optimization | Built-in | Via Cloudflare Images |\n| Caching | Next.js cache | OpenNext config + Workers cache |\n\n## Setup Patterns\n\n### New Project Setup\n\nUse Cloudflare's `create-cloudflare` (C3) CLI to scaffold a new Next.js project pre-configured for Workers:\n\n```bash\nnpm create cloudflare@latest -- my-next-app --framework=next\n```\n\n**What this does**:\n1. Runs Next.js official setup tool (`create-next-app`)\n2. Installs `@opennextjs\u002Fcloudflare` adapter\n3. Creates `wrangler.jsonc` with correct configuration\n4. Creates `open-next.config.ts` for caching configuration\n5. Adds deployment scripts to `package.json`\n6. Optionally deploys immediately to Cloudflare\n\n**Development workflow**:\n```bash\nnpm run dev      # Next.js dev server (fast reloads)\nnpm run preview  # Test in workerd runtime (production-like)\nnpm run deploy   # Build and deploy to Cloudflare\n```\n\n### Existing Project Migration\n\nTo add the OpenNext adapter to an existing Next.js application:\n\n#### 1. Install the adapter\n\n```bash\nnpm install --save-dev @opennextjs\u002Fcloudflare\n```\n\n#### 2. Create wrangler.jsonc\n\n```jsonc\n{\n  \"name\": \"my-next-app\",\n  \"compatibility_date\": \"2025-05-05\",\n  \"compatibility_flags\": [\"nodejs_compat\"]\n}\n```\n\n**Critical configuration**:\n- `compatibility_date`: **Minimum `2025-05-05`** (for FinalizationRegistry support)\n- `compatibility_flags`: **Must include `nodejs_compat`** (for Node.js runtime)\n\n#### 3. Create open-next.config.ts\n\n```typescript\nimport { defineCloudflareConfig } from \"@opennextjs\u002Fcloudflare\";\n\nexport default defineCloudflareConfig({\n  \u002F\u002F Caching configuration (optional)\n  \u002F\u002F See: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Fcaching\n});\n```\n\n#### 4. Update package.json scripts\n\n```json\n{\n  \"scripts\": {\n    \"dev\": \"next dev\",\n    \"build\": \"next build\",\n    \"preview\": \"opennextjs-cloudflare build && opennextjs-cloudflare preview\",\n    \"deploy\": \"opennextjs-cloudflare build && opennextjs-cloudflare deploy\",\n    \"cf-typegen\": \"wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts\"\n  }\n}\n```\n\n**Script purposes**:\n- `dev`: Next.js development server (fast iteration)\n- `preview`: Build + run in workerd runtime (test before deploy)\n- `deploy`: Build + deploy to Cloudflare\n- `cf-typegen`: Generate TypeScript types for Cloudflare bindings\n\n#### 5. Ensure Node.js runtime (not Edge)\n\nRemove Edge runtime exports from your app:\n\n```typescript\n\u002F\u002F ❌ REMOVE THIS (Edge runtime not supported)\nexport const runtime = \"edge\";\n\n\u002F\u002F ✅ Use Node.js runtime (default)\n\u002F\u002F No export needed - Node.js is default\n```\n\n## Development Workflow\n\n### Dual Testing Strategy\n\n**Always test in BOTH environments**:\n\n1. **Next.js Dev Server** (`npm run dev`)\n   - Fast hot reloading\n   - Best developer experience\n   - Runs in Node.js (not production runtime)\n   - Use for rapid iteration\n\n2. **Workerd Runtime** (`npm run preview`)\n   - Runs in production-like environment\n   - Catches runtime-specific issues\n   - Slower rebuild times\n   - **Required before deployment**\n\n### When to Use Each\n\n```bash\n# Iterating on UI\u002Flogic → Use Next.js dev server\nnpm run dev\n\n# Testing integrations (D1, R2, KV) → Use preview\nnpm run preview\n\n# Before deploying → ALWAYS test preview\nnpm run preview\n\n# Deploy to production\nnpm run deploy\n```\n\n## Configuration Requirements\n\n### Wrangler Configuration\n\n**Minimum requirements** in `wrangler.jsonc`:\n\n```jsonc\n{\n  \"name\": \"your-app-name\",\n  \"compatibility_date\": \"2025-05-05\",  \u002F\u002F Minimum for FinalizationRegistry\n  \"compatibility_flags\": [\"nodejs_compat\"]  \u002F\u002F Required for Node.js runtime\n}\n```\n\n### Environment Variables for Package Exports\n\nIf using npm packages with multiple export conditions, create `.env`:\n\n```env\nWRANGLER_BUILD_CONDITIONS=\"\"\nWRANGLER_BUILD_PLATFORM=\"node\"\n```\n\nThis ensures Wrangler prioritizes the `node` export when available.\n\n### Cloudflare Bindings Integration\n\nAdd bindings in `wrangler.jsonc`:\n\n```jsonc\n{\n  \"name\": \"your-app-name\",\n  \"compatibility_date\": \"2025-05-05\",\n  \"compatibility_flags\": [\"nodejs_compat\"],\n\n  \u002F\u002F D1 Database\n  \"d1_databases\": [\n    {\n      \"binding\": \"DB\",\n      \"database_name\": \"production-db\",\n      \"database_id\": \"your-database-id\"\n    }\n  ],\n\n  \u002F\u002F R2 Storage\n  \"r2_buckets\": [\n    {\n      \"binding\": \"BUCKET\",\n      \"bucket_name\": \"your-bucket\"\n    }\n  ],\n\n  \u002F\u002F KV Storage\n  \"kv_namespaces\": [\n    {\n      \"binding\": \"KV\",\n      \"id\": \"your-kv-id\"\n    }\n  ],\n\n  \u002F\u002F Workers AI\n  \"ai\": {\n    \"binding\": \"AI\"\n  }\n}\n```\n\nAccess bindings in Next.js via `process.env`:\n\n```typescript\n\u002F\u002F app\u002Fapi\u002Froute.ts\nimport type { NextRequest } from 'next\u002Fserver';\n\nexport async function GET(request: NextRequest) {\n  \u002F\u002F Access Cloudflare bindings\n  const env = process.env as any;\n\n  \u002F\u002F D1 Database query\n  const result = await env.DB.prepare('SELECT * FROM users').all();\n\n  \u002F\u002F R2 Storage access\n  const file = await env.BUCKET.get('file.txt');\n\n  \u002F\u002F KV Storage access\n  const value = await env.KV.get('key');\n\n  \u002F\u002F Workers AI inference\n  const response = await env.AI.run('@cf\u002Fmeta\u002Fllama-3-8b-instruct', {\n    prompt: 'Hello AI'\n  });\n\n  return Response.json({ result });\n}\n```\n\n## Error Prevention (10+ Documented Errors)\n\n### 1. Worker Size Limit Exceeded (3 MiB - Free Plan)\n\n**Error**: `\"Your Worker exceeded the size limit of 3 MiB\"`\n\n**Cause**: Workers Free plan limits Worker size to 3 MiB (gzip-compressed)\n\n**Solutions**:\n- Upgrade to Workers Paid plan (10 MiB limit)\n- Analyze bundle size and remove unused dependencies\n- Use dynamic imports to code-split large dependencies\n\n**Bundle analysis**:\n```bash\nnpx opennextjs-cloudflare build\ncd .open-next\u002Fserver-functions\u002Fdefault\n# Analyze handler.mjs.meta.json with ESBuild Bundle Analyzer\n```\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting#worker-size-limits\n\n---\n\n### 2. Worker Size Limit Exceeded (10 MiB - Paid Plan)\n\n**Error**: `\"Your Worker exceeded the size limit of 10 MiB\"`\n\n**Cause**: Unnecessary code bundled into Worker\n\n**Debug workflow**:\n1. Run `npx opennextjs-cloudflare build`\n2. Navigate to `.open-next\u002Fserver-functions\u002Fdefault`\n3. Analyze `handler.mjs.meta.json` using ESBuild Bundle Analyzer\n4. Identify and remove\u002Fexternalize large dependencies\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting#worker-size-limits\n\n---\n\n### 3. FinalizationRegistry Not Defined\n\n**Error**: `\"ReferenceError: FinalizationRegistry is not defined\"`\n\n**Cause**: `compatibility_date` in wrangler.jsonc is too old\n\n**Solution**: Update `compatibility_date` to `2025-05-05` or later:\n\n```jsonc\n{\n  \"compatibility_date\": \"2025-05-05\"  \u002F\u002F Minimum for FinalizationRegistry\n}\n```\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting#finalizationregistry-is-not-defined\n\n---\n\n### 4. Cannot Perform I\u002FO on Behalf of Different Request\n\n**Error**: `\"Cannot perform I\u002FO on behalf of a different request\"`\n\n**Cause**: Database client created globally and reused across requests\n\n**Problem code**:\n```typescript\n\u002F\u002F ❌ WRONG: Global DB client\nimport { Pool } from 'pg';\nconst pool = new Pool({ connectionString: process.env.DATABASE_URL });\n\nexport async function GET() {\n  \u002F\u002F This will fail - pool created in different request context\n  const result = await pool.query('SELECT * FROM users');\n  return Response.json(result);\n}\n```\n\n**Solution**: Create database clients inside request handlers:\n\n```typescript\n\u002F\u002F ✅ CORRECT: Request-scoped DB client\nimport { Pool } from 'pg';\n\nexport async function GET() {\n  \u002F\u002F Create client within request context\n  const pool = new Pool({ connectionString: process.env.DATABASE_URL });\n  const result = await pool.query('SELECT * FROM users');\n  await pool.end();\n  return Response.json(result);\n}\n```\n\n**Alternative**: Use Cloudflare D1 (designed for Workers) instead of external databases:\n\n```typescript\n\u002F\u002F ✅ BEST: Use D1 (no connection pooling needed)\nexport async function GET(request: NextRequest) {\n  const env = process.env as any;\n  const result = await env.DB.prepare('SELECT * FROM users').all();\n  return Response.json(result);\n}\n```\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting#cannot-perform-io-on-behalf-of-a-different-request\n\n---\n\n### 5. NPM Package Import Failures\n\n**Error**: `\"Could not resolve '\u003Cpackage>'\"`\n\n**Cause**: Missing `nodejs_compat` flag or package export conditions\n\n**Solution 1**: Enable `nodejs_compat` flag:\n\n```jsonc\n{\n  \"compatibility_flags\": [\"nodejs_compat\"]\n}\n```\n\n**Solution 2**: For packages with multiple exports, create `.env`:\n\n```env\nWRANGLER_BUILD_CONDITIONS=\"\"\nWRANGLER_BUILD_PLATFORM=\"node\"\n```\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting#npm-packages-fail-to-import\n\n---\n\n### 6. Failed to Load Chunk (Turbopack)\n\n**Error**: `\"Failed to load chunk server\u002Fchunks\u002Fssr\u002F\"`\n\n**Cause**: Next.js built with Turbopack (`next build --turbo`)\n\n**Solution**: Use standard build (Turbopack not supported by adapter):\n\n```json\n{\n  \"scripts\": {\n    \"build\": \"next build\"  \u002F\u002F ✅ Correct\n    \u002F\u002F \"build\": \"next build --turbo\"  \u002F\u002F ❌ Don't use Turbopack\n  }\n}\n```\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting#failed-to-load-chunk\n\n---\n\n### 7. SSRF Vulnerability (CVE-2025-6087)\n\n**Vulnerability**: Server-Side Request Forgery via `\u002F_next\u002Fimage` endpoint\n\n**Affected versions**: `@opennextjs\u002Fcloudflare` \u003C 1.3.0\n\n**Solution**: Upgrade to version 1.3.0 or later:\n\n```bash\nnpm install --save-dev @opennextjs\u002Fcloudflare@^1.3.0\n```\n\n**Impact**: Allows unauthenticated users to proxy arbitrary remote content\n\n**Source**: https:\u002F\u002Fgithub.com\u002Fadvisories\u002FGHSA-rvpw-p7vw-wj3m\n\n---\n\n### 8. Durable Objects Binding Warnings\n\n**Warning**: `\"You have defined bindings to the following internal Durable Objects... will not work in local development, but they should work in production\"`\n\n**Cause**: OpenNext uses Durable Objects for caching (`DOQueueHandler`, `DOShardedTagCache`)\n\n**Solution**: **Safe to ignore** - warning is expected behavior\n\n**Alternative** (to suppress warning): Define Durable Objects in separate Worker with own config\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Fknown-issues#caching-durable-objects\n\n---\n\n### 9. Prisma + D1 Middleware Conflicts\n\n**Error**: Build errors when using `@prisma\u002Fclient` + `@prisma\u002Fadapter-d1` in Next.js middleware\n\n**Cause**: Database initialization in middleware context\n\n**Workaround**: Initialize Prisma client in route handlers, not middleware\n\n**Source**: https:\u002F\u002Fgithub.com\u002Fopennextjs\u002Fopennextjs-cloudflare\u002Fissues\u002F471\n\n---\n\n### 10. cross-fetch Library Errors\n\n**Error**: Errors when using libraries that depend on `cross-fetch`\n\n**Cause**: OpenNext patches deployment package causing `cross-fetch` to try using Node.js libraries when native fetch is available\n\n**Solution**: Use native `fetch` API directly instead of `cross-fetch`:\n\n```typescript\n\u002F\u002F ✅ Use native fetch\nconst response = await fetch('https:\u002F\u002Fapi.example.com\u002Fdata');\n\n\u002F\u002F ❌ Avoid cross-fetch\n\u002F\u002F import fetch from 'cross-fetch';\n```\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting\n\n---\n\n### 11. Windows Development Issues\n\n**Issue**: Full Windows support not guaranteed\n\n**Cause**: Underlying Next.js tooling issues on Windows\n\n**Solutions**:\n- Use WSL (Windows Subsystem for Linux)\n- Use virtual machine with Linux\n- Use Linux-based CI\u002FCD for deployments\n\n**Source**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare#windows-support\n\n## Feature Support Matrix\n\n| Feature | Status | Notes |\n|---------|--------|-------|\n| **App Router** | ✅ Fully Supported | Latest App Router features work |\n| **Pages Router** | ✅ Fully Supported | Legacy Pages Router supported |\n| **Route Handlers** | ✅ Fully Supported | API routes work as expected |\n| **React Server Components** | ✅ Fully Supported | RSC fully functional |\n| **Server Actions** | ✅ Fully Supported | Server Actions work |\n| **SSG** | ✅ Fully Supported | Static Site Generation |\n| **SSR** | ✅ Fully Supported | Server-Side Rendering |\n| **ISR** | ✅ Fully Supported | Incremental Static Regeneration |\n| **Middleware** | ✅ Supported | Except Node.js middleware (15.2+) |\n| **Image Optimization** | ✅ Supported | Via Cloudflare Images |\n| **Partial Prerendering (PPR)** | ✅ Supported | Experimental in Next.js |\n| **Composable Caching** | ✅ Supported | `'use cache'` directive |\n| **Response Streaming** | ✅ Supported | Streaming responses work |\n| **`next\u002Fafter` API** | ✅ Supported | Post-response async work |\n| **Node.js Middleware (15.2+)** | ❌ Not Supported | Future support planned |\n| **Edge Runtime** | ❌ Not Supported | Use Node.js runtime |\n\n**Source**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fframework-guides\u002Fweb-apps\u002Fnextjs\u002F#next-js-supported-features\n\n## Integration with Cloudflare Services\n\n### D1 Database (SQL)\n\n```typescript\n\u002F\u002F app\u002Fapi\u002Fusers\u002Froute.ts\nimport type { NextRequest } from 'next\u002Fserver';\n\nexport async function GET(request: NextRequest) {\n  const env = process.env as any;\n\n  const result = await env.DB.prepare(\n    'SELECT * FROM users WHERE active = ?'\n  ).bind(true).all();\n\n  return Response.json(result.results);\n}\n\nexport async function POST(request: NextRequest) {\n  const env = process.env as any;\n  const { name, email } = await request.json();\n\n  const result = await env.DB.prepare(\n    'INSERT INTO users (name, email) VALUES (?, ?)'\n  ).bind(name, email).run();\n\n  return Response.json({ id: result.meta.last_row_id });\n}\n```\n\n**Wrangler config**:\n```jsonc\n{\n  \"d1_databases\": [\n    {\n      \"binding\": \"DB\",\n      \"database_name\": \"production-db\",\n      \"database_id\": \"your-database-id\"\n    }\n  ]\n}\n```\n\n**See also**: `cloudflare-d1` skill for complete D1 patterns\n\n---\n\n### R2 Storage (Object Storage)\n\n```typescript\n\u002F\u002F app\u002Fapi\u002Fupload\u002Froute.ts\nimport type { NextRequest } from 'next\u002Fserver';\n\nexport async function POST(request: NextRequest) {\n  const env = process.env as any;\n  const formData = await request.formData();\n  const file = formData.get('file') as File;\n\n  \u002F\u002F Upload to R2\n  await env.BUCKET.put(file.name, file.stream(), {\n    httpMetadata: {\n      contentType: file.type\n    }\n  });\n\n  return Response.json({ success: true, filename: file.name });\n}\n\nexport async function GET(request: NextRequest) {\n  const env = process.env as any;\n  const { searchParams } = new URL(request.url);\n  const filename = searchParams.get('file');\n\n  const object = await env.BUCKET.get(filename);\n  if (!object) {\n    return new Response('Not found', { status: 404 });\n  }\n\n  return new Response(object.body, {\n    headers: {\n      'Content-Type': object.httpMetadata?.contentType || 'application\u002Foctet-stream'\n    }\n  });\n}\n```\n\n**See also**: `cloudflare-r2` skill for complete R2 patterns\n\n---\n\n### Workers AI (Model Inference)\n\n```typescript\n\u002F\u002F app\u002Fapi\u002Fai\u002Froute.ts\nimport type { NextRequest } from 'next\u002Fserver';\n\nexport async function POST(request: NextRequest) {\n  const env = process.env as any;\n  const { prompt } = await request.json();\n\n  const response = await env.AI.run('@cf\u002Fmeta\u002Fllama-3-8b-instruct', {\n    prompt\n  });\n\n  return Response.json(response);\n}\n```\n\n**Wrangler config**:\n```jsonc\n{\n  \"ai\": {\n    \"binding\": \"AI\"\n  }\n}\n```\n\n**See also**: `cloudflare-workers-ai` skill for complete AI patterns\n\n---\n\n### KV Storage (Key-Value)\n\n```typescript\n\u002F\u002F app\u002Fapi\u002Fcache\u002Froute.ts\nimport type { NextRequest } from 'next\u002Fserver';\n\nexport async function GET(request: NextRequest) {\n  const env = process.env as any;\n  const { searchParams } = new URL(request.url);\n  const key = searchParams.get('key');\n\n  const value = await env.KV.get(key);\n  return Response.json({ key, value });\n}\n\nexport async function PUT(request: NextRequest) {\n  const env = process.env as any;\n  const { key, value, ttl } = await request.json();\n\n  await env.KV.put(key, value, { expirationTtl: ttl });\n  return Response.json({ success: true });\n}\n```\n\n**See also**: `cloudflare-kv` skill for complete KV patterns\n\n## Image Optimization\n\nNext.js image optimization works via Cloudflare Images. Configure in `open-next.config.ts`:\n\n```typescript\nimport { defineCloudflareConfig } from \"@opennextjs\u002Fcloudflare\";\n\nexport default defineCloudflareConfig({\n  imageOptimization: {\n    loader: 'cloudflare'\n  }\n});\n```\n\nUsage in components:\n\n```tsx\nimport Image from 'next\u002Fimage';\n\nexport default function Avatar() {\n  return (\n    \u003CImage\n      src=\"\u002Favatar.jpg\"\n      alt=\"User avatar\"\n      width={200}\n      height={200}\n      \u002F\u002F Automatically optimized via Cloudflare Images\n    \u002F>\n  );\n}\n```\n\n**Billing**: Cloudflare Images usage is billed separately\n\n**Docs**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fimages\u002F\n\n## Caching Configuration\n\nConfigure caching behavior in `open-next.config.ts`:\n\n```typescript\nimport { defineCloudflareConfig } from \"@opennextjs\u002Fcloudflare\";\n\nexport default defineCloudflareConfig({\n  \u002F\u002F Custom cache configuration\n  cache: {\n    \u002F\u002F Override default cache behavior\n    \u002F\u002F See: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Fcaching\n  }\n});\n```\n\n**Default behavior**: OpenNext provides sensible caching defaults\n\n**Advanced usage**: See official OpenNext caching documentation\n\n## Known Limitations\n\n### Not Yet Supported\n\n1. **Node.js Middleware (Next.js 15.2+)**\n   - Introduced in Next.js 15.2\n   - Support planned for future releases\n   - Use standard middleware for now\n\n2. **Edge Runtime**\n   - Only Node.js runtime supported\n   - Remove `export const runtime = \"edge\"` from your app\n\n3. **Full Windows Support**\n   - Development on Windows not fully guaranteed\n   - Use WSL, VM, or Linux-based CI\u002FCD\n\n### Worker Size Constraints\n\n- **Free plan**: 3 MiB limit (gzip-compressed)\n- **Paid plan**: 10 MiB limit (gzip-compressed)\n- Monitor bundle size during development\n- Use dynamic imports for code splitting\n\n### Database Connections\n\n- External database clients (PostgreSQL, MySQL) must be request-scoped\n- Cannot reuse connections across requests (Workers limitation)\n- Prefer Cloudflare D1 for database needs (designed for Workers)\n\n## Deployment\n\n### Deploy from Local Machine\n\n```bash\n# Build and deploy in one command\nnpm run deploy\n\n# Or step by step:\nnpx opennextjs-cloudflare build\nnpx opennextjs-cloudflare deploy\n```\n\n### Deploy from CI\u002FCD\n\nConfigure deployment command in your CI\u002FCD system:\n\n```bash\nnpm run deploy\n```\n\n**Examples**:\n- GitHub Actions: `.github\u002Fworkflows\u002Fdeploy.yml`\n- GitLab CI: `.gitlab-ci.yml`\n- Cloudflare Workers Builds: Auto-detects `npm run deploy`\n\n**Environment variables**: Set secrets in Cloudflare dashboard or CI\u002FCD system\n\n### Custom Domains\n\nAdd custom domain in Cloudflare dashboard:\n\n1. Navigate to Workers & Pages\n2. Select your Worker\n3. Settings → Domains & Routes\n4. Add custom domain\n\n**DNS**: Domain must be on Cloudflare (zone required)\n\n## TypeScript Support\n\nGenerate types for Cloudflare bindings:\n\n```bash\nnpm run cf-typegen\n```\n\nCreates `cloudflare-env.d.ts` with types for your bindings:\n\n```typescript\n\u002F\u002F cloudflare-env.d.ts (auto-generated)\ninterface CloudflareEnv {\n  DB: D1Database;\n  BUCKET: R2Bucket;\n  KV: KVNamespace;\n  AI: Ai;\n}\n```\n\nUse in route handlers:\n\n```typescript\nimport type { NextRequest } from 'next\u002Fserver';\n\nexport async function GET(request: NextRequest) {\n  const env = process.env as CloudflareEnv;\n  \u002F\u002F Now env.DB, env.BUCKET, etc. are typed\n}\n```\n\n## Testing\n\n### Local Testing (Development)\n\n```bash\n# Next.js dev server (fast iteration)\nnpm run dev\n```\n\n### Local Testing (Production-like)\n\n```bash\n# Workerd runtime (catches Workers-specific issues)\nnpm run preview\n```\n\n### Integration Testing\n\nAlways test in `preview` mode before deploying:\n\n```bash\n# Build and run in workerd\nnpm run preview\n\n# Test bindings (D1, R2, KV, AI)\n# Test middleware\n# Test API routes\n# Test SSR\u002FISR behavior\n```\n\n## Migration from Other Platforms\n\n### From Vercel\n\n1. Copy existing Next.js project\n2. Run existing project migration steps (above)\n3. Update environment variables in Cloudflare dashboard\n4. Replace Vercel-specific features:\n   - Vercel Postgres → Cloudflare D1\n   - Vercel Blob → Cloudflare R2\n   - Vercel KV → Cloudflare KV\n   - Vercel Edge Config → Cloudflare KV\n5. Test thoroughly with `npm run preview`\n6. Deploy with `npm run deploy`\n\n### From AWS \u002F Other Platforms\n\nSame process as Vercel migration - the adapter handles Next.js standard features automatically.\n\n## Resources\n\n### Official Documentation\n- **OpenNext Cloudflare**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\n- **Cloudflare Next.js Guide**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fframework-guides\u002Fweb-apps\u002Fnextjs\u002F\n- **Next.js Docs**: https:\u002F\u002Fnextjs.org\u002Fdocs\n\n### Troubleshooting\n- **Troubleshooting Guide**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Ftroubleshooting\n- **Known Issues**: https:\u002F\u002Fopennext.js.org\u002Fcloudflare\u002Fknown-issues\n- **GitHub Issues**: https:\u002F\u002Fgithub.com\u002Fopennextjs\u002Fopennextjs-cloudflare\u002Fissues\n\n### Related Skills\n- `cloudflare-worker-base` - Base Worker setup with Hono + Vite + React\n- `cloudflare-d1` - D1 database integration\n- `cloudflare-r2` - R2 object storage\n- `cloudflare-kv` - KV key-value storage\n- `cloudflare-workers-ai` - Workers AI integration\n- `cloudflare-vectorize` - Vector database for RAG\n\n## Quick Reference\n\n### Essential Commands\n\n```bash\n# New project\nnpm create cloudflare@latest -- my-next-app --framework=next\n\n# Development\nnpm run dev      # Fast iteration (Next.js dev server)\nnpm run preview  # Test in workerd (production-like)\n\n# Deployment\nnpm run deploy   # Build and deploy to Cloudflare\n\n# TypeScript\nnpm run cf-typegen  # Generate binding types\n```\n\n### Critical Configuration\n\n```jsonc\n\u002F\u002F wrangler.jsonc\n{\n  \"compatibility_date\": \"2025-05-05\",  \u002F\u002F Minimum!\n  \"compatibility_flags\": [\"nodejs_compat\"]  \u002F\u002F Required!\n}\n```\n\n### Common Pitfalls\n\n1. ❌ Using Edge runtime → ✅ Use Node.js runtime\n2. ❌ Global DB clients → ✅ Request-scoped clients\n3. ❌ Old compatibility_date → ✅ Use 2025-05-05+\n4. ❌ Missing nodejs_compat → ✅ Add to compatibility_flags\n5. ❌ Only testing in `dev` → ✅ Always test `preview` before deploy\n6. ❌ Using Turbopack → ✅ Use standard Next.js build\n\n---\n\n**Production Tested**: Official Cloudflare support and active community\n**Token Savings**: ~59% vs manual setup\n**Errors Prevented**: 10+ documented issues\n**Last Verified**: 2025-10-21\n",{"name":5,"license":14,"metadata":23,"description":38},{"version":24,"last_verified":25,"official_docs":26,"token_savings":27,"cloudflare_guide":28,"errors_prevented":29,"package_versions":30,"compatibility_requirements":34},"1.0.0",1761004800000,"https:\u002F\u002Fopennext.js.org\u002Fcloudflare","~59%","https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fframework-guides\u002Fweb-apps\u002Fnextjs\u002F",10,{"next":31,"wrangler":32,"@opennextjs\u002Fcloudflare":33},"^14.2.0 || ^15.0.0","latest","^1.3.0",{"compatibility_date":35,"compatibility_flags":36},"2025-05-05",[37],"nodejs_compat","Deploy Next.js applications (App Router and Pages Router) to Cloudflare Workers using the OpenNext adapter. This skill should be used when deploying Next.js apps with SSR, ISR, or server components to Cloudflare's serverless platform. It covers setup for both new and existing projects, configuration requirements, development workflows, integration with Cloudflare services (D1, R2, KV, Workers AI), and prevention of 10+ documented errors including worker size limits, runtime compatibility, database connection scoping, and security vulnerabilities.\n\nKeywords: Cloudflare Next.js, OpenNext Cloudflare, @opennextjs\u002Fcloudflare, Next.js Workers, Next.js App Router Cloudflare, Next.js Pages Router Cloudflare, Next.js SSR Cloudflare, Next.js ISR, server components cloudflare, server actions cloudflare, Next.js middleware workers, nextjs d1, nextjs r2, nextjs kv, Next.js deployment, opennextjs-cloudflare cli, nodejs_compat, worker size limit, next.js runtime compatibility, database connection scoping, Next.js migration cloudflare\n","main","45d5ac830c3e238eeba6d0b4e6fd7cf6b56bf380","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn","2026-09-09 16:05:56",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add davidanthonyn\u002Fclaude-skills --skill cloudflare-nextjs",{"tool":50,"command":51},"bunx","bunx skills add davidanthonyn\u002Fclaude-skills --skill cloudflare-nextjs",{"tool":53,"command":54},"pnpm","pnpm dlx skills add davidanthonyn\u002Fclaude-skills --skill cloudflare-nextjs","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fcloudflare-nextjs\u002FSKILL.md",true,[58,64,68],{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"README.md","REFERENCE","参考文档",7613,"https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fcloudflare-nextjs\u002FREADME.md",{"path":65,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":66,"sourceHtmlUrl":67},"SKILL.json",26387,"https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fcloudflare-nextjs\u002FSKILL.json",{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"SKILL.md.backup","OTHER","其他",25475,"https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fcloudflare-nextjs\u002FSKILL.md.backup",[75,82,90,97,104,113],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M7AQPHJF528A4MD52YZEZV3R","zustand-state-management","Production-tested setup for Zustand state management in React applications with TypeScript.\nThis skill provides comprehensive patterns for building scalable, type-safe global state.\n\nUse when: setting up global state in React, migrating from Redux or Context API, implementing\nstate persistence with localStorage, configuring TypeScript with Zustand, using slices pattern\nfor modular stores, adding devtools middleware for debugging, handling Next.js SSR hydration,\nor encountering hydration errors, TypeScript inference issues, or persist middleware problems.\n\nPrevents 5 documented issues: Next.js hydration mismatches, TypeScript double parentheses\nsyntax errors, persist middleware export errors, infinite render loops, and slices pattern\ntype inference failures.\n\nKeywords: zustand, state management, React state, TypeScript state, persist middleware,\ndevtools, slices pattern, global state, React hooks, create store, useBoundStore,\nStateCreator, hydration error, text content mismatch, infinite render, localStorage,\nsessionStorage, immer middleware, shallow equality, selector pattern, zustand v5","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fzustand-state-management\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":86,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":18},"01M7AQP2XJRPNYEH323GJ81NN5","zetic-mlange","Help users integrate the ZETIC Melange (MLange) on-device AI SDK into Android (Kotlin\u002FJava) and iOS (Swift) mobile apps. Use this skill whenever the user mentions Zetic, MLange, Melange, ZeticMLangeModel, ZeticMLangeLLMModel, ZeticMLangeHFModel, on-device NPU inference for mobile, or deploying ML models to Android\u002FiOS with NPU acceleration. Also trigger when users ask about running LLMs on-device with GGUF quantization, mobile NPU model deployment, or converting PyTorch\u002FONNX models for mobile inference. Covers general model inference, LLM inference (streaming token generation), and HuggingFace model loading.","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fzetic-mlange\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fzetic-mlange\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":18},"01M7AQNEJHD27NNF5PYQDSW8B9","youtube-downloader","Download videos, audio, playlists, and channels from YouTube and 1000+ websites using yt-dlp. Supports quality selection, format conversion, subtitle download, playlist filtering, metadata extraction, thumbnail download, and batch operations. Use when downloading YouTube videos in any quality (4K, 8K, HDR), extracting audio as MP3\u002FM4A\u002FFLAC, downloading entire playlists\u002Fchannels, getting subtitles in multiple languages, converting to specific formats, downloading live streams, archiving content, or batch processing multiple URLs. Optimized for reliability with automatic retries, rate limiting, and error handling.","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fyoutube-downloader\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":18},"01M7AQJQSD2H04EE2EPNAQ8A3M","wordpress-plugin-core","This skill provides comprehensive knowledge for WordPress plugin development, covering core patterns, security best practices, database interactions, hooks\u002Ffilters, Settings API, custom post types, REST API, and AJAX. This skill should be used when creating WordPress plugins, troubleshooting security issues, implementing custom post types\u002Ftaxonomies, building admin interfaces, or working with the WordPress database.\n\nUse when: Creating new WordPress plugins, implementing nonces\u002Fsanitization\u002Fescaping, working with $wpdb and prepared statements, building Settings API pages, registering custom post types or taxonomies, implementing REST API endpoints, handling AJAX requests, debugging plugin activation\u002Fdeactivation issues, preventing SQL injection\u002FXSS\u002FCSRF vulnerabilities.\n\nKeywords: wordpress plugin development, wordpress security, wordpress hooks, wordpress filters, wordpress database, wpdb prepare, sanitize_text_field, esc_html, wp_nonce, custom post type, register_post_type, settings api, rest api, admin-ajax, wordpress sql injection, wordpress xss, wordpress csrf, plugin header, activation hook, deactivation hook, wordpress coding standards, wordpress plugin architecture","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fwordpress-plugin-core\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":108,"licenseFileUrl":109,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":18},"01M7AQJ91T970QCFMN9R1EHZXV","webapp-testing","Test local web applications with Playwright. Use when asked to verify frontend functionality, debug UI behavior, capture browser screenshots, or inspect browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":18},"01M7AQJ5E89MS8C5K3GZTY4B48","web-performance-audit","Audit web performance using Chrome DevTools MCP. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed.","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fweb-performance-audit\u002FSKILL.md",[],[]]