skills/deployment-operations/SKILL.md
Cloudflare deployment rollback, health monitoring, and production troubleshooting. Use when recovering from a failed deployment, checking deployment health, or diagnosing production issues.
npx skillsauth add bkinsey808/songshare-effect deployment-operationsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Requires: file-read, terminal (Wrangler/Cloudflare CLI). No network access needed.
Use this skill when:
Execution workflow:
Output requirements:
# Revert the last commit and push — GitHub Actions auto-deploys the reversion
git revert HEAD
git push origin main
# Wait ~2 minutes for deployment
# Build and deploy the previous commit directly
git checkout main~1
npm run build:all
npm run deploy:production
# Reset HEAD back to current state
git checkout main
wrangler rollback --env production
npm run health:check
curl https://<your-domain>/api/health
wrangler tail --env production
curl https://<your-domain>/api/health
# Expected: { "status": "ok", "environment": "production", "timestamp": "..." }
npm run health:check # automated — checks API, frontend, DB, realtime
npm run status:deployment
wrangler tail --env production # live log stream
Go to Analytics → Traffic in the Cloudflare dashboard to check for 5xx error spikes or response time regressions after deploy.
# 1. Try hard refresh in browser (Ctrl+Shift+R) — if that works, it's a cache issue
# 2. Open incognito window — if that works, it's browser cache only
npm run cache:purge # purge Cloudflare CDN
npm run status:deployment # confirm correct commit is deployed
If still broken after 5 minutes, manually purge in the Cloudflare dashboard: Caching → Purge Cache → Purge Everything.
# Reproduce locally
npm run build:all
# Check Node version (must be 20+)
node --version
# Clear build cache and retry
npm run clean
npm run build:all
Then check wrangler tail --env production for runtime startup errors.
# List what's deployed
wrangler secret list --env production
# If missing, set and redeploy
wrangler secret put KEY_NAME --env production
npm run deploy
docs/ai/rules.md.deployment-strategies.cloudflare-cache-cicd.tools
Zustand state management patterns for this project — store creation, selectors, Immer middleware, async actions with loading states, devtools, persist, and testing. Use when authoring or editing Zustand stores (use*Store files) or components that subscribe to stores. Do NOT use for React component structure or TypeScript-only utilities.
testing
How to write, update, or split skill files in this repo. Use when creating a new SKILL.md, updating an existing one, or deciding whether to put content in a skill vs. docs/.
development
Complete guide for testing React hooks — renderHook, Documentation by Harness, installStore, fixtures, subscription patterns, lint/compiler traps, and pre-completion checklist. Read docs/testing/unit-test-hook-best-practices.md for the full reference.
development
Vitest unit test authoring for this repo — setup, mocking, API handler testing, and common pitfalls for non-hook code. Use when the user asks to add, update, fix, or review unit tests for utilities, components, API handlers, or scripts. Do NOT use for React hook tests — load unit-test-hook-best-practices instead.