@intentsolutionsio/vercel-pack 1.0.0 → 1.0.3

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 (124) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +67 -44
  3. package/package.json +4 -4
  4. package/skills/vercel-advanced-troubleshooting/SKILL.md +185 -195
  5. package/skills/vercel-advanced-troubleshooting/references/errors.md +11 -0
  6. package/skills/vercel-advanced-troubleshooting/references/evidence-collection-framework.md +34 -0
  7. package/skills/vercel-advanced-troubleshooting/references/examples.md +11 -0
  8. package/skills/vercel-advanced-troubleshooting/references/systematic-isolation.md +56 -0
  9. package/skills/vercel-advanced-troubleshooting/references/timing-analysis.md +35 -0
  10. package/skills/vercel-architecture-variants/SKILL.md +227 -216
  11. package/skills/vercel-architecture-variants/references/errors.md +11 -0
  12. package/skills/vercel-architecture-variants/references/examples.md +12 -0
  13. package/skills/vercel-architecture-variants/references/variant-a-monolith-(simple).md +44 -0
  14. package/skills/vercel-architecture-variants/references/variant-b-service-layer-(moderate).md +72 -0
  15. package/skills/vercel-architecture-variants/references/variant-c-microservice-(complex).md +81 -0
  16. package/skills/vercel-ci-integration/SKILL.md +183 -73
  17. package/skills/vercel-ci-integration/references/errors.md +10 -0
  18. package/skills/vercel-ci-integration/references/examples.md +36 -0
  19. package/skills/vercel-ci-integration/references/implementation.md +54 -0
  20. package/skills/vercel-common-errors/SKILL.md +164 -60
  21. package/skills/vercel-common-errors/references/errors.md +53 -0
  22. package/skills/vercel-common-errors/references/examples.md +23 -0
  23. package/skills/vercel-cost-tuning/SKILL.md +158 -145
  24. package/skills/vercel-cost-tuning/references/cost-estimation.md +34 -0
  25. package/skills/vercel-cost-tuning/references/cost-reduction-strategies.md +40 -0
  26. package/skills/vercel-cost-tuning/references/errors.md +11 -0
  27. package/skills/vercel-cost-tuning/references/examples.md +15 -0
  28. package/skills/vercel-data-handling/SKILL.md +202 -155
  29. package/skills/vercel-data-handling/references/errors.md +11 -0
  30. package/skills/vercel-data-handling/references/examples.md +27 -0
  31. package/skills/vercel-data-handling/references/implementation.md +223 -0
  32. package/skills/vercel-debug-bundle/SKILL.md +163 -67
  33. package/skills/vercel-debug-bundle/references/errors.md +12 -0
  34. package/skills/vercel-debug-bundle/references/examples.md +24 -0
  35. package/skills/vercel-debug-bundle/references/implementation.md +54 -0
  36. package/skills/vercel-deploy-integration/SKILL.md +163 -156
  37. package/skills/vercel-deploy-integration/references/errors.md +11 -0
  38. package/skills/vercel-deploy-integration/references/examples.md +21 -0
  39. package/skills/vercel-deploy-integration/references/google-cloud-run.md +36 -0
  40. package/skills/vercel-deploy-integration/references/vercel-deployment.md +35 -0
  41. package/skills/vercel-deploy-preview/SKILL.md +164 -39
  42. package/skills/vercel-edge-functions/SKILL.md +185 -37
  43. package/skills/vercel-enterprise-rbac/SKILL.md +185 -170
  44. package/skills/vercel-enterprise-rbac/references/errors.md +11 -0
  45. package/skills/vercel-enterprise-rbac/references/examples.md +12 -0
  46. package/skills/vercel-enterprise-rbac/references/role-implementation.md +33 -0
  47. package/skills/vercel-enterprise-rbac/references/sso-integration.md +35 -0
  48. package/skills/vercel-hello-world/SKILL.md +141 -55
  49. package/skills/vercel-incident-runbook/SKILL.md +186 -138
  50. package/skills/vercel-incident-runbook/references/errors.md +11 -0
  51. package/skills/vercel-incident-runbook/references/examples.md +10 -0
  52. package/skills/vercel-incident-runbook/references/immediate-actions-by-error-type.md +41 -0
  53. package/skills/vercel-install-auth/SKILL.md +130 -53
  54. package/skills/vercel-known-pitfalls/SKILL.md +235 -233
  55. package/skills/vercel-known-pitfalls/references/errors.md +11 -0
  56. package/skills/vercel-known-pitfalls/references/examples.md +12 -0
  57. package/skills/vercel-load-scale/SKILL.md +197 -204
  58. package/skills/vercel-load-scale/references/capacity-planning.md +47 -0
  59. package/skills/vercel-load-scale/references/errors.md +11 -0
  60. package/skills/vercel-load-scale/references/examples.md +26 -0
  61. package/skills/vercel-load-scale/references/load-testing-with-k6.md +59 -0
  62. package/skills/vercel-load-scale/references/scaling-patterns.md +65 -0
  63. package/skills/vercel-local-dev-loop/SKILL.md +159 -71
  64. package/skills/vercel-local-dev-loop/references/errors.md +11 -0
  65. package/skills/vercel-local-dev-loop/references/examples.md +21 -0
  66. package/skills/vercel-local-dev-loop/references/implementation.md +60 -0
  67. package/skills/vercel-migration-deep-dive/SKILL.md +202 -187
  68. package/skills/vercel-migration-deep-dive/references/errors.md +11 -0
  69. package/skills/vercel-migration-deep-dive/references/examples.md +12 -0
  70. package/skills/vercel-migration-deep-dive/references/implementation-plan.md +80 -0
  71. package/skills/vercel-migration-deep-dive/references/pre-migration-assessment.md +39 -0
  72. package/skills/vercel-multi-env-setup/SKILL.md +167 -164
  73. package/skills/vercel-multi-env-setup/references/configuration-structure.md +59 -0
  74. package/skills/vercel-multi-env-setup/references/errors.md +11 -0
  75. package/skills/vercel-multi-env-setup/references/examples.md +11 -0
  76. package/skills/vercel-observability/SKILL.md +205 -195
  77. package/skills/vercel-observability/references/alert-configuration.md +40 -0
  78. package/skills/vercel-observability/references/errors.md +11 -0
  79. package/skills/vercel-observability/references/examples.md +13 -0
  80. package/skills/vercel-observability/references/metrics-collection.md +65 -0
  81. package/skills/vercel-performance-tuning/SKILL.md +212 -156
  82. package/skills/vercel-performance-tuning/references/caching-strategy.md +49 -0
  83. package/skills/vercel-performance-tuning/references/errors.md +11 -0
  84. package/skills/vercel-performance-tuning/references/examples.md +13 -0
  85. package/skills/vercel-policy-guardrails/SKILL.md +276 -193
  86. package/skills/vercel-policy-guardrails/references/errors.md +11 -0
  87. package/skills/vercel-policy-guardrails/references/eslint-rules.md +46 -0
  88. package/skills/vercel-policy-guardrails/references/examples.md +10 -0
  89. package/skills/vercel-prod-checklist/SKILL.md +219 -94
  90. package/skills/vercel-prod-checklist/references/errors.md +11 -0
  91. package/skills/vercel-prod-checklist/references/examples.md +25 -0
  92. package/skills/vercel-prod-checklist/references/implementation.md +60 -0
  93. package/skills/vercel-rate-limits/SKILL.md +187 -100
  94. package/skills/vercel-rate-limits/references/errors.md +11 -0
  95. package/skills/vercel-rate-limits/references/examples.md +46 -0
  96. package/skills/vercel-rate-limits/references/implementation.md +66 -0
  97. package/skills/vercel-reference-architecture/SKILL.md +226 -180
  98. package/skills/vercel-reference-architecture/references/errors.md +11 -0
  99. package/skills/vercel-reference-architecture/references/examples.md +13 -0
  100. package/skills/vercel-reference-architecture/references/key-components.md +65 -0
  101. package/skills/vercel-reference-architecture/references/project-structure.md +40 -0
  102. package/skills/vercel-reliability-patterns/SKILL.md +272 -211
  103. package/skills/vercel-reliability-patterns/references/circuit-breaker.md +36 -0
  104. package/skills/vercel-reliability-patterns/references/dead-letter-queue.md +48 -0
  105. package/skills/vercel-reliability-patterns/references/errors.md +11 -0
  106. package/skills/vercel-reliability-patterns/references/examples.md +11 -0
  107. package/skills/vercel-reliability-patterns/references/idempotency-keys.md +36 -0
  108. package/skills/vercel-sdk-patterns/SKILL.md +264 -92
  109. package/skills/vercel-sdk-patterns/references/errors.md +11 -0
  110. package/skills/vercel-sdk-patterns/references/examples.md +45 -0
  111. package/skills/vercel-sdk-patterns/references/implementation.md +67 -0
  112. package/skills/vercel-security-basics/SKILL.md +186 -96
  113. package/skills/vercel-security-basics/references/errors.md +10 -0
  114. package/skills/vercel-security-basics/references/examples.md +70 -0
  115. package/skills/vercel-security-basics/references/implementation.md +39 -0
  116. package/skills/vercel-upgrade-migration/SKILL.md +167 -67
  117. package/skills/vercel-upgrade-migration/references/errors.md +10 -0
  118. package/skills/vercel-upgrade-migration/references/examples.md +51 -0
  119. package/skills/vercel-upgrade-migration/references/implementation.md +29 -0
  120. package/skills/vercel-webhooks-events/SKILL.md +208 -132
  121. package/skills/vercel-webhooks-events/references/errors.md +11 -0
  122. package/skills/vercel-webhooks-events/references/event-handler-pattern.md +37 -0
  123. package/skills/vercel-webhooks-events/references/examples.md +16 -0
  124. package/skills/vercel-webhooks-events/references/signature-verification.md +33 -0
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Jeremy Longshore
3
+ Copyright (c) 2026 Jeremy Longshore
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Vercel Skill Pack
2
2
 
