@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
@@ -1,96 +1,182 @@
1
1
  ---
2
2
  name: vercel-hello-world
3
- description: |
4
- Create a minimal working Vercel example.
5
- Use when starting a new Vercel integration, testing your setup,
6
- or learning basic Vercel API patterns.
3
+ description: 'Create a minimal working Vercel deployment with a serverless API route.
4
+
5
+ Use when starting a new Vercel project, testing your setup,
6
+
7
+ or learning basic Vercel deployment and API route patterns.
8
+
7
9
  Trigger with phrases like "vercel hello world", "vercel example",
8
- "vercel quick start", "simple vercel code".
9
- allowed-tools: Read, Write, Edit
10
+
11
+ "vercel quick start", "simple vercel project", "first vercel deploy".
12
+
13
+ '
14
+ allowed-tools: Read, Write, Edit, Bash(vercel:*), Bash(npm:*), Bash(npx:*), Bash(curl:*)
10
15
  version: 1.0.0
11
16
  license: MIT
12
17
  author: Jeremy Longshore <jeremy@intentsolutions.io>
18
+ tags:
19
+ - saas
20
+ - vercel
21
+ - api
22
+ - quickstart
23
+ - deployment
24
+ compatibility: Designed for Claude Code, also compatible with Codex and OpenClaw
13
25
  ---
14
-
15
26
  # Vercel Hello World
16
27
 
17
28
  ## Overview
18
- Minimal working example demonstrating core Vercel functionality.
29
+
30
+ Deploy a minimal project to Vercel with a static page and a serverless API route. Confirms your CLI auth, project structure, and deployment pipeline work end to end.
19
31
 
20
32
  ## Prerequisites
33
+
21
34
  - Completed `vercel-install-auth` setup
22
- - Valid API credentials configured
23
- - Development environment ready
35
+ - Vercel CLI installed and authenticated
36
+ - Node.js 18+
24
37
 
25
38
  ## Instructions
26
39
 
27
- ### Step 1: Create Entry File
28
- Create a new file for your hello world example.
40
+ ### Step 1: Create Project Structure
29
41
 
30
- ### Step 2: Import and Initialize Client
31
- ```typescript
32
- import { VercelClient } from 'vercel';
42
+ ```bash
43
+ mkdir my-vercel-app && cd my-vercel-app
44
+ npm init -y
45
+ ```
33
46
 
34
- const client = new VercelClient({
35
- apiKey: process.env.VERCEL_API_KEY,
36
- });
47
+ Create the static landing page:
48
+
49
+ ```html
50
+ <!-- public/index.html -->
51
+ <!DOCTYPE html>
52
+ <html>
53
+ <head><title>Hello Vercel</title></head>
54
+ <body>
55
+ <h1>Hello from Vercel</h1>
56
+ <p id="result">Loading...</p>
57
+ <script>
58
+ fetch('/api/hello')
59
+ .then(r => r.json())
60
+ .then(d => document.getElementById('result').textContent = d.message);
61
+ </script>
62
+ </body>
63
+ </html>
37
64
  ```
38
65
 
39
- ### Step 3: Make Your First API Call
66
+ ### Step 2: Create Serverless API Route
67
+
40
68
  ```typescript
