Vercel and Cloudflare canary deployment patterns with traffic splitting, gradual rollout automation, and rollback strategies. Use when deploying with canary releases, implementing progressive rollouts, managing traffic splitting, configuring A/B deployments, or when user mentions canary deployment, blue-green deployment, gradual rollout, traffic shifting, or deployment rollback.
/plugin marketplace add vanman2024/dev-lifecycle-marketplace/plugin install deployment@dev-lifecycle-marketplaceThis skill is limited to using the following tools:
examples/ab-testing-canary.mdexamples/cloudflare-gradual-rollout.mdexamples/multi-region-rollout.mdexamples/vercel-basic-canary.mdscripts/canary-deploy-cloudflare.shscripts/canary-deploy-vercel.shscripts/gradual-rollout.shscripts/monitor-canary.shscripts/rollback-canary.shtemplates/cloudflare-kv-schema.jsontemplates/cloudflare-worker-canary.jstemplates/health-check-config.jsontemplates/rollout-schedule.jsontemplates/vercel-edge-config.jsontemplates/vercel-middleware-canary.tsThis skill provides comprehensive canary deployment capabilities for Vercel and Cloudflare platforms, enabling gradual traffic shifting, deployment validation, and automated rollback strategies.
Canary deployment is a progressive rollout strategy that reduces deployment risk by gradually shifting traffic from the stable version to the new version. This skill covers:
Script: scripts/canary-deploy-vercel.sh <project-path> <canary-percentage>
Purpose: Deploy new version to Vercel and configure canary traffic split
Actions:
Usage:
# Deploy with 10% canary traffic
./scripts/canary-deploy-vercel.sh /path/to/app 10
# Deploy with 25% canary traffic
./scripts/canary-deploy-vercel.sh /path/to/app 25
# Skip health check (for testing)
SKIP_HEALTH_CHECK=true ./scripts/canary-deploy-vercel.sh /path/to/app 10
# Use custom project name
PROJECT_NAME=my-app ./scripts/canary-deploy-vercel.sh /path/to/app 10
Environment Variables:
VERCEL_TOKEN: Vercel authentication token (required)VERCEL_ORG_ID: Organization ID (optional for personal accounts)PROJECT_NAME: Custom project name (auto-detected if not set)SKIP_HEALTH_CHECK: Set to true to skip initial health validationExit Codes:
0: Canary deployment successful1: Deployment failed or validation errorsScript: scripts/canary-deploy-cloudflare.sh <project-path> <canary-percentage>
Purpose: Deploy new version to Cloudflare Workers and configure traffic split
Actions:
Usage:
# Deploy with 10% canary traffic
./scripts/canary-deploy-cloudflare.sh /path/to/worker 10
# Deploy with custom worker name
WORKER_NAME=my-worker ./scripts/canary-deploy-cloudflare.sh /path/to/worker 15
# Skip route update (manual routing)
SKIP_ROUTES=true ./scripts/canary-deploy-cloudflare.sh /path/to/worker 20
Environment Variables:
CLOUDFLARE_API_TOKEN: Cloudflare API token (required)CLOUDFLARE_ACCOUNT_ID: Account ID (required)WORKER_NAME: Custom worker name (auto-detected from wrangler.toml)SKIP_ROUTES: Set to true to skip automatic route configurationExit Codes:
0: Canary deployment successful1: Deployment failed or credential errorsScript: scripts/gradual-rollout.sh <platform> <project-name> <schedule>
Purpose: Automate progressive traffic increase according to schedule
Actions:
Rollout Schedules:
fast: 10% → 50% → 100% (5 min intervals)standard: 5% → 25% → 50% → 100% (15 min intervals)safe: 5% → 10% → 25% → 50% → 75% → 100% (30 min intervals)custom: Custom stages via environment variableUsage:
# Standard rollout to Vercel
./scripts/gradual-rollout.sh vercel my-app standard
# Fast rollout to Cloudflare
./scripts/gradual-rollout.sh cloudflare my-worker fast
# Safe rollout with monitoring
./scripts/gradual-rollout.sh vercel my-app safe
# Custom rollout schedule
ROLLOUT_STAGES="5,15,35,65,100" ./scripts/gradual-rollout.sh vercel my-app custom
# Custom error threshold (default: 5%)
ERROR_THRESHOLD=3 ./scripts/gradual-rollout.sh vercel my-app standard
Environment Variables:
ROLLOUT_STAGES: Comma-separated percentage stages for custom scheduleSTAGE_WAIT_TIME: Minutes to wait between stages (default varies by schedule)ERROR_THRESHOLD: Error rate percentage triggering automatic rollback (default: 5)SLACK_WEBHOOK: Slack webhook URL for notifications (optional)Exit Codes:
0: Rollout completed successfully1: Rollout failed or rollback triggered2: Health check failure during rolloutScript: scripts/rollback-canary.sh <platform> <project-name>
Purpose: Instantly rollback canary deployment to previous stable version
Actions:
Usage:
# Rollback Vercel deployment
./scripts/rollback-canary.sh vercel my-app
# Rollback Cloudflare Worker
./scripts/rollback-canary.sh cloudflare my-worker
# Rollback and delete canary
DELETE_CANARY=true ./scripts/rollback-canary.sh vercel my-app
# Rollback with notification
SLACK_WEBHOOK=your_webhook_url_here ./scripts/rollback-canary.sh vercel my-app
Environment Variables:
DELETE_CANARY: Set to true to delete canary deployment after rollbackSLACK_WEBHOOK: Slack webhook URL for rollback notificationsExit Codes:
0: Rollback successful1: Rollback failed2: Unable to identify stable versionScript: scripts/monitor-canary.sh <platform> <project-name>
Purpose: Real-time monitoring of canary deployment health metrics
Actions:
Usage:
# Monitor Vercel deployment (runs continuously)
./scripts/monitor-canary.sh vercel my-app
# Monitor with custom interval
MONITOR_INTERVAL=30 ./scripts/monitor-canary.sh cloudflare my-worker
# One-time health check
ONE_SHOT=true ./scripts/monitor-canary.sh vercel my-app
# Monitor with custom error threshold
ERROR_THRESHOLD=3 ./scripts/monitor-canary.sh vercel my-app
Environment Variables:
MONITOR_INTERVAL: Seconds between health checks (default: 60)ERROR_THRESHOLD: Error rate percentage triggering alert (default: 5)ONE_SHOT: Set to true for single health check instead of continuous monitoringExit Codes:
0: Metrics within acceptable range1: Metrics exceed threshold (rollback recommended)File: templates/vercel-edge-config.json
Purpose: Edge Config template for traffic splitting rules
Features:
Template Variables:
{{CANARY_PERCENTAGE}}: Traffic percentage for canary (0-100){{CANARY_DEPLOYMENT_URL}}: Canary deployment URL{{STABLE_DEPLOYMENT_URL}}: Stable deployment URL{{ROLLOUT_STAGE}}: Current rollout stage identifierFile: templates/cloudflare-worker-canary.js
Purpose: Cloudflare Worker with traffic splitting logic
Features:
Template Variables:
{{CANARY_PERCENTAGE}}: Traffic percentage for canary{{CANARY_WORKER_NAME}}: Name of canary worker{{STABLE_WORKER_NAME}}: Name of stable worker{{KV_NAMESPACE}}: KV namespace for state storageFile: templates/vercel-middleware-canary.ts
Purpose: Next.js middleware for canary traffic splitting
Features:
Template Variables:
{{CANARY_PERCENTAGE}}: Traffic percentage for canary{{CANARY_REWRITE_URL}}: URL to rewrite canary traffic to{{ENABLE_STICKY_SESSIONS}}: Enable/disable sticky sessionsFile: templates/health-check-config.json
Purpose: Health check thresholds and monitoring configuration
Features:
Template Variables:
{{ERROR_RATE_THRESHOLD}}: Max error rate percentage (default: 5){{LATENCY_P95_THRESHOLD}}: Max P95 latency in ms (default: 1000){{MIN_REQUEST_VOLUME}}: Minimum requests before validation (default: 100)File: templates/rollout-schedule.json
Purpose: Predefined and custom rollout schedule templates
Schedules:
Template Variables:
{{SCHEDULE_NAME}}: Schedule identifier (fast/standard/safe/custom){{STAGES}}: Array of percentage stages{{WAIT_TIMES}}: Array of wait times between stagesFile: templates/cloudflare-kv-schema.json
Purpose: KV storage schema for deployment state
Data Structure:
File: examples/vercel-basic-canary.md
Purpose: Simple canary deployment to Vercel with 10% traffic
Demonstrates:
File: examples/cloudflare-gradual-rollout.md
Purpose: Automated multi-stage rollout to Cloudflare Workers
Demonstrates:
File: examples/ab-testing-canary.md
Purpose: Using canary deployments for A/B experiments
Demonstrates:
File: examples/multi-region-rollout.md
Purpose: Progressive rollout across geographic regions
Demonstrates:
# Step 1: Deploy canary with 10% traffic
./scripts/canary-deploy-vercel.sh /path/to/app 10
# Step 2: Monitor health for 15 minutes
./scripts/monitor-canary.sh vercel my-app
# Step 3: If healthy, proceed with gradual rollout
./scripts/gradual-rollout.sh vercel my-app standard
# Step 4: If issues detected, rollback immediately
./scripts/rollback-canary.sh vercel my-app
# Deploy canary and execute automated rollout
./scripts/canary-deploy-vercel.sh /path/to/app 5 && \
./scripts/gradual-rollout.sh vercel my-app standard
# Rollout proceeds automatically:
# - 5% → wait 15 min → health check
# - 25% → wait 15 min → health check
# - 50% → wait 15 min → health check
# - 100% → complete
# Automatic rollback if error rate > 5% at any stage
# Instant rollback to stable version
./scripts/rollback-canary.sh vercel my-app
# Rollback completes in seconds:
# - Traffic routed 100% to stable
# - Canary deployment preserved for debugging
# - Audit trail logged
Automatic Rollback When:
Preserve Canary After Rollback:
Edge Config Advantages:
Deployment Protection:
Analytics Integration:
Workers Advantages:
Gradual Rollout:
Durable Objects (Advanced):
# Check Edge Config status
vercel env ls
# Verify Edge Config connection
# Check middleware.ts has correct Edge Config import
# Force refresh
vercel env pull
# Check Worker routes
wrangler routes list
# Verify KV namespace binding
wrangler kv:namespace list
# Test Worker directly
curl https://my-worker.workers.dev
# Check monitor process status
ps aux | grep monitor-canary
# View rollout logs
tail -f /tmp/gradual-rollout-*.log
# Manual stage progression
./scripts/canary-deploy-vercel.sh /path/to/app 50
# Increase error threshold temporarily
ERROR_THRESHOLD=8 ./scripts/monitor-canary.sh vercel my-app
# Adjust latency threshold
LATENCY_THRESHOLD=2000 ./scripts/monitor-canary.sh vercel my-app
# Require more requests before validation
MIN_REQUESTS=500 ./scripts/monitor-canary.sh vercel my-app
This skill integrates with:
/deployment:deploy - Execute canary deployment strategy/deployment:validate - Pre-deployment health check validation/deployment:rollback - Emergency rollback orchestration# Edge Config management
vercel env add EDGE_CONFIG
vercel env pull
# Deployment management
vercel list
vercel inspect <url>
vercel promote <url>
vercel rollback
# Worker deployment
wrangler publish
wrangler tail
# KV management
wrangler kv:namespace create <name>
wrangler kv:key put <key> <value>
wrangler kv:key get <key>
# Route management
wrangler routes list
wrangler routes add <route> <worker>
npm install -g vercel) for Vercel deploymentsnpm install -g wrangler) for Cloudflare deploymentsSkill Location: /home/gotime2022/.claude/plugins/marketplaces/dev-lifecycle-marketplace/plugins/deployment/skills/canary-deployment/ Version: 1.0.0
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.