opencode-skills-collection 1.0.186 → 1.0.187

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +5 -1
  2. package/bundled-skills/3d-web-experience/SKILL.md +152 -37
  3. package/bundled-skills/agent-evaluation/SKILL.md +1088 -26
  4. package/bundled-skills/agent-memory-systems/SKILL.md +1037 -25
  5. package/bundled-skills/agent-tool-builder/SKILL.md +668 -16
  6. package/bundled-skills/ai-agents-architect/SKILL.md +271 -31
  7. package/bundled-skills/ai-product/SKILL.md +716 -26
  8. package/bundled-skills/ai-wrapper-product/SKILL.md +450 -44
  9. package/bundled-skills/algolia-search/SKILL.md +867 -15
  10. package/bundled-skills/autonomous-agents/SKILL.md +1033 -26
  11. package/bundled-skills/aws-serverless/SKILL.md +1046 -35
  12. package/bundled-skills/azure-functions/SKILL.md +1318 -19
  13. package/bundled-skills/browser-automation/SKILL.md +1065 -28
  14. package/bundled-skills/browser-extension-builder/SKILL.md +159 -32
  15. package/bundled-skills/bullmq-specialist/SKILL.md +347 -16
  16. package/bundled-skills/clerk-auth/SKILL.md +796 -15
  17. package/bundled-skills/computer-use-agents/SKILL.md +1870 -28
  18. package/bundled-skills/context-window-management/SKILL.md +271 -18
  19. package/bundled-skills/conversation-memory/SKILL.md +453 -24
  20. package/bundled-skills/crewai/SKILL.md +252 -46
  21. package/bundled-skills/discord-bot-architect/SKILL.md +1207 -34
  22. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  23. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  24. package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
  25. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  26. package/bundled-skills/docs/users/bundles.md +1 -1
  27. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  28. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  29. package/bundled-skills/docs/users/getting-started.md +1 -1
  30. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  31. package/bundled-skills/docs/users/usage.md +4 -4
  32. package/bundled-skills/docs/users/visual-guide.md +4 -4
  33. package/bundled-skills/email-systems/SKILL.md +646 -26
  34. package/bundled-skills/faf-expert/SKILL.md +221 -0
  35. package/bundled-skills/faf-wizard/SKILL.md +252 -0
  36. package/bundled-skills/file-uploads/SKILL.md +212 -11
  37. package/bundled-skills/firebase/SKILL.md +646 -16
  38. package/bundled-skills/gcp-cloud-run/SKILL.md +1117 -32
  39. package/bundled-skills/graphql/SKILL.md +1026 -27
  40. package/bundled-skills/hubspot-integration/SKILL.md +804 -19
  41. package/bundled-skills/idea-darwin/SKILL.md +120 -0
  42. package/bundled-skills/inngest/SKILL.md +431 -16
  43. package/bundled-skills/interactive-portfolio/SKILL.md +342 -44
  44. package/bundled-skills/langfuse/SKILL.md +296 -41
  45. package/bundled-skills/langgraph/SKILL.md +259 -50
  46. package/bundled-skills/micro-saas-launcher/SKILL.md +343 -44
  47. package/bundled-skills/neon-postgres/SKILL.md +572 -15
  48. package/bundled-skills/nextjs-supabase-auth/SKILL.md +269 -21
  49. package/bundled-skills/notion-template-business/SKILL.md +371 -44
  50. package/bundled-skills/personal-tool-builder/SKILL.md +537 -44
  51. package/bundled-skills/plaid-fintech/SKILL.md +825 -19
  52. package/bundled-skills/prompt-caching/SKILL.md +438 -25
  53. package/bundled-skills/rag-engineer/SKILL.md +271 -29
  54. package/bundled-skills/salesforce-development/SKILL.md +912 -19
  55. package/bundled-skills/satori/SKILL.md +54 -0
  56. package/bundled-skills/scroll-experience/SKILL.md +381 -44
  57. package/bundled-skills/segment-cdp/SKILL.md +817 -19
  58. package/bundled-skills/shopify-apps/SKILL.md +1475 -19
  59. package/bundled-skills/slack-bot-builder/SKILL.md +1162 -28
  60. package/bundled-skills/telegram-bot-builder/SKILL.md +152 -37
  61. package/bundled-skills/telegram-mini-app/SKILL.md +445 -44
  62. package/bundled-skills/trigger-dev/SKILL.md +916 -27
  63. package/bundled-skills/twilio-communications/SKILL.md +1310 -28
  64. package/bundled-skills/upstash-qstash/SKILL.md +898 -27
  65. package/bundled-skills/vercel-deployment/SKILL.md +637 -39
  66. package/bundled-skills/viral-generator-builder/SKILL.md +132 -37
  67. package/bundled-skills/voice-agents/SKILL.md +937 -27
  68. package/bundled-skills/voice-ai-development/SKILL.md +375 -46
  69. package/bundled-skills/workflow-automation/SKILL.md +982 -29
  70. package/bundled-skills/zapier-make-patterns/SKILL.md +772 -27
  71. package/package.json +1 -1