41
- async function main() {
42
- const projects = await vercel.projects.list(); console.log('Projects:', projects.map(p => p.name));
69
+ // api/hello.ts
70
+ import type { VercelRequest, VercelResponse } from '@vercel/node';
71
+
72
+ export default function handler(req: VercelRequest, res: VercelResponse) {
73
+ res.status(200).json({
74
+ message: 'Hello from Vercel Serverless Function!',
75
+ timestamp: new Date().toISOString(),
76
+ region: process.env.VERCEL_REGION || 'local',
77
+ });
43
78
  }
44
-
45
- main().catch(console.error);
46
79
  ```
47
80
 
48
- ## Output
49
- - Working code file with Vercel client initialization
50
- - Successful API response confirming connection
51
- - Console output showing:
81
+ Install the types:
82
+
83
+ ```bash
84
+ npm install --save-dev @vercel/node typescript
52
85
  ```
53
- Success! Your Vercel connection is working.
86
+
87
+ ### Step 3: Add vercel.json Configuration
88
+
89
+ ```json
90
+ {
91
+ "rewrites": [
92
+ { "source": "/api/(.*)", "destination": "/api/$1" }
93
+ ],
94
+ "headers": [
95
+ {
96
+ "source": "/api/(.*)",
97
+ "headers": [
98
+ { "key": "Cache-Control", "value": "s-maxage=0, stale-while-revalidate" }
99
+ ]
100
+ }
101
+ ]
102
+ }
54
103
  ```
55
104
 
56
- ## Error Handling
57
- | Error | Cause | Solution |
58
- |-------|-------|----------|
59
- | Import Error | SDK not installed | Verify with `npm list` or `pip show` |
60
- | Auth Error | Invalid credentials | Check environment variable is set |
61
- | Timeout | Network issues | Increase timeout or check connectivity |
62
- | Rate Limit | Too many requests | Wait and retry with exponential backoff |
105
+ ### Step 4: Deploy Preview
63
106
 
64
- ## Examples
107
+ ```bash
108
+ # Deploy to a preview URL (not production)
109
+ vercel
65
110
 
66
- ### TypeScript Example
67
- ```typescript
68
- import { VercelClient } from 'vercel';
111
+ # Output:
112
+ # Vercel CLI 39.x.x
113
+ # 🔗 Linked to your-team/my-vercel-app
114
+ # 🔍 Inspect: https://vercel.com/your-team/my-vercel-app/xxx
115
+ # ✅ Preview: https://my-vercel-app-xxx.vercel.app
116
+ ```
69
117
 
70
- const client = new VercelClient({
71
- apiKey: process.env.VERCEL_API_KEY,
72
- });
118
+ ### Step 5: Test the Deployment
73
119
 
74
- async function main() {
75
- const projects = await vercel.projects.list(); console.log('Projects:', projects.map(p => p.name));
76
- }
120
+ ```bash
121
+ # Test static page
122
+ curl -s https://my-vercel-app-xxx.vercel.app/ | head -5
77
123
 
78
- main().catch(console.error);
124
+ # Test API route
125
+ curl -s https://my-vercel-app-xxx.vercel.app/api/hello | jq .
126
+ # {
127
+ # "message": "Hello from Vercel Serverless Function!",
128
+ # "timestamp": "2026-03-22T12:00:00.000Z",
129
+ # "region": "iad1"
130
+ # }
79
131
  ```
80
132
 
81
- ### Python Example
82
- ```python
83
- from None import VercelClient
133
+ ### Step 6: Promote to Production
84
134
 
85
- client = VercelClient()
135
+ ```bash
136
+ # Deploy directly to production
137
+ vercel --prod
86
138
 
87
- None
139
+ # Or promote the preview deployment
140
+ vercel promote https://my-vercel-app-xxx.vercel.app
88
141
  ```
89
142
 
143
+ ## Vercel System Environment Variables
144
+
145
+ These are available in every function at runtime:
146
+
147
+ | Variable | Value |
148
+ |----------|-------|
149
+ | `VERCEL` | `"1"` — always set on Vercel |
150
+ | `VERCEL_ENV` | `"production"`, `"preview"`, or `"development"` |
151
+ | `VERCEL_URL` | Deployment URL (no protocol) |
152
+ | `VERCEL_REGION` | Function region (e.g., `iad1`) |
153
+ | `VERCEL_GIT_COMMIT_SHA` | Git commit hash |
154
+ | `VERCEL_GIT_COMMIT_MESSAGE` | Git commit message |
155
+
156
+ ## Output
157
+
158
+ - Static page served from Vercel CDN
159
+ - Serverless API route returning JSON at `/api/hello`
160
+ - Preview URL for testing before production
161
+ - Production deployment live on your domain
162
+
163
+ ## Error Handling
164
+
165
+ | Error | Cause | Solution |
166
+ |-------|-------|----------|
167
+ | `404 NOT_FOUND` on `/api/hello` | File not in `api/` directory | Move file to project root `api/` folder |
168
+ | `FUNCTION_INVOCATION_FAILED` | Runtime error in handler | Check function logs: `vercel logs <url>` |
169
+ | `BUILD_FAILED` | TypeScript compilation error | Run `npx tsc --noEmit` locally first |
170
+ | `NO_RESPONSE_FROM_FUNCTION` | Handler didn't call `res.send/json` | Ensure all code paths return a response |
171
+ | `FUNCTION_PAYLOAD_TOO_LARGE` | Response body > 4.5 MB | Paginate or stream the response |
172
+
90
173
  ## Resources
91
- - [Vercel Getting Started](https://vercel.com/docs/getting-started)
92
- - [Vercel API Reference](https://vercel.com/docs/api)
93
- - [Vercel Examples](https://vercel.com/docs/examples)
174
+
175
+ - [Vercel Serverless Functions](https://vercel.com/docs/functions)
176
+ - [Vercel Project Configuration](https://vercel.com/docs/project-configuration)
177
+ - [Vercel CLI Deploy](https://vercel.com/docs/cli/deploy)
178
+ - [@vercel/node Runtime](https://vercel.com/docs/functions/runtimes/node-js)
94
179
 
95
180
  ## Next Steps
96
- Proceed to `vercel-local-dev-loop` for development workflow setup.
181
+
182
+ Proceed to `vercel-local-dev-loop` for development workflow setup.
@@ -1,203 +1,251 @@
1
1
  ---
2
2
  name: vercel-incident-runbook
3
- description: |
4
- Execute Vercel incident response procedures with triage, mitigation, and postmortem.
5
- Use when responding to Vercel-related outages, investigating errors,
6
- or running post-incident reviews for Vercel integration failures.
3
+ description: 'Vercel incident response procedures with triage, instant rollback, and
4
+ postmortem.
5
+
6
+ Use when responding to Vercel-related outages, investigating production errors,
7
+
8
+ or running post-incident reviews for deployment failures.
9
+
7
10
  Trigger with phrases like "vercel incident", "vercel outage",
11
+
8
12
  "vercel down", "vercel on-call", "vercel emergency", "vercel broken".
9
- allowed-tools: Read, Grep, Bash(kubectl:*), Bash(curl:*)
13
+
14
+ '
15
+ allowed-tools: Read, Grep, Bash(vercel:*), Bash(curl:*)
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
+ - incident-response
23
+ - runbook
24
+ compatibility: Designed for Claude Code, also compatible with Codex and OpenClaw
13
25
  ---
14
-
15
26
  # Vercel Incident Runbook
16
27
 
17
28
  ## Overview
18
- Rapid incident response procedures for Vercel-related outages.
29
+
30
+ Step-by-step incident response for Vercel deployment failures, function errors, and platform outages. Covers rapid triage, instant rollback, communication templates, and postmortem procedures.
19
31
 
20
32
  ## Prerequisites
21
- - Access to Vercel dashboard and status page
22
- - kubectl access to production cluster
23
- - Prometheus/Grafana access
24
- - Communication channels (Slack, PagerDuty)
25
33
 
26
- ## Severity Levels
34
+ - Access to Vercel dashboard and CLI
35
+ - Access to Vercel status page (vercel-status.com)
36
+ - Communication channels (Slack, PagerDuty) configured
37
+ - Log drain or runtime log access
27
38
 
28
- | Level | Definition | Response Time | Examples |
29
- |-------|------------|---------------|----------|
30
- | P1 | Complete outage | < 15 min | Vercel API unreachable |
31
- | P2 | Degraded service | < 1 hour | High latency, partial failures |
32
- | P3 | Minor impact | < 4 hours | Webhook delays, non-critical errors |
33
- | P4 | No user impact | Next business day | Monitoring gaps |
39
+ ## Instructions
34
40
 
35
- ## Quick Triage
41
+ ### Step 1: Rapid Triage (First 5 Minutes)
36
42
 
37
43
  ```bash
38
- # 1. Check Vercel status
39
- curl -s https://www.vercel-status.com | jq
44
+ # 1. Check if it's a Vercel platform issue
45
+ curl -s "https://www.vercel-status.com/api/v2/summary.json" \
46
+ | jq '.status.description, [.components[] | select(.status != "operational") | {name, status}]'
40
47
 
41
- # 2. Check our integration health
42
- curl -s https://api.yourapp.com/health | jq '.services.vercel'
48
+ # 2. Check current production deployment status
49
+ vercel ls --prod
50
+ vercel inspect $(vercel ls --prod --json | jq -r '.[0].url')
43
51
 
44
- # 3. Check error rate (last 5 min)
45
- curl -s localhost:9090/api/v1/query?query=rate(vercel_errors_total[5m])
52
+ # 3. Check recent deployments did a deploy just happen?
53
+ curl -s -H "Authorization: Bearer $VERCEL_TOKEN" \
54
+ "https://api.vercel.com/v6/deployments?target=production&limit=5&projectId=prj_xxx" \
55
+ | jq '.deployments[] | {uid, state, createdAt: (.createdAt/1000 | todate), url}'
46
56
 
47
- # 4. Recent error logs
48
- kubectl logs -l app=vercel-integration --since=5m | grep -i error | tail -20
57
+ # 4. Check function logs for errors
58
+ vercel logs $(vercel ls --prod --json | jq -r '.[0].url') --level=error --limit=20
49
59
  ```
50
60
 
51
- ## Decision Tree
61
+ ### Step 2: Decision Tree
52
62
 
53
63
  ```
54
- Vercel API returning errors?
55
- ├─ YES: Is status.vercel.com showing incident?
56
- ├─ YES Wait for Vercel to resolve. Enable fallback.
57
- └─ NO Our integration issue. Check credentials, config.
58
- └─ NO: Is our service healthy?
59
- ├─ YES → Likely resolved or intermittent. Monitor.
60
- └─ NO → Our infrastructure issue. Check pods, memory, network.
64
+ Is vercel-status.com showing an incident?
65
+ ├── YES Vercel platform issue
66
+ ├── Subscribe to updates on status page
67
+ ├── Post internal status: "Vercel platform incident monitoring"
68
+ │ └── No action needed from us — wait for Vercel resolution
69
+
70
+ └── NO → Issue is in our deployment
71
+ ├── Did a deployment happen in the last 30 minutes?
72
+ │ ├── YES → Likely deployment regression
73
+ │ │ └── ROLLBACK immediately (Step 3)
74
+ │ └── NO → Application-level issue
75
+ │ ├── Check function logs for new errors
76
+ │ ├── Check external dependency status (DB, APIs)
77
+ │ └── Investigate and hotfix (Step 4)
78
+
79
+ └── Is the issue region-specific?
80
+ ├── YES → Check function regions, possible edge issue
81
+ └── NO → Global issue, check code and env vars
61
82
  ```
62
83
 
63
- ## Immediate Actions by Error Type
84
+ ### Step 3: Instant Rollback (< 30 Seconds)
64
85
 
65
- ### 401/403 - Authentication
66
86
  ```bash
67
- # Verify API key is set
68
- kubectl get secret vercel-secrets -o jsonpath='{.data.api-key}' | base64 -d
69
-
70
- # Check if key was rotated
71
- # Verify in Vercel dashboard
72
-
73
- # Remediation: Update secret and restart pods
74
- kubectl create secret generic vercel-secrets --from-literal=api-key=NEW_KEY --dry-run=client -o yaml | kubectl apply -f -
75
- kubectl rollout restart deployment/vercel-integration
87
+ # Option A: Rollback to previous production deployment (fastest)
88
+ vercel rollback
89
+ # This instantly swaps production traffic — no rebuild needed
90
+
91
+ # Option B: Rollback to a specific known-good deployment
92
+ vercel rollback dpl_xxxxxxxxxxxx
93
+
94
+ # Option C: Via API (for automation/PagerDuty integration)
95
+ curl -X POST "https://api.vercel.com/v9/projects/my-app/promote" \
96
+ -H "Authorization: Bearer $VERCEL_TOKEN" \
97
+ -H "Content-Type: application/json" \
98
+ -d '{"deploymentId": "dpl_known_good_id"}'
99
+
100
+ # Verify rollback succeeded
101
+ vercel ls --prod
102
+ curl -s https://yourdomain.com/api/health | jq .
76
103
  ```
77
104
 
78
- ### 429 - Rate Limited
79
- ```bash
80
- # Check rate limit headers
81
- curl -v https://api.vercel.com 2>&1 | grep -i rate
82
-
83
- # Enable request queuing
84
- kubectl set env deployment/vercel-integration RATE_LIMIT_MODE=queue
105
+ ### Step 4: Investigate Root Cause
85
106
 
86
- # Long-term: Contact Vercel for limit increase
87
- ```
88
-
89
- ### 500/503 - Vercel Errors
90
107
  ```bash
91
- # Enable graceful degradation
92
- kubectl set env deployment/vercel-integration VERCEL_FALLBACK=true
108
+ # Collect evidence while it's fresh
109
+ mkdir incident-$(date +%Y%m%d)
110
+ cd incident-$(date +%Y%m%d)
93
111
 
94
- # Notify users of degraded service
95
- # Update status page
112
+ # Function logs around the incident time
113
+ vercel logs https://yourdomain.com --limit=200 > function-logs.txt
96
114
 
97
- # Monitor Vercel status for resolution
98
- ```
115
+ # Deployment diff what changed?
116
+ curl -s -H "Authorization: Bearer $VERCEL_TOKEN" \
117
+ "https://api.vercel.com/v13/deployments/dpl_broken" \
118
+ | jq '.meta' > broken-deployment-meta.json
99
119
 
100
- ## Communication Templates
120
+ # Compare env vars between working and broken deployments
121
+ vercel env ls > env-vars.txt
101
122
 
102
- ### Internal (Slack)
103
- ```
104
- 🔴 P1 INCIDENT: Vercel Integration
105
- Status: INVESTIGATING
106
- Impact: [Describe user impact]
107
- Current action: [What you're doing]
108
- Next update: [Time]
109
- Incident commander: @[name]
123
+ # Check git diff between last good and broken commit
124
+ git log --oneline -10
125
+ git diff dpl_good_commit..dpl_broken_commit -- api/ src/
110
126
  ```
111
127
 
112
- ### External (Status Page)
128
+ ### Step 5: Enable Maintenance Page (If Needed)
129
+
130
+ ```json
131
+ // vercel.json — temporary maintenance mode via rewrite
132
+ {
133
+ "rewrites": [
134
+ {
135
+ "source": "/((?!_next|api/health).*)",
136
+ "destination": "/maintenance.html"
137
+ }
138
+ ]
139
+ }
113
140
  ```
114
- Vercel Integration Issue
115
-
116
- We're experiencing issues with our Vercel integration.
117
- Some users may experience [specific impact].
118
141
 
119
- We're actively investigating and will provide updates.
120
-
121
- Last updated: [timestamp]
142
+ ```html
143
+ <!-- public/maintenance.html -->
144
+ <!DOCTYPE html>
145
+ <html>
146
+ <head><title>Maintenance</title></head>
147
+ <body>
148
+ <h1>We'll be right back</h1>
149
+ <p>We're performing scheduled maintenance. Please check back shortly.</p>
150
+ </body>
151
+ </html>
122
152
  ```
123
153
 
124
- ## Post-Incident
154
+ ### Step 6: Communication Templates
125
155
 
126
- ### Evidence Collection
127
- ```bash
128
- # Generate debug bundle
129
- ./scripts/vercel-debug-bundle.sh
156
+ **Internal Slack (Incident Start)**
130
157
 
131
- # Export relevant logs
132
- kubectl logs -l app=vercel-integration --since=1h > incident-logs.txt
133
-
134
- # Capture metrics
135
- curl "localhost:9090/api/v1/query_range?query=vercel_errors_total&start=2h" > metrics.json
158
+ ```
159
+ :rotating_light: INCIDENT: [Project Name] production issue detected
160
+ Status: Investigating
161
+ Impact: [Description of user impact]
162
+ Start time: [UTC timestamp]
163
+ On-call: @[engineer]
164
+ Thread: replies here
136
165
  ```
137
166
 
138
- ### Postmortem Template
139
- ```markdown
140
- ## Incident: Vercel [Error Type]
141
- **Date:** YYYY-MM-DD
142
- **Duration:** X hours Y minutes
143
- **Severity:** P[1-4]
144
-
145
- ### Summary
146
- [1-2 sentence description]
147
-
148
- ### Timeline
149
- - HH:MM - [Event]
150
- - HH:MM - [Event]
167
+ **Internal Slack (Mitigation)**
151
168
 
152
- ### Root Cause
153
- [Technical explanation]
169
+ ```
170
+ :white_check_mark: MITIGATED: [Project Name]
171
+ Action: Rolled back to deployment dpl_xxx
172
+ Impact duration: [X minutes]
173
+ Root cause: [Brief description]
174
+ Postmortem: [link] scheduled for [date]
175
+ ```
154
176
 
155
- ### Impact
156
- - Users affected: N
157
- - Revenue impact: $X
177
+ **External — Status Page**
158
178
 
159
- ### Action Items
160
- - [ ] [Preventive measure] - Owner - Due date
179
+ ```
180
+ Title: Degraded performance on [service]
181
+ Body: We are investigating reports of [issue]. Some users may experience
182
+ [impact]. Our team is actively working on a resolution.
183
+ Update: The issue has been resolved. [Brief root cause].
161
184
  ```
162
185
 
163
- ## Instructions
164
-
165
- ### Step 1: Quick Triage
166
- Run the triage commands to identify the issue source.
186
+ ### Step 7: Postmortem Template
167
187
 
168
- ### Step 2: Follow Decision Tree
169
- Determine if the issue is Vercel-side or internal.
188
+ ```markdown
189
+ # Incident Postmortem: [Title]
190
+
191
+ ## Summary
192
+ - Duration: [start] to [end] ([X minutes])
193
+ - Impact: [users/requests affected]
194
+ - Severity: [P1/P2/P3]
195
+
196
+ ## Timeline (UTC)
197
+ - HH:MM — [event]
198
+ - HH:MM — Alert fired
199
+ - HH:MM — On-call acknowledged
200
+ - HH:MM — Root cause identified
201
+ - HH:MM — Rollback executed
202
+ - HH:MM — Service restored
203
+
204
+ ## Root Cause
205
+ [What broke and why]
206
+
207
+ ## Resolution
208
+ [What was done to fix it]
209
+
210
+ ## Action Items
211
+ - [ ] [Preventive action] — Owner: @xxx — Due: [date]
212
+ - [ ] [Detection improvement] — Owner: @xxx — Due: [date]
213
+ - [ ] [Process improvement] — Owner: @xxx — Due: [date]
214
+ ```
170
215
 
171
- ### Step 3: Execute Immediate Actions
172
- Apply the appropriate remediation for the error type.
216
+ ## Incident Severity Levels
173
217
 
174
- ### Step 4: Communicate Status
175
- Update internal and external stakeholders.
218
+ | Severity | Definition | Response Time | Rollback? |
219
+ |----------|-----------|---------------|-----------|
220
+ | P1 | Production down, all users affected | < 5 min | Immediate |
221
+ | P2 | Degraded, some users affected | < 15 min | If not fixable in 30 min |
222
+ | P3 | Minor issue, workaround exists | < 1 hour | No |
223
+ | P4 | Cosmetic or non-urgent | Next business day | No |
176
224
 
177
225
  ## Output
178
- - Issue identified and categorized
179
- - Remediation applied
180
- - Stakeholders notified
181
- - Evidence collected for postmortem
226
+
227
+ - Incident categorized and triaged within 5 minutes
228
+ - Instant rollback executed if deployment regression detected
229
+ - Communication sent to internal and external stakeholders
230
+ - Postmortem scheduled with action items
182
231
 
183
232
  ## Error Handling
184
- | Issue | Cause | Solution |
185
- |-------|-------|----------|
186
- | Can't reach status page | Network issue | Use mobile or VPN |
187
- | kubectl fails | Auth expired | Re-authenticate |
188
- | Metrics unavailable | Prometheus down | Check backup metrics |
189
- | Secret rotation fails | Permission denied | Escalate to admin |
190
233
 
191
- ## Examples
192
-
193
- ### One-Line Health Check
194
- ```bash
195
- curl -sf https://api.yourapp.com/health | jq '.services.vercel.status' || echo "UNHEALTHY"
196
- ```
234
+ | Scenario | Action |
235
+ |----------|--------|
236
+ | Vercel status page shows incident | Monitor, communicate, no deployment changes |
237
+ | `vercel rollback` fails | Use API promotion: POST to `/v9/projects/.../promote` |
238
+ | Rollback deployment also broken | Deploy from a known-good git tag |
239
+ | Cannot access Vercel dashboard | Use CLI with saved VERCEL_TOKEN |
240
+ | Log retention expired | Check external log drain provider |
197
241
 
198
242
  ## Resources
243
+
199
244
  - [Vercel Status Page](https://www.vercel-status.com)
200
- - [Vercel Support](https://support.vercel.com)
245
+ - [Instant Rollback](https://vercel.com/docs/instant-rollback)
246
+ - [Vercel Support](https://vercel.com/support)
247
+ - [Vercel Logs CLI](https://vercel.com/docs/cli/logs)
201
248
 
202
249
  ## Next Steps
203
- For data handling, see `vercel-data-handling`.
250
+
251
+ For data handling and compliance, see `vercel-data-handling`.
@@ -0,0 +1,11 @@
1
+ # Error Handling Reference
2
+
3
+ | Issue | Cause | Solution |
4
+ |-------|-------|----------|
5
+ | Can't reach status page | Network issue | Use mobile or VPN |
6
+ | kubectl fails | Auth expired | Re-authenticate |
7
+ | Metrics unavailable | Prometheus down | Check backup metrics |
8
+ | Secret rotation fails | Permission denied | Escalate to admin |
9
+
10
+ ---
11
+ *[Tons of Skills](https://tonsofskills.com) by [Intent Solutions](https://intentsolutions.io) | [jeremylongshore.com](https://jeremylongshore.com)*
@@ -0,0 +1,10 @@
1
+ ## Examples
2
+
3
+ ### One-Line Health Check
4
+
5
+ ```bash
6
+ curl -sf https://api.yourapp.com/health | jq '.services.vercel.status' || echo "UNHEALTHY"
7
+ ```
8
+
9
+ ---
10
+ *[Tons of Skills](https://tonsofskills.com) by [Intent Solutions](https://intentsolutions.io) | [jeremylongshore.com](https://jeremylongshore.com)*