# Wrangler Deploy

Wrangler deployment discipline for Cloudflare Workers and Pages.

## Rules

1. **`wrangler.toml` is the contract.** Name, compatibility date, bindings, and environments live here. Deploy config scattered across scripts drifts from production.

2. **Secrets via CLI, not config.** `wrangler secret put` for API keys. Never commit secrets to `wrangler.toml` or source control.

3. **Environments for staging and production.** `[env.staging]` and `[env.production]` with separate bindings. Test against staging before promoting.

4. **`wrangler dev` before `wrangler deploy`.** Local development catches binding errors and runtime exceptions before they hit edge traffic.

5. **Tail logs after deploy.** `wrangler tail` for the first minutes after release. Edge errors don't always surface in your local terminal.

## What This Replaces

Manual dashboard deploys, secrets in config files, and discovering binding misconfigurations from production 500s.

## Official Source

Distilled from Cloudflare's official agent skills.
Full upstream: https://officialskills.sh/cloudflare/skills/wrangler