@@ -1,32 +1,14 @@
1
1
  ---
2
2
  name: vercel-deployment
3
- description: "Expert knowledge for deploying to Vercel with Next.js Use when: vercel, deploy, deployment, hosting, production."
3
+ description: Expert knowledge for deploying to Vercel with Next.js
4
4
  risk: safe
5
- source: "vibeship-spawner-skills (Apache 2.0)"
6
- date_added: "2026-02-27"
5
+ source: vibeship-spawner-skills (Apache 2.0)
6
+ date_added: 2026-02-27
7
7
  ---
8
8
 
9
9
  # Vercel Deployment
10
10
 
11
- You are a Vercel deployment expert. You understand the platform's
12
- capabilities, limitations, and best practices for deploying Next.js
13
- applications at scale.
14
-
15
- ## When to Use This Skill
16
-
17
- Use this skill when:
18
- - Deploying to Vercel
19
- - Working with Vercel deployment
20
- - Hosting applications on Vercel
21
- - Deploying to production on Vercel
22
- - Configuring Vercel for Next.js applications
23
-
24
- Your core principles:
25
- 1. Environment variables - different for dev/preview/production
26
- 2. Edge vs Serverless - choose the right runtime
27
- 3. Build optimization - minimize cold starts and bundle size
28
- 4. Preview deployments - use for testing before production
29
- 5. Monitoring - set up analytics and error tracking
11
+ Expert knowledge for deploying to Vercel with Next.js
30
12
 
31
13
  ## Capabilities
32
14
 
@@ -36,9 +18,9 @@ Your core principles:
36
18
  - serverless
37
19
  - environment-variables
38
20
 
39
- ## Requirements
21
+ ## Prerequisites
40
22
 
41
- - nextjs-app-router
23
+ - Required skills: nextjs-app-router
42
24
 
43
25
  ## Patterns
44
26
 
@@ -46,35 +28,651 @@ Your core principles:
46
28
 
47
29
  Properly configure environment variables for all environments
48
30
 
31
+ **When to use**: Setting up a new project on Vercel
32
+
33
+ // Three environments in Vercel:
34
+ // - Development (local)
35
+ // - Preview (PR deployments)
36
+ // - Production (main branch)
37
+
38
+ // In Vercel Dashboard:
39
+ // Settings → Environment Variables
40
+
41
+ // PUBLIC variables (exposed to browser)
42
+ NEXT_PUBLIC_SUPABASE_URL=https://xxx.supabase.co
43
+ NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ...
44
+
45
+ // PRIVATE variables (server only)
46
+ SUPABASE_SERVICE_ROLE_KEY=eyJ... // Never NEXT_PUBLIC_!
47
+ DATABASE_URL=postgresql://...
48
+
49
+ // Per-environment values:
50
+ // Production: Real database, production API keys
51
+ // Preview: Staging database, test API keys
52
+ // Development: Local/dev values (also in .env.local)
53
+
54
+ // In code, check environment:
55
+ const isProduction = process.env.VERCEL_ENV === 'production'
56
+ const isPreview = process.env.VERCEL_ENV === 'preview'
57
+
49
58
  ### Edge vs Serverless Functions