3
- > Claude Code skill pack for Vercel integration (30 skills)
3
+ > 30 production-grade Claude Code skills for Vercel deployments, serverless functions, Edge Runtime, and platform operations.
4
+
5
+ Deploy, scale, and operate Vercel applications with real API endpoints (`api.vercel.com/v9/*`), real CLI commands (`vercel deploy`, `vercel env`, `vercel rollback`), real Edge Function patterns (`export const config = { runtime: 'edge' }`), and real error codes (`FUNCTION_INVOCATION_FAILED`, `FUNCTION_THROTTLED`). Every skill contains working code, not placeholders.
6
+
7
+ **Links:** [Vercel Docs](https://vercel.com/docs) | [Vercel REST API](https://vercel.com/docs/rest-api) | [Install](#installation)
8
+
9
+ ---
4
10
 
5
11
  ## Installation
6
12
 
@@ -8,61 +14,78 @@
8
14
  /plugin install vercel-pack@claude-code-plugins-plus
9
15
  ```
10
16
 
11
- ## Skills Included
17
+ ## What's Inside
12
18
 
13
19
  ### Standard Skills (S01-S12)
14
- | Skill | Description |
15
- |-------|-------------|
16
- | `vercel-install-auth` | Install Auth |
17
- | `vercel-hello-world` | Hello World |
18
- | `vercel-local-dev-loop` | Local Dev Loop |
19
- | `vercel-sdk-patterns` | Sdk Patterns |
20
- | `vercel-deploy-preview` | Deploy Preview |
21
- | `vercel-edge-functions` | Edge Functions |
22
- | `vercel-common-errors` | Common Errors |
23
- | `vercel-debug-bundle` | Debug Bundle |
24
- | `vercel-rate-limits` | Rate Limits |
25
- | `vercel-security-basics` | Security Basics |
26
- | `vercel-prod-checklist` | Prod Checklist |
27
- | `vercel-upgrade-migration` | Upgrade Migration |
20
+
21
+ | # | Skill | What It Does |
22
+ |---|-------|-------------|
23
+ | S01 | `vercel-install-auth` | Install CLI, create scoped access tokens, link projects, pull env vars |
24
+ | S02 | `vercel-hello-world` | Deploy minimal project with static page + serverless API route |
25
+ | S03 | `vercel-local-dev-loop` | Run `vercel dev`, manage `.env` files, test functions locally with Vitest |
26
+ | S04 | `vercel-sdk-patterns` | Typed REST API client wrapper with pagination, retry, and error classes |
27
+ | S05 | `vercel-deploy-preview` | Create preview deployments via CLI and API, configure deployment protection |
28
+ | S06 | `vercel-edge-functions` | Build Edge Functions with geo headers, middleware, streaming, Edge Config |
29
+ | S07 | `vercel-common-errors` | Diagnose BUILD_FAILED, FUNCTION_INVOCATION_TIMEOUT, 404s, and env var issues |
30
+ | S08 | `vercel-debug-bundle` | Collect deployment state, function logs, and platform status for support tickets |
31
+ | S09 | `vercel-rate-limits` | Handle API 429s with retry, implement WAF rate limiting with @vercel/firewall |
32
+ | S10 | `vercel-security-basics` | Security headers, CSP, deployment protection, token rotation, secret scoping |
33
+ | S11 | `vercel-prod-checklist` | Production deploy checklist with domain setup, health checks, instant rollback |
34
+ | S12 | `vercel-upgrade-migration` | Upgrade CLI, Node.js runtime, Next.js versions with breaking change detection |
28
35
 
29
36
  ### Pro Skills (P13-P18)
30
- | Skill | Description |
31
- |-------|-------------|
32
- | `vercel-ci-integration` | Ci Integration |
33
- | `vercel-deploy-integration` | Deploy Integration |
34
- | `vercel-webhooks-events` | Webhooks Events |
35
- | `vercel-performance-tuning` | Performance Tuning |
36
- | `vercel-cost-tuning` | Cost Tuning |
37
- | `vercel-reference-architecture` | Reference Architecture |
37
+
38
+ | # | Skill | What It Does |
39
+ |---|-------|-------------|
40
+ | P13 | `vercel-ci-integration` | GitHub Actions workflows for preview on PR, production on merge, test gating |
41
+ | P14 | `vercel-deploy-integration` | Production deploy methods, instant rollback, rolling releases, deploy hooks |
42
+ | P15 | `vercel-webhooks-events` | Handle deployment.ready/error webhooks with HMAC signature verification |
43
+ | P16 | `vercel-performance-tuning` | Edge caching, ISR, cold start elimination, bundle optimization, image optimization |
44
+ | P17 | `vercel-cost-tuning` | Fluid Compute pricing, function memory right-sizing, spend management |
45
+ | P18 | `vercel-reference-architecture` | Layered project structure with typed env vars, lazy DB, health checks |
38
46
 
39
47
  ### Flagship Skills (F19-F24)
40
- | Skill | Description |
41
- |-------|-------------|
42
- | `vercel-multi-env-setup` | Multi Env Setup |
43
- | `vercel-observability` | Observability |
44
- | `vercel-incident-runbook` | Incident Runbook |
45
- | `vercel-data-handling` | Data Handling |
46
- | `vercel-enterprise-rbac` | Enterprise Rbac |
47
- | `vercel-migration-deep-dive` | Migration Deep Dive |
48
+
49
+ | # | Skill | What It Does |
50
+ |---|-------|-------------|
51
+ | F19 | `vercel-multi-env-setup` | Scoped env vars per environment, custom environments, branch-specific domains |
52
+ | F20 | `vercel-observability` | Vercel Analytics, runtime logs, log drains, OpenTelemetry, Sentry integration |
53
+ | F21 | `vercel-incident-runbook` | 5-minute triage, instant rollback procedure, communication templates, postmortem |
54
+ | F22 | `vercel-data-handling` | PII redaction, GDPR data subject requests, data residency via function regions |
55
+ | F23 | `vercel-enterprise-rbac` | Team roles, Access Groups, SAML SSO, audit logging, middleware-level auth |
56
+ | F24 | `vercel-migration-deep-dive` | Migrate from Netlify/AWS/Cloudflare with config mapping and DNS cutover |
48
57
 
49
58
  ### Flagship+ Skills (X25-X30)
50
- | Skill | Description |
51
- |-------|-------------|
52
- | `vercel-advanced-troubleshooting` | Advanced Troubleshooting |
53
- | `vercel-load-scale` | Load Scale |
54
- | `vercel-reliability-patterns` | Reliability Patterns |
55
- | `vercel-policy-guardrails` | Policy Guardrails |
56
- | `vercel-architecture-variants` | Architecture Variants |
57
- | `vercel-known-pitfalls` | Known Pitfalls |
59
+
60
+ | # | Skill | What It Does |
61
+ |---|-------|-------------|
62
+ | X25 | `vercel-advanced-troubleshooting` | Request tracing, cold start analysis, bundle inspection, edge crash debugging |
63
+ | X26 | `vercel-load-scale` | k6/autocannon load tests, Fluid Compute concurrency tuning, capacity planning |
64
+ | X27 | `vercel-reliability-patterns` | Circuit breakers, retry with backoff, stale cache fallback, idempotency keys |
65
+ | X28 | `vercel-policy-guardrails` | ESLint rules, pre-commit credential scanning, CI policy checks, deploy freezes |
66
+ | X29 | `vercel-architecture-variants` | 5 architecture blueprints from static site to multi-zone enterprise |
67
+ | X30 | `vercel-known-pitfalls` | 15 anti-patterns with severity ratings, detection scripts, and fixes |
58
68
 
59
69
  ## Usage
60
70
 
61
- Skills trigger automatically when you discuss Vercel topics. For example:
71
+ Skills trigger automatically when you discuss Vercel topics:
72
+
73
+ - "Help me set up Vercel" triggers `vercel-install-auth`
74
+ - "Deploy my app to production" triggers `vercel-prod-checklist`
75
+ - "My Vercel function is timing out" triggers `vercel-common-errors`
76
+ - "Set up edge middleware for auth" triggers `vercel-edge-functions`
77
+ - "Why is my Vercel bill so high?" triggers `vercel-cost-tuning`
78
+
79
+ ## Key API Endpoints Covered
62
80
 
63
- - "Help me set up Vercel" → triggers `vercel-install-auth`
64
- - "Debug this Vercel error" → triggers `vercel-common-errors`
65
- - "Deploy my Vercel integration" triggers `vercel-deploy-integration`
81
+ | Operation | Method | Endpoint |
82
+ |-----------|--------|----------|
83
+ | List projects | GET | `/v9/projects` |
84
+ | Create deployment | POST | `/v13/deployments` |
85
+ | List deployments | GET | `/v6/deployments` |
86
+ | Manage env vars | GET/POST/PATCH/DELETE | `/v9/projects/{id}/env` |
87
+ | Add domain | POST | `/v9/projects/{id}/domains` |
88
+ | Promote deployment | POST | `/v9/projects/{id}/promote` |
66
89
 
67
90
  ## License
68
91
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentsolutionsio/vercel-pack",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "Claude Code skill pack for Vercel - 30 skills covering deployments, edge functions, preview environments, performance optimization, and production operations",
5
5
  "main": "README.md",
6
6
  "type": "module",
@@ -30,13 +30,13 @@
30
30
  "license": "MIT",
31
31
  "repository": {
32
32
  "type": "git",
33
- "url": "git+https://github.com/jeremylongshore/claude-code-plugins.git",
33
+ "url": "git+https://github.com/jeremylongshore/claude-code-plugins-plus-skills.git",
34
34
  "directory": "plugins/saas-packs/vercel-pack"
35
35
  },
36
36
  "bugs": {
37
- "url": "https://github.com/jeremylongshore/claude-code-plugins/issues"
37
+ "url": "https://github.com/jeremylongshore/claude-code-plugins-plus-skills/issues"
38
38
  },
39
- "homepage": "https://claudecodeplugins.io/plugins/vercel-pack",
39
+ "homepage": "https://tonsofskills.com/learn/vercel/",
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  }
@@ -1,261 +1,251 @@
1
1
  ---
2
2
  name: vercel-advanced-troubleshooting
3
- description: |
4
- Apply Vercel advanced debugging techniques for hard-to-diagnose issues.
5
- Use when standard troubleshooting fails, investigating complex race conditions,
6
- or preparing evidence bundles for Vercel support escalation.
3
+ description: 'Advanced debugging for hard-to-diagnose Vercel issues including cold
4
+ starts, edge errors, and function tracing.
5
+
6
+ Use when standard troubleshooting fails, investigating intermittent failures,
7
+
8
+ or preparing evidence for Vercel support escalation.
9
+
7
10
  Trigger with phrases like "vercel hard bug", "vercel mystery error",
8
- "vercel impossible to debug", "difficult vercel issue", "vercel deep debug".
9
- allowed-tools: Read, Grep, Bash(kubectl:*), Bash(curl:*), Bash(tcpdump:*)
11
+
12
+ "vercel intermittent failure", "difficult vercel issue", "vercel deep debug".
13
+
14
+ '
15
+ allowed-tools: Read, Grep, Bash(vercel:*), Bash(curl:*), Bash(jq:*)
10
16
  version: 1.0.0
11
17
  license: MIT
12
18
  author: Jeremy Longshore <jeremy@intentsolutions.io>
19
+ tags:
20
+ - saas
21
+ - vercel
22
+ - debugging
23
+ - advanced
24
+ - troubleshooting
25
+ compatibility: Designed for Claude Code, also compatible with Codex and OpenClaw
13
26
  ---
14
-
15
27
  # Vercel Advanced Troubleshooting
16
28
 
17
29
  ## Overview
18
- Deep debugging techniques for complex Vercel issues that resist standard troubleshooting.
30
+
31
+ Diagnose hard-to-find Vercel issues: intermittent cold start failures, edge function crashes, region-specific behavior, function bundling problems, and serverless concurrency issues. Uses systematic isolation, request tracing, and Vercel-specific debugging techniques.
19
32
 
20
33
  ## Prerequisites
21
- - Access to production logs and metrics
22
- - kubectl access to clusters
23
- - Network capture tools available
24
- - Understanding of distributed tracing
25
34
 
26
- ## Evidence Collection Framework
35
+ - Vercel CLI with access to production logs
36
+ - Familiarity with `vercel-common-errors` (standard debugging)
37
+ - `curl` and `jq` for API inspection
38
+ - Access to deployment inspection tools
39
+
40
+ ## Instructions
41
+
42
+ ### Step 1: Request-Level Tracing
27
43
 
28
- ### Comprehensive Debug Bundle
29
44
  ```bash
30
- #!/bin/bash
31
- # advanced-vercel-debug.sh
45
+ # Trace a single request through Vercel's edge network
46
+ curl -v https://yourdomain.com/api/endpoint 2>&1 | grep -E "x-vercel|cf-ray|age|cache"
47
+
48
+ # Key headers to check:
49
+ # x-vercel-id: <region>::<function-id> — which region served the request
50
+ # x-vercel-cache: HIT/MISS/STALE — edge cache status
51
+ # x-vercel-execution-region: iad1 — function execution region
52
+ # age: 45 — seconds since edge cached the response
53
+ # x-matched-path: /api/endpoint — routing match result
54
+ ```
55
+
56
+ ### Step 2: Cold Start Investigation
32
57
 
33
- BUNDLE="vercel-advanced-debug-$(date +%Y%m%d-%H%M%S)"
34
- mkdir -p "$BUNDLE"/{logs,metrics,network,config,traces}
58
+ ```typescript
59
+ // Instrument cold start timing in your function
60
+ let coldStart = true;
61
+ const initTime = Date.now();
62
+
63
+ export default function handler(req, res) {
64
+ const isCold = coldStart;
65
+ coldStart = false;
66
+
67
+ const handlerStart = Date.now();
68
+ // ... your logic ...
69
+
70
+ res.setHeader('x-cold-start', String(isCold));
71
+ res.setHeader('x-init-duration', String(handlerStart - initTime));
72
+ res.json({
73
+ coldStart: isCold,
74
+ initDuration: isCold ? handlerStart - initTime : 0,
75
+ handlerDuration: Date.now() - handlerStart,
76
+ region: process.env.VERCEL_REGION,
77
+ });
78
+ }
79
+ ```
35
80
 
36
- # 1. Extended logs (1 hour window)
37
- kubectl logs -l app=vercel-integration --since=1h > "$BUNDLE/logs/pods.log"
38
- journalctl -u vercel-service --since "1 hour ago" > "$BUNDLE/logs/system.log"
81
+ ```bash
82
+ # Measure cold start frequency over N requests
83
+ for i in $(seq 1 20); do
84
+ curl -s https://yourdomain.com/api/endpoint \
85
+ | jq '{coldStart, initDuration, region}'
86
+ sleep 2 # Wait between requests to allow isolate recycling
87
+ done
88
+ ```
39
89
 
40
- # 2. Metrics dump
41
- curl -s localhost:9090/api/v1/query?query=vercel_requests_total > "$BUNDLE/metrics/requests.json"
42
- curl -s localhost:9090/api/v1/query?query=vercel_errors_total > "$BUNDLE/metrics/errors.json"
90
+ ### Step 3: Function Bundle Analysis
43
91
 
44
- # 3. Network capture (30 seconds)
45
- timeout 30 tcpdump -i any port 443 -w "$BUNDLE/network/capture.pcap" &
92
+ ```bash
93
+ # Check what's being bundled into your function
94
+ vercel inspect https://my-app-xxx.vercel.app
46
95
 
47
- # 4. Distributed traces
48
- curl -s localhost:16686/api/traces?service=vercel > "$BUNDLE/traces/jaeger.json"
96
+ # Check function sizes in the deployment
97
+ curl -s -H "Authorization: Bearer $VERCEL_TOKEN" \
98
+ "https://api.vercel.com/v13/deployments/dpl_xxx" \
99
+ | jq '.functions | to_entries[] | {path: .key, size: .value.size, regions: .value.regions}'
49
100
 
50
- # 5. Configuration state
51
- kubectl get cm vercel-config -o yaml > "$BUNDLE/config/configmap.yaml"
52
- kubectl get secret vercel-secrets -o yaml > "$BUNDLE/config/secrets-redacted.yaml"
101
+ # Locally check what @vercel/nft traces for a function
102
+ npx @vercel/nft print api/heavy-endpoint.ts 2>/dev/null | head -50
103
+ # Shows all files that will be bundled
53
104
 
54
- tar -czf "$BUNDLE.tar.gz" "$BUNDLE"
55
- echo "Advanced debug bundle: $BUNDLE.tar.gz"
105
+ # Find unexpectedly large dependencies
106
+ npx @vercel/nft print api/heavy-endpoint.ts 2>/dev/null \
107
+ | xargs -I {} du -sh {} 2>/dev/null | sort -rh | head -20
56
108
  ```
57
109
 
58
- ## Systematic Isolation
59
-
60
- ### Layer-by-Layer Testing
110
+ ### Step 4: Region-Specific Debugging
61
111
 
62
- ```typescript
63
- // Test each layer independently
64
- async function diagnoseVercelIssue(): Promise<DiagnosisReport> {
65
- const results: DiagnosisResult[] = [];
112
+ ```bash
113
+ # Test from different regions to isolate geographic issues
114
+ # Use Vercel's deployment URL with region hints
115
+ for region in iad1 sfo1 cdg1 hnd1; do
116
+ echo "=== Region: $region ==="
117
+ curl -s -w "HTTP %{http_code} | Time: %{time_total}s\n" \
118
+ -H "x-vercel-ip-country: US" \
119
+ https://yourdomain.com/api/endpoint
120
+ done
121
+
122
+ # Check if the issue is region-dependent
123
+ # If latency varies wildly, check:
124
+ # 1. Function region vs database region (cross-region latency)
125
+ # 2. Edge middleware adding delay
126
+ # 3. External API calls from wrong region
127
+ ```
66
128
 
67
- // Layer 1: Network connectivity
68
- results.push(await testNetworkConnectivity());
129
+ ### Step 5: Edge Function Crash Debugging
69
130
 
70
- // Layer 2: DNS resolution
71
- results.push(await testDNSResolution('api.vercel.com'));
131
+ ```typescript
132
+ // Edge functions crash silently on Node.js API usage
133
+ // Common crashes and their symptoms:
72
134
 
73
- // Layer 3: TLS handshake
74
- results.push(await testTLSHandshake('api.vercel.com'));
135
+ // Symptom: EDGE_FUNCTION_INVOCATION_FAILED with no error details
136
+ // Cause: Using Node.js Buffer, fs, crypto.createHash in edge runtime
75
137
 
76
- // Layer 4: Authentication
77
- results.push(await testAuthentication());
138
+ // Diagnostic: check if imports are edge-compatible
139
+ export const config = { runtime: 'edge' };
78
140
 
79
- // Layer 5: API response
80
- results.push(await testAPIResponse());
141
+ export default function handler(request: Request) {
142
+ // This will crash silently:
143
+ // const hash = require('crypto').createHash('sha256');
81
144
 
82
- // Layer 6: Response parsing
83
- results.push(await testResponseParsing());
145
+ // Use Web Crypto instead:
146
+ const encoder = new TextEncoder();
147
+ const data = encoder.encode('test');
148
+ const hashBuffer = await crypto.subtle.digest('SHA-256', data);
84
149
 
85
- return { results, firstFailure: results.find(r => !r.success) };
150
+ return Response.json({ ok: true });
86
151
  }
87
152
  ```
88
153
 
89
- ### Minimal Reproduction
90
-
91
- ```typescript
92
- // Strip down to absolute minimum
93
- async function minimalRepro(): Promise<void> {
94
- // 1. Fresh client, no customization
95
- const client = new VercelClient({
96
- apiKey: process.env.VERCEL_API_KEY!,
97
- });
98
-
99
- // 2. Simplest possible call
100
- try {
101
- const result = await client.ping();
102
- console.log('Ping successful:', result);
103
- } catch (error) {
104
- console.error('Ping failed:', {
105
- message: error.message,
106
- code: error.code,
107
- stack: error.stack,
108
- });
109
- }
110
- }
154
+ ```bash
155
+ # Check if a module is edge-compatible
156
+ npx edge-runtime --eval "import('your-module')" 2>&1
157
+ # Errors here mean the module won't work in edge functions
111
158
  ```
112
159
 
113
- ## Timing Analysis
160
+ ### Step 6: Concurrency and Throttling Debug
114
161
 
115
- ```typescript
116
- class TimingAnalyzer {
117
- private timings: Map<string, number[]> = new Map();
118
-
119
- async measure<T>(label: string, fn: () => Promise<T>): Promise<T> {
120
- const start = performance.now();
121
- try {
122
- return await fn();
123
- } finally {
124
- const duration = performance.now() - start;
125
- const existing = this.timings.get(label) || [];
126
- existing.push(duration);
127
- this.timings.set(label, existing);
128
- }
129
- }
130
-
131
- report(): TimingReport {
132
- const report: TimingReport = {};
133
- for (const [label, times] of this.timings) {
134
- report[label] = {
135
- count: times.length,
136
- min: Math.min(...times),
137
- max: Math.max(...times),
138
- avg: times.reduce((a, b) => a + b, 0) / times.length,
139
- p95: this.percentile(times, 95),
140
- };
141
- }
142
- return report;
143
- }
144
- }
145
- ```
162
+ ```bash
163
+ # Check current function concurrency limits
164
+ curl -s -H "Authorization: Bearer $VERCEL_TOKEN" \
165
+ "https://api.vercel.com/v9/projects/my-app" \
166
+ | jq '{plan: .plan, concurrency: .concurrencyBucketName}'
146
167
 
147
- ## Memory and Resource Analysis
168
+ # Hobby: 10 concurrent, Pro: 1000, Enterprise: 100000
148
169
 
149
- ```typescript
150
- // Detect memory leaks in Vercel client usage
151
- const heapUsed: number[] = [];
152
-
153
- setInterval(() => {
154
- const usage = process.memoryUsage();
155
- heapUsed.push(usage.heapUsed);
156
-
157
- // Alert on sustained growth
158
- if (heapUsed.length > 60) { // 1 hour at 1/min
159
- const trend = heapUsed[59] - heapUsed[0];
160
- if (trend > 100 * 1024 * 1024) { // 100MB growth
161
- console.warn('Potential memory leak in vercel integration');
162
- }
163
- }
164
- }, 60000);
170
+ # Load test to find throttling threshold
171
+ npx autocannon -c 50 -d 10 https://yourdomain.com/api/endpoint
172
+ # Watch for 429 responses indicating FUNCTION_THROTTLED
165
173
  ```
166
174
 
167
- ## Race Condition Detection
175
+ ### Step 7: Systematic Isolation
168
176
 
169
- ```typescript
170
- // Detect concurrent access issues
171
- class VercelConcurrencyChecker {
172
- private inProgress: Set<string> = new Set();
173
-
174
- async execute<T>(key: string, fn: () => Promise<T>): Promise<T> {
175
- if (this.inProgress.has(key)) {
176
- console.warn(`Concurrent access detected for ${key}`);
177
- }
178
-
179
- this.inProgress.add(key);
180
- try {
181
- return await fn();
182
- } finally {
183
- this.inProgress.delete(key);
184
- }
185
- }
186
- }
187
177
  ```
178
+ Issue persists? Isolate systematically:
188
179
 
189
- ## Support Escalation Template
180
+ 1. Does it happen on preview deployments?
181
+ └── No → Production-only env var or domain issue
190
182
 
191
- ```markdown
192
- ## Vercel Support Escalation
183
+ 2. Does it happen with a minimal function?
184
+ └── No → Issue is in your code, not Vercel platform
193
185
 
194
- **Severity:** P[1-4]
195
- **Request ID:** [from error response]
196
- **Timestamp:** [ISO 8601]
186
+ 3. Does it happen in all regions?
187
+ └── No Region-specific infrastructure issue
197
188
 
198
- ### Issue Summary
199
- [One paragraph description]
189
+ 4. Does it happen with edge runtime?
190
+ └── No → Node.js-specific issue (cold starts, module compat)
200
191
 
201
- ### Steps to Reproduce
202
- 1. [Step 1]
203
- 2. [Step 2]
192
+ 5. Does it happen without middleware?
193
+ └── No → Middleware is interfering — check matcher scope
204
194
 
205
- ### Expected vs Actual
206
- - Expected: [behavior]
207
- - Actual: [behavior]
195
+ 6. Create minimal reproduction:
196
+ └── api/test.ts with only the failing behavior
197
+ └── Deploy standalone and test
198
+ ```
208
199
 
209
- ### Evidence Attached
210
- - [ ] Debug bundle (vercel-advanced-debug-*.tar.gz)
211
- - [ ] Minimal reproduction code
212
- - [ ] Timing analysis
213
- - [ ] Network capture (if relevant)
200
+ ### Step 8: Vercel Support Escalation
214
201
 
215
- ### Workarounds Attempted
216
- 1. [Workaround 1] - Result: [outcome]
217
- 2. [Workaround 2] - Result: [outcome]
218
- ```
202
+ ```bash
203
+ # Collect comprehensive evidence
204
+ mkdir vercel-debug && cd vercel-debug
219
205
 
220
- ## Instructions
206
+ # Deployment details
207
+ vercel inspect https://yourdomain.com > inspect.txt
208
+ vercel logs https://yourdomain.com --limit=200 > logs.txt
221
209
 
222
- ### Step 1: Collect Evidence Bundle
223
- Run the comprehensive debug script to gather all relevant data.
210
+ # Request trace
211
+ curl -v https://yourdomain.com/api/failing-endpoint 2>&1 > curl-trace.txt
224
212
 
225
- ### Step 2: Systematic Isolation
226
- Test each layer independently to identify the failure point.
213
+ # Function analysis
214
+ curl -s -H "Authorization: Bearer $VERCEL_TOKEN" \
215
+ "https://api.vercel.com/v13/deployments/dpl_xxx" > deployment.json
227
216
 
228
- ### Step 3: Create Minimal Reproduction
229
- Strip down to the simplest failing case.
217
+ # Platform status at time of issue
218
+ curl -s "https://www.vercel-status.com/api/v2/summary.json" > status.json
230
219
 
231
- ### Step 4: Escalate with Evidence
232
- Use the support template with all collected evidence.
220
+ tar czf vercel-debug-$(date +%Y%m%d).tar.gz .
221
+ ```
233
222
 
234
223
  ## Output
235
- - Comprehensive debug bundle collected
236
- - Failure layer identified
237
- - Minimal reproduction created
238
- - Support escalation submitted
239
224
 
240
- ## Error Handling
241
- | Issue | Cause | Solution |
242
- |-------|-------|----------|
243
- | Can't reproduce | Race condition | Add timing analysis |
244
- | Intermittent failure | Timing-dependent | Increase sample size |
245
- | No useful logs | Missing instrumentation | Add debug logging |
246
- | Memory growth | Resource leak | Use heap profiling |
225
+ - Request traced through Vercel's edge network with region and cache data
226
+ - Cold start frequency and duration quantified
227
+ - Function bundle analyzed for size issues
228
+ - Issue isolated to specific layer (edge, runtime, region, middleware)
229
+ - Evidence bundle ready for support escalation
247
230
 
248
- ## Examples
231
+ ## Error Handling
249
232
 
250
- ### Quick Layer Test
251
- ```bash
252
- # Test each layer in sequence
253
- curl -v https://api.vercel.com/health 2>&1 | grep -E "(Connected|TLS|HTTP)"
254
- ```
233
+ | Symptom | Likely Cause | Debug Approach |
234
+ |---------|-------------|---------------|
235
+ | Intermittent 500 errors | Cold start + unhandled async | Add global error handler, check init code |
236
+ | Latency spikes every ~15 min | Function isolate recycling (cold start) | Measure with x-cold-start header |
237
+ | Works in preview, fails in prod | Env var scope mismatch | Compare env vars across environments |
238
+ | EDGE_FUNCTION_INVOCATION_FAILED | Node.js API in edge runtime | Check imports for Node.js-only modules |
239
+ | Function works locally, fails deployed | Missing dependency or env var | Run `vercel build` locally, check output |
255
240
 
256
241
  ## Resources
257
- - [Vercel Support Portal](https://support.vercel.com)
258
- - [Vercel Status Page](https://www.vercel-status.com)
242
+
243
+ - [Vercel Error Codes](https://vercel.com/docs/errors)
244
+ - [Function Limitations](https://vercel.com/docs/functions/limitations)
245
+ - [Edge Runtime API](https://vercel.com/docs/functions/runtimes/edge)
246
+ - [Vercel Support](https://vercel.com/support)
247
+ - [@vercel/nft](https://github.com/vercel/nft)
259
248
 
260
249
  ## Next Steps
261
- For load testing, see `vercel-load-scale`.
250
+
251
+ For load testing and scaling, see `vercel-load-scale`.
@@ -0,0 +1,11 @@
1
+ # Error Handling Reference
2
+
3
+ | Issue | Cause | Solution |
4
+ |-------|-------|----------|
5
+ | Can't reproduce | Race condition | Add timing analysis |
6
+ | Intermittent failure | Timing-dependent | Increase sample size |
7
+ | No useful logs | Missing instrumentation | Add debug logging |
8
+ | Memory growth | Resource leak | Use heap profiling |
9
+
10
+ ---
11
+ *[Tons of Skills](https://tonsofskills.com) by [Intent Solutions](https://intentsolutions.io) | [jeremylongshore.com](https://jeremylongshore.com)*