.cursor/skills/deploy-cloudflare-bindings/SKILL.md
Update deploy CI when adding Cloudflare bindings (R2/D1/DO/assets) or new wrangler config env vars. Use when deploy.yml fails after adding a new Worker binding or when introducing new required env in wrangler.jsonc generation.
npx skillsauth add jdconley/wodbrains deploy-cloudflare-bindingsInstall 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.
This repo generates apps/worker/wrangler.jsonc from env vars via scripts/generate-wrangler-config.mjs, and CI runs with WRANGLER_GEN_STRICT=1. Adding new Worker bindings often requires updating CI secrets/env and creating the Cloudflare resource (e.g., an R2 bucket) before deployment.
scripts/generate-wrangler-config.mjs so pnpm wrangler:gen produces the correct apps/worker/wrangler.jsonc.requiredEnv() if it must be present in CI, or optionalEnv() ?? <default> when a safe default exists.Example (R2 bucket):
CLOUDFLARE_R2_BUCKET_<NAME>r2_buckets: [{ binding: '<BINDING_NAME>', bucket_name: <env> }]If CI uses WRANGLER_GEN_STRICT=1, missing env vars will fail the workflow during tests or pre-deploy.
CLOUDFLARE_R2_BUCKET_OG_IMAGES = <bucket_name>.github/workflows/deploy.ymlIn this repo, deploy.yml must pass all wrangler:gen env vars in two places:
pnpm wrangler:gen indirectly)Add the new env var(s) to both steps:
env:
WRANGLER_GEN_STRICT: '1'
CLOUDFLARE_D1_DATABASE_ID: ${{ secrets.CLOUDFLARE_D1_DATABASE_ID }}
CLOUDFLARE_ZONE_NAME: ${{ secrets.CLOUDFLARE_ZONE_NAME }}
CLOUDFLARE_ROUTE_WODBRAINS: ${{ secrets.CLOUDFLARE_ROUTE_WODBRAINS }}
CLOUDFLARE_ROUTE_WWW: ${{ secrets.CLOUDFLARE_ROUTE_WWW }}
CLOUDFLARE_R2_BUCKET_OG_IMAGES: ${{ secrets.CLOUDFLARE_R2_BUCKET_OG_IMAGES }}
Create the backing resource in the target account before deploying.
Example (R2 bucket):
pnpm --filter worker exec wrangler r2 bucket create <bucket_name>
Notes:
If you added D1 migrations:
pnpm --filter worker db:migrate:remote
Then deploy:
pnpm --filter worker deploy
Root causes are usually:
WRANGLER_GEN_STRICT=1 is enabled but the new CLOUDFLARE_* env var was not provided in CI (tests step and/or strict regeneration step).documentation
UI design guidelines for WOD Brains app - mobile-first, app-like design with consistent patterns. Use when making UI changes.
testing
Always create and run tests affected by changes, including Playwright for UI changes. Use when modifying Wodbrains features or UI.
development
Run Wodbrains worker parse evals and live Gemini tests locally using Wrangler `.dev.vars` keys. Use when you need to run `parse.evals.test.ts` / `parse.gemini.test.ts` against the real model (RUN_LIVE_AI_TESTS=1).
documentation
Regenerate README screenshots and the demo video for WOD Brains.