Agent skill
wrangler-deploy
Cloudflare Wrangler deployment patterns for Pitchey. Activates when deploying, publishing, or releasing to Cloudflare Pages or Workers.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/devops/wrangler-deploy
SKILL.md
Pitchey Deployment Patterns
Project Details
- Frontend Project:
pitchey-5o8(Cloudflare Pages) - Worker Name:
pitchey-api-prod - Production API: https://pitchey-api-prod.ndlovucavelle.workers.dev
- Production Frontend: https://pitchey-5o8.pages.dev
Deployment Commands
Frontend (Pages)
# Build first
cd frontend && npm run build
# Preview deploy (get unique URL for testing)
npx wrangler pages deploy dist --project-name pitchey-5o8
# Production deploy (main branch)
npx wrangler pages deploy dist --project-name pitchey-5o8 --branch main
# Check deployment status
npx wrangler pages deployment list --project-name pitchey-5o8
Backend (Workers)
cd worker
npx wrangler deploy --env production
# Verify deployment
curl -I https://pitchey-api-prod.ndlovucavelle.workers.dev/health
Full Deploy Sequence
# 1. Build frontend
cd frontend && npm run build
# 2. Deploy frontend to production
npx wrangler pages deploy dist --project-name pitchey-5o8 --branch main
# 3. Deploy Worker API
cd ../worker && npx wrangler deploy --env production
# 4. Verify both
curl -s https://pitchey-api-prod.ndlovucavelle.workers.dev/health | jq
curl -s -o /dev/null -w "%{http_code}" https://pitchey-5o8.pages.dev
Pre-Deploy Checklist
- Run
npm run build- must succeed with no errors - Run
npx wrangler typesif wrangler.jsonc bindings changed - Test locally with
npx wrangler dev --remote - Deploy to preview first, test, then deploy to production
Post-Deploy Verification
# Stream logs for errors (keep running)
npx wrangler tail pitchey-api-prod --status error --format pretty
# Quick health check
curl -s https://pitchey-api-prod.ndlovucavelle.workers.dev/health | jq
# Test key endpoints
curl -s "https://pitchey-api-prod.ndlovucavelle.workers.dev/api/browse?tab=trending&limit=1" | jq
Rollback Procedures
# Rollback Worker to previous version
npx wrangler rollback
# List deployments to find version
npx wrangler deployments list
# Rollback to specific version
npx wrangler rollback --version VERSION_ID
# Pages rollback: redeploy previous git commit
git checkout PREVIOUS_COMMIT
npm run build
npx wrangler pages deploy dist --project-name pitchey-5o8 --branch main
Common Deployment Issues
Binding errors after deploy
npx wrangler types # Regenerate types
500 errors after deploy
npx wrangler tail pitchey-api-prod --status error # Check stack traces
CORS errors
- Verify origins in wrangler.jsonc match frontend URL
- Check
Access-Control-Allow-Credentials: trueis set
Build failures
- Check Node version matches (use 18+)
- Clear node_modules and reinstall:
rm -rf node_modules && npm install
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?