Review Wrangler
Review all Wrangler configurations and Workers CLI usage for alignment with current official Cloudflare best practices - config currency, binding hygiene, environments, and deploy workflow on this Workers monorepo. Your reply must be a plan of suggested changes: concise, actionable, structured - not only prose.
Invocation
Text after the slash command is additional scope/focus (e.g. "compatibility date only", "observability") - narrow the review accordingly.
Ground truth (mandatory)
Your pre-trained knowledge of Wrangler may be outdated (frequent releases; JSONC-only features appear regularly). Do not draft suggestions from memory alone.
- Resolve "Wrangler" via the Context7 MCP (
resolve-library-id→query-docs) for current config fields, CLI subcommands,wrangler types, versions uploads/promotes. - For anything Context7 lacks, use Firecrawl search/scrape restricted to the official domain (
developers.cloudflare.com/workers/) - wrangler config reference, compatibility dates changelog, observability, migrations. The project also exposes a cloudflare-docs MCP - prefer it for Cloudflare questions. - Local schema ground truth: node_modules/wrangler/config-schema.json is authoritative for field validity at the installed version.
- Version currency: catalog
wranglerin pnpm-workspace.yaml + installed version vs latest stable; check recent compatibility-date entries relevant to flags in use. - Cite the retrieved source next to every finding; label anything unverifiable as Unverified.
Scope artifacts
- apps/worker-api/wrangler.jsonc, apps/front-app/wrangler.jsonc
- Generated types:
apps/*/worker-configuration.d.tsfreshness vs configs (pnpm types/pnpm types:check) .dev.vars.exampleper app; secrets path-scoping rule (backend/workers-config)- Deploy pipeline: root scripts (
deploy,promote,upload) and .github/workflows/cd.yml (paused state documented)
Analysis axes
- Config currency:
compatibility_datewithin ~30 days of today; no stale flags (e.g. explicitnodejs_compatflag when the date already enables it); fields valid against installed schema. - Bindings: each declared binding used in code and vice versa; service bindings preferred for Worker-to-Worker RPC; single DB owner per repo decision checklist; no duplicate DB bindings across apps.
- Environments: dev/staging/production env blocks consistent (vars, observability sampling,
preview_urls); fail-closed CORS wiring intact; no secrets invars. - Observability: logs/traces enabled with sensible sampling per environment;
send_metricschoice intentional. - Assets & SPA: front-app assets config correct (
single-page-applicationhandling); gateway not co-located as assets Worker (repo anti-pattern rule). - Types & deploy workflow:
worker-configuration.d.tscommitted and matching;versions upload→versions deployflow aligned with current Wrangler guidance; CD guard state documented.
DX & AI-agentic workflow
Verify agent-friendliness: $schema pointer present in every jsonc so agents get validation; .dev.vars.example documents every var/secrets name; pnpm types regenerates deterministically.
Steps
- Collect ground truth before reading config.
- Read both wrangler.jsonc files against the local schema; run
pnpm types:checkto verify committed types. - Walk each analysis axis; note findings or explicit one-line "no issues".
- Compose the plan grouped Critical / Improvements / Optional with what, where, why, and source citations.
Output format
- Critical - expired compat behavior assumptions, invalid fields, secret leaks into
vars. - Improvements - config/binding alignment with current platform guidance.
- Optional - nice-to-haves; prefix pure polish with Nit:.
Read-only review: produce the plan only; implement nothing unless explicitly asked afterwards.