50
59
 
51
60
  Choose the right runtime for your API routes
52
61
 
62
+ **When to use**: Creating API routes or middleware
63
+
64
+ // EDGE RUNTIME - Fast cold starts, limited APIs
65
+ // Good for: Auth checks, redirects, simple transforms
66
+
67
+ // app/api/hello/route.ts
68
+ export const runtime = 'edge'
69
+
70
+ export async function GET() {
71
+ return Response.json({ message: 'Hello from Edge!' })
72
+ }
73
+
74
+ // middleware.ts (always edge)
75
+ export function middleware(request: NextRequest) {
76
+ // Fast auth checks here
77
+ }
78
+
79
+ // SERVERLESS (Node.js) - Full Node APIs, slower cold start
80
+ // Good for: Database queries, file operations, heavy computation
81
+
82
+ // app/api/users/route.ts
83
+ export const runtime = 'nodejs' // Default, can omit
84
+
85
+ export async function GET() {
86
+ const users = await db.query('SELECT * FROM users')
87
+ return Response.json(users)
88
+ }
89
+
53
90
  ### Build Optimization
54
91
 
55
92
  Optimize build for faster deployments and smaller bundles
56
93
 
57
- ## Anti-Patterns
94
+ **When to use**: Preparing for production deployment
95
+
96
+ // next.config.js
97
+ /** @type {import('next').NextConfig} */
98
+ const nextConfig = {
99
+ // Minimize output
100
+ output: 'standalone', // For Docker/self-hosting
101
+
102
+ // Image optimization
103
+ images: {
104
+ remotePatterns: [
105
+ { hostname: 'your-cdn.com' },
106
+ ],
107
+ },
108
+
109
+ // Bundle analyzer (dev only)
110
+ // npm install @next/bundle-analyzer
111
+ ...(process.env.ANALYZE === 'true' && {
112
+ webpack: (config) => {
113
+ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
114
+ config.plugins.push(new BundleAnalyzerPlugin())
115
+ return config
116
+ },
117
+ }),
118
+ }
119
+
120
+ // Reduce serverless function size:
121
+ // - Use dynamic imports for heavy libs
122
+ // - Check bundle with: npx @next/bundle-analyzer
123
+
124
+ ### Preview Deployment Workflow
125
+
126
+ Use preview deployments for PR reviews
127
+
128
+ **When to use**: Setting up team development workflow
129
+
130
+ // Every PR gets a unique preview URL automatically
131
+
132
+ // Protect preview deployments with password:
133
+ // Vercel Dashboard → Settings → Deployment Protection
134
+
135
+ // Use different env vars for preview:
136
+ // - PREVIEW: Use staging database
137
+ // - PRODUCTION: Use production database
138
+
139
+ // In code, detect preview:
140
+ if (process.env.VERCEL_ENV === 'preview') {
141
+ // Show "Preview" banner
142
+ // Use test payment processor
143
+ // Disable analytics
144
+ }
145
+
146
+ // Comment preview URL on PR (automatic with Vercel GitHub integration)
147
+
148
+ ### Custom Domain Setup
149
+
150
+ Configure custom domains with proper SSL
151
+
152
+ **When to use**: Going to production
153
+
154
+ // In Vercel Dashboard → Domains
155
+
156
+ // Add domains:
157
+ // - example.com (apex/root)
158
+ // - www.example.com (subdomain)
159
+
160
+ // DNS Configuration (at your registrar):
161
+ // Type: A, Name: @, Value: 76.76.21.21
162
+ // Type: CNAME, Name: www, Value: cname.vercel-dns.com
163
+
164
+ // Redirect www to apex (or vice versa):
165
+ // Vercel handles this automatically
166
+
167
+ // In next.config.js for redirects:
168
+ module.exports = {
169
+ async redirects() {
170
+ return [
171
+ {
172
+ source: '/old-page',
173
+ destination: '/new-page',
174
+ permanent: true, // 308
175
+ },
176
+ ]
177
+ },
178
+ }
179
+
180
+ ## Sharp Edges
181
+
182
+ ### NEXT_PUBLIC_ exposes secrets to the browser
183
+
184
+ Severity: CRITICAL
185
+
186
+ Situation: Using NEXT_PUBLIC_ prefix for sensitive API keys
187
+
188
+ Symptoms:
189
+ - Secrets visible in browser DevTools → Sources
190
+ - Security audit finds exposed keys
191
+ - Unexpected API access from unknown sources
192
+
193
+ Why this breaks:
194
+ Variables prefixed with NEXT_PUBLIC_ are inlined into the JavaScript
195
+ bundle at build time. Anyone can view them in browser DevTools.
196
+ This includes all your users and potential attackers.
197
+
198
+ Recommended fix:
199
+
200
+ Only use NEXT_PUBLIC_ for truly public values:
201
+
202
+ // SAFE to use NEXT_PUBLIC_
203
+ NEXT_PUBLIC_SUPABASE_URL=https://xxx.supabase.co
204
+ NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ... // Anon key is designed to be public
205
+ NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_...
206
+ NEXT_PUBLIC_GA_ID=G-XXXXXXX
207
+
208
+ // NEVER use NEXT_PUBLIC_
209
+ SUPABASE_SERVICE_ROLE_KEY=eyJ... // Full database access!
210
+ STRIPE_SECRET_KEY=sk_live_... // Can charge cards!
211
+ DATABASE_URL=postgresql://... // Direct DB access!
212
+ JWT_SECRET=... // Can forge tokens!
213
+
214
+ // Access server-only vars in:
215
+ // - Server Components (app router)
216
+ // - API Routes
217
+ // - Server Actions ('use server')
218
+ // - getServerSideProps (pages router)
219
+
220
+ ### Preview deployments using production database
221
+
222
+ Severity: HIGH
223
+
224
+ Situation: Not configuring separate environment variables for preview
225
+
226
+ Symptoms:
227
+ - Test data appearing in production
228
+ - Production data corrupted after PR merge
229
+ - Users seeing test accounts/content
230
+
231
+ Why this breaks:
232
+ Preview deployments run untested code. If they use production database,
233
+ a bug in a PR can corrupt production data. Also, testers might create
234
+ test data that shows up in production.
235
+
236
+ Recommended fix:
237
+
238
+ Set up separate databases for each environment:
239
+
240
+ // In Vercel Dashboard → Settings → Environment Variables
241
+
242
+ // Production (production env only):
243
+ DATABASE_URL=postgresql://prod-host/prod-db
244
+
245
+ // Preview (preview env only):
246
+ DATABASE_URL=postgresql://staging-host/staging-db
247
+
248
+ // Or use Vercel's branching databases:
249
+ // - Neon, PlanetScale, Supabase all support branch databases
250
+ // - Auto-create preview DB for each PR
251
+
252
+ // For Supabase, create a staging project:
253
+ // Production:
254
+ NEXT_PUBLIC_SUPABASE_URL=https://prod-xxx.supabase.co
255
+
256
+ // Preview:
257
+ NEXT_PUBLIC_SUPABASE_URL=https://staging-xxx.supabase.co
258
+
259
+ ### Serverless function too large, slow cold starts
260
+
261
+ Severity: HIGH
262
+
263
+ Situation: API route or server component has slow initial load
264
+
265
+ Symptoms:
266
+ - First request takes 3-10+ seconds
267
+ - Subsequent requests are fast
268
+ - Function size limit exceeded error
269
+ - Deployment fails with size error
270
+
271
+ Why this breaks:
272
+ Vercel serverless functions have a 50MB limit (compressed).
273
+ Large functions mean slow cold starts (1-5+ seconds).
274
+ Heavy dependencies like puppeteer, sharp can cause this.
275
+
276
+ Recommended fix:
277
+
278
+ Reduce function size:
279
+
280
+ // 1. Use dynamic imports for heavy libs
281
+ export async function GET() {
282
+ const sharp = await import('sharp') // Only loads when needed
283
+ // ...
284
+ }
285
+
286
+ // 2. Move heavy processing to edge or external service
287
+ export const runtime = 'edge' // Much smaller, faster cold start
288
+
289
+ // 3. Check bundle size
290
+ // npx @next/bundle-analyzer
291
+ // Look for large dependencies
292
+
293
+ // 4. Use external services for heavy tasks
294
+ // - Image processing: Cloudinary, imgix
295
+ // - PDF generation: API service
296
+ // - Puppeteer: Browserless.io
297
+
298
+ // 5. Split into multiple functions
299
+ // /api/heavy-task/start - Queue the job
300
+ // /api/heavy-task/status - Check progress
301
+
302
+ ### Edge runtime missing Node.js APIs
303
+
304
+ Severity: HIGH
305
+
306
+ Situation: Using Node.js APIs in edge runtime functions
307
+
308
+ Symptoms:
309
+ - X is not defined at runtime
310
+ - Cannot find module fs
311
+ - Works locally, fails deployed
312
+ - Middleware crashes
313
+
314
+ Why this breaks:
315
+ Edge runtime runs on V8, not Node.js. Many Node APIs are missing:
316
+ fs, path, crypto (partial), child_process, and most native modules.
317
+ Your code will fail at runtime with "X is not defined".
318
+
319
+ Recommended fix:
320
+
321
+ Check API compatibility before using edge:
322
+
323
+ // SUPPORTED in Edge:
324
+ // - fetch, Request, Response
325
+ // - crypto.subtle (Web Crypto)
326
+ // - TextEncoder, TextDecoder
327
+ // - URL, URLSearchParams
328
+ // - Headers, FormData
329
+ // - setTimeout, setInterval
330
+
331
+ // NOT SUPPORTED in Edge:
332
+ // - fs, path, os
333
+ // - Buffer (use Uint8Array)
334
+ // - crypto.createHash (use crypto.subtle)
335
+ // - Most npm packages with native deps
336
+
337
+ // If you need Node.js APIs:
338
+ export const runtime = 'nodejs' // Use Node runtime instead
339
+
340
+ // For crypto hashing in edge:
341
+ // WRONG
342
+ import { createHash } from 'crypto' // Fails in edge
343
+
344
+ // RIGHT
345
+ async function hash(message: string) {
346
+ const encoder = new TextEncoder()
347
+ const data = encoder.encode(message)
348
+ const hashBuffer = await crypto.subtle.digest('SHA-256', data)
349
+ return Array.from(new Uint8Array(hashBuffer))
350
+ .map(b => b.toString(16).padStart(2, '0'))
351
+ .join('')
352
+ }
353
+
354
+ ### Function timeout causes incomplete operations
355
+
356
+ Severity: MEDIUM
357
+
358
+ Situation: Long-running operations timing out
58
359
 
