Loading...
Loading...
Deploy Cloudflare Workers and verify changes work in staging/preview. Use when asked to "deploy", "ship", "push to staging", "deploy and test", "verify deploy", or "check staging".
npx skill4agent add jonmumm/skills deploy-verify1. Pre-deploy checks
2. Deploy to target environment
3. Infer verification plan from git diff
4. Run verification
5. Report results (pass/flag issues)tsc --noEmitnpm testbun testgit statuswrangler.tomlwrangler.jsonc# List available environments from wrangler config
grep -E '^\[env\.' wrangler.toml | sed 's/\[env\.\(.*\)\]/\1/'# To a named environment (staging, preview, etc.)
wrangler deploy --env <environment>
# To production (default if no --env)
wrangler deploygit diff --name-only# What changed since last deploy?
git diff HEAD~1 --name-only
git diff HEAD~1 --stat
git log HEAD~1..HEAD --oneline| Change type | What to verify |
|---|---|
| API route handler changed | Hit that endpoint, check response shape and status |
| Middleware changed | Test requests that flow through it |
| Auth logic changed | Test both authenticated and unauthenticated requests |
| KV/D1/R2 bindings changed | Test read/write operations on those bindings |
| Environment variables referenced | Verify secrets are set: |
| CORS or headers changed | Check response headers |
| Error handling changed | Test error paths |
| New route added | Hit the new route, verify 200 + correct response |
| Route removed | Verify it returns 404 |
| Static assets changed | Fetch them and verify content |
curlfetch# Basic health check
curl -s -o /dev/null -w "%{http_code}" https://<worker-url>/
# Check specific endpoint with response body
curl -s https://<worker-url>/api/endpoint | jq .
# Check response headers
curl -sI https://<worker-url>/api/endpoint
# POST with body
curl -s -X POST https://<worker-url>/api/endpoint \
-H "Content-Type: application/json" \
-d '{"key": "value"}'# Tail logs (run in background, hit endpoints, then check)
wrangler tail --env <environment> --format jsonDeploy verified:
- Environment: staging
- URL: https://my-worker-staging.example.workers.dev
- Checks passed:
- GET /api/stories → 200, response shape correct
- POST /api/generate → 200, returns stream
- KV read/write → workingDeploy issues found:
- Environment: staging
- URL: https://my-worker-staging.example.workers.dev
- PASS: GET /api/stories → 200
- FAIL: POST /api/generate → 500
- Error in logs: "Missing AI binding"
- Likely cause: AI binding not configured in staging env
- Action needed: Check wrangler.toml [env.staging] AI bindings# wrangler.toml
name = "my-worker"
[env.staging]
name = "my-worker-staging"
route = "staging.example.com/*"
[env.production]
name = "my-worker"
route = "example.com/*"wrangler secret list --env staging
wrangler secret list --env production| Problem | Fix |
|---|---|
| 500 after deploy | |
| Binding not found | Check wrangler.toml — bindings must be declared per environment |
| Secret missing | |
| Old code still serving | Worker may be cached — wait 30s or check |
| Route not matching | Verify route patterns in wrangler.toml match the URL you're hitting |
| CORS errors | Check if the Worker sets appropriate CORS headers for the origin |