59
- ### ❌ Secrets in NEXT_PUBLIC_
360
+ Symptoms:
361
+ - Task timed out after X seconds
362
+ - Incomplete database operations
363
+ - Partial file uploads
364
+ - Function killed mid-execution
60
365
 
61
- ### Same Database for Preview
366
+ Why this breaks:
367
+ Vercel has timeout limits:
368
+ - Hobby: 10 seconds
369
+ - Pro: 60 seconds (can increase to 300)
370
+ - Enterprise: 900 seconds
62
371
 
63
- ### No Build Cache
372
+ Operations exceeding this are killed mid-execution.
64
373
 
65
- ## ⚠️ Sharp Edges
374
+ Recommended fix:
66
375
 
67
- | Issue | Severity | Solution |
68
- |-------|----------|----------|
69
- | NEXT_PUBLIC_ exposes secrets to the browser | critical | Only use NEXT_PUBLIC_ for truly public values: |
70
- | Preview deployments using production database | high | Set up separate databases for each environment: |
71
- | Serverless function too large, slow cold starts | high | Reduce function size: |
72
- | Edge runtime missing Node.js APIs | high | Check API compatibility before using edge: |
73
- | Function timeout causes incomplete operations | medium | Handle long operations properly: |
74
- | Environment variable missing at runtime but present at build | medium | Understand when env vars are read: |
75
- | CORS errors calling API routes from different domain | medium | Add CORS headers to API routes: |
76
- | Page shows stale data after deployment | medium | Control caching behavior: |
376
+ Handle long operations properly:
377
+
378
+ // 1. Return early, process async
379
+ export async function POST(request: Request) {
380
+ const data = await request.json()
381
+
382
+ // Queue for background processing
383
+ await queue.add('process-data', data)
384
+
385
+ // Return immediately
386
+ return Response.json({ status: 'queued' })
387
+ }
388
+
389
+ // 2. Use streaming for long responses
390
+ export async function GET() {
391
+ const stream = new ReadableStream({
392
+ async start(controller) {
393
+ for (const chunk of generateChunks()) {
394
+ controller.enqueue(chunk)
395
+ await sleep(100) // Prevents timeout
396
+ }
397
+ controller.close()
398
+ }
399
+ })
400
+ return new Response(stream)
401
+ }
402
+
403
+ // 3. Use external services for heavy processing
404
+ // - Trigger serverless function, return job ID
405
+ // - Process in background (Inngest, Trigger.dev)
406
+ // - Client polls for completion
407
+
408
+ // 4. Increase timeout (Pro plan)
409
+ // vercel.json:
410
+ {
411
+ "functions": {
412
+ "app/api/slow/route.ts": {
413
+ "maxDuration": 60
414
+ }
415
+ }
416
+ }
417
+
418
+ ### Environment variable missing at runtime but present at build
419
+
420
+ Severity: MEDIUM
421
+
422
+ Situation: Environment variable works in build but undefined at runtime
423
+
424
+ Symptoms:
425
+ - Env var is undefined in production
426
+ - Value doesn't change after updating in dashboard
427
+ - Works in dev, wrong value in production
428
+ - Requires redeploy to update value
429
+
430
+ Why this breaks:
431
+ Some env vars are only available at build time (hardcoded into bundle).
432
+ If you expect a runtime value but it was baked in at build, you get
433
+ the build-time value or undefined.
434
+
435
+ Recommended fix:
436
+
437
+ Understand when env vars are read:
438
+
439
+ // BUILD TIME (baked into bundle):
440
+ // - NEXT_PUBLIC_* variables
441
+ // - next.config.js
442
+ // - generateStaticParams
443
+ // - Static pages
444
+
445
+ // RUNTIME (read on each request):
446
+ // - Server Components (without cache)
447
+ // - API Routes
448
+ // - Server Actions
449
+ // - Middleware
450
+
451
+ // To force runtime reading:
452
+ export const dynamic = 'force-dynamic'
453
+
454
+ // For config that must be runtime:
455
+ // Don't use NEXT_PUBLIC_, read on server and pass to client
456
+
457
+ // Check which env vars you need:
458
+ // Build: URLs, public keys, feature flags (if static)
459
+ // Runtime: Secrets, database URLs, user-specific config
460
+
461
+ ### CORS errors calling API routes from different domain
462
+
463
+ Severity: MEDIUM
464
+
465
+ Situation: Frontend on different domain can't call API routes
466
+
467
+ Symptoms:
468
+ - CORS policy error in browser console
469
+ - No Access-Control-Allow-Origin header
470
+ - Requests work in Postman but not browser
471
+ - Works same-origin, fails cross-origin
472
+
473
+ Why this breaks:
474
+ By default, browsers block cross-origin requests. Vercel doesn't
475
+ automatically add CORS headers. If your frontend is on a different
476
+ domain (or localhost in dev), requests fail.
477
+
478
+ Recommended fix:
479
+
480
+ Add CORS headers to API routes:
481
+
482
+ // app/api/data/route.ts
483
+ export async function GET(request: Request) {
484
+ const data = await fetchData()
485
+
486
+ return Response.json(data, {
487
+ headers: {
488
+ 'Access-Control-Allow-Origin': '*', // Or specific domain
489
+ 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
490
+ 'Access-Control-Allow-Headers': 'Content-Type, Authorization',
491
+ },
492
+ })
493
+ }
494
+
495
+ // Handle preflight requests
496
+ export async function OPTIONS() {
497
+ return new Response(null, {
498
+ headers: {
499
+ 'Access-Control-Allow-Origin': '*',
500
+ 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
501
+ 'Access-Control-Allow-Headers': 'Content-Type, Authorization',
502
+ },
503
+ })
504
+ }
505
+
506
+ // Or use next.config.js for all routes:
507
+ module.exports = {
508
+ async headers() {
509
+ return [
510
+ {
511
+ source: '/api/:path*',
512
+ headers: [
513
+ { key: 'Access-Control-Allow-Origin', value: '*' },
514
+ ],
515
+ },
516
+ ]
517
+ },
518
+ }
519
+
520
+ ### Page shows stale data after deployment
521
+
522
+ Severity: MEDIUM
523
+
524
+ Situation: Updated data not appearing after new deployment
525
+
526
+ Symptoms:
527
+ - Old content shows after deploy
528
+ - Changes not visible immediately
529
+ - Different users see different versions
530
+ - Data updates but page doesn't
531
+
532
+ Why this breaks:
533
+ Vercel caches aggressively. Static pages are cached at the edge.
534
+ Even dynamic pages may be cached if not configured properly.
535
+ Old cached versions served until cache expires or is purged.
536
+
537
+ Recommended fix:
538
+
539
+ Control caching behavior:
540
+
541
+ // Force no caching (always fresh)
542
+ export const dynamic = 'force-dynamic'
543
+ export const revalidate = 0
544
+
545
+ // ISR - revalidate every 60 seconds
546
+ export const revalidate = 60
547
+
548
+ // On-demand revalidation (after mutation)
549
+ import { revalidatePath, revalidateTag } from 'next/cache'
550
+
551
+ // In Server Action:
552
+ async function updatePost(id: string) {
553
+ await db.post.update({ ... })
554
+ revalidatePath(`/posts/${id}`) // Purge this page
555
+ revalidateTag('posts') // Purge all with this tag
556
+ }
557
+
558
+ // Purge via API (deployment hook):
559
+ // POST https://your-site.vercel.app/api/revalidate?path=/posts
560
+
561
+ // Check caching in response headers:
562
+ // x-vercel-cache: HIT = served from cache
563
+ // x-vercel-cache: MISS = freshly generated
564
+
565
+ ## Validation Checks
566
+
567
+ ### Secret in NEXT_PUBLIC Variable
568
+
569
+ Severity: CRITICAL
570
+
571
+ Message: Secret exposed via NEXT_PUBLIC_ prefix. This will be visible in browser.
572
+
573
+ Fix action: Remove NEXT_PUBLIC_ prefix and access only in server-side code
574
+
575
+ ### Hardcoded Vercel URL
576
+
577
+ Severity: WARNING
578
+
579
+ Message: Hardcoded Vercel URL. Use VERCEL_URL environment variable instead.
580
+
581
+ Fix action: Use process.env.VERCEL_URL or NEXT_PUBLIC_VERCEL_URL
582
+
583
+ ### Node.js API in Edge Runtime
584
+
585
+ Severity: ERROR
586
+
587
+ Message: Node.js module used in Edge runtime. fs/path not available in Edge.
588
+
589
+ Fix action: Use runtime = 'nodejs' or remove Node.js dependencies
590
+
591
+ ### API Route Without CORS Headers
592
+
593
+ Severity: WARNING
594
+
595
+ Message: API route without CORS headers may fail cross-origin requests.
596
+
597
+ Fix action: Add Access-Control-Allow-Origin header if API is called from other domains
598
+
599
+ ### API Route Without Error Handling
600
+
601
+ Severity: WARNING
602
+
603
+ Message: API route without try/catch. Unhandled errors return 500 without details.
604
+
605
+ Fix action: Wrap in try/catch and return appropriate error responses
606
+
607
+ ### Secret Read in Static Context
608
+
609
+ Severity: WARNING
610
+
611
+ Message: Server secret accessed in static generation. Value baked into build.
612
+
613
+ Fix action: Move secret access to runtime code or use NEXT_PUBLIC_ for public values
614
+
615
+ ### Large Package Import
616
+
617
+ Severity: WARNING
618
+
619
+ Message: Large package imported. May cause slow cold starts. Consider alternatives.
620
+
621
+ Fix action: Use lodash-es with tree shaking, date-fns instead of moment, @aws-sdk/client-* instead of aws-sdk
622
+
623
+ ### Dynamic Page Without Revalidation Config
624
+
625
+ Severity: WARNING
626
+
627
+ Message: Dynamic page without revalidation config. Consider setting revalidation strategy.
628
+
629
+ Fix action: Add export const revalidate = 60 for ISR, or 0 for no cache
630
+
631
+ ## Collaboration
632
+
633
+ ### Delegation Triggers
634
+
635
+ - next.js|app router|pages|server components -> nextjs-app-router (Deployment needs Next.js patterns)
636
+ - database|supabase|backend -> supabase-backend (Deployment needs database)
637
+ - auth|authentication|session -> nextjs-supabase-auth (Deployment needs auth config)
638
+ - monitoring|logs|errors|analytics -> analytics-architecture (Deployment needs monitoring)
639
+
640
+ ### Production Launch
641
+
642
+ Skills: vercel-deployment, nextjs-app-router, supabase-backend, nextjs-supabase-auth
643
+
644
+ Workflow:
645
+
646
+ ```
647
+ 1. App configuration (nextjs-app-router)
648
+ 2. Database setup (supabase-backend)
649
+ 3. Auth config (nextjs-supabase-auth)
650
+ 4. Deploy (vercel-deployment)
651
+ ```
652
+
653
+ ### CI/CD Pipeline
654
+
655
+ Skills: vercel-deployment, devops, qa-engineering
656
+
657
+ Workflow:
658
+
659
+ ```
660
+ 1. Test automation (qa-engineering)
661
+ 2. Pipeline config (devops)
662
+ 3. Deploy strategy (vercel-deployment)
663
+ ```
77
664
 
78
665
  ## Related Skills
79
666
 
80
667
  Works well with: `nextjs-app-router`, `supabase-backend`
668
+
669
+ ## When to Use
670
+
671
+ - User mentions or implies: vercel
672
+ - User mentions or implies: deploy
673
+ - User mentions or implies: deployment
674
+ - User mentions or implies: hosting
675
+ - User mentions or implies: production
676
+ - User mentions or implies: environment variables
677
+ - User mentions or implies: edge function
678
+ - User mentions or implies: serverless function