cloudflare-gradual-release
Skill23 starsChanged 7 days agoMITView on GitHub
Configure, run, observe, and recover gradual Cloudflare Workers rollouts (1%, 10%, 50%, 100%) with version-override probes, Workers Logs gates, and Alchemy state reconciliation. Use when building or operating staged Worker deployments, asset skew handling, expand-and-contract migrations, or rollout recovery.
In this repository46 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agents-autonomous-loopsSkill
- agents-correctSkill
- agents-create-verification-skillSkill
- agents-reflectSkill
- agents-swarmSkill
- alchemy-infraSkill
- cloudflare-edge-hardeningSkill
- comms-howSkill
- comms-impactSkill
- comms-interrogateSkill
- comms-promo-videoSkill
- comms-slidesSkill
- comms-technical-writingSkill
- comms-unslopSkill
- comms-whySkill
- drizzle-postgresSkill
- effect-boundary-validationSkill
- effect-seam-migrationSkill
- effectSkill
- eng-agent-dx-cli-scaleSkill
- eng-ai-featuresSkill
- eng-benchmark-checklistSkill
- eng-blast-radiusSkill
- eng-change-checklistSkill
- eng-cutover-verificationSkill
- eng-data-backward-compatSkill
- eng-migrationSkill
- eng-monorepoSkill
- eng-qa-cujsSkill
- eng-state-machineSkill
- eng-tddSkill
- eng-testingSkill
- gh-ci-triageSkill
- gh-issue-burndownSkill
- gh-pr-commit-reviewSkill
- gh-pr-feedback-loopSkill
- nix-darwinSkill
- reg-suitSkill
- sentry-bugfixSkill
- sentry-perfSkill
- seo-coachSkill
- svelte-shadcnSkill
- svelte-ui-deliverySkill
- ui-audit-loopSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Keep migration credentials separate from runtime credentials and out of Workers.
- Distinctive: line 46
Keep the deployment failed even when automatic recovery succeeds.
- Distinctive: line 47
After cancellation or runner loss, inspect live Cloudflare routing rather than assuming rollback ran.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cloudflare gradual release
Drive staged Cloudflare Workers rollouts through CI workflows, version-override probes, and Workers Logs gates. Use alchemy-infra for stack edits and secret drift, and gh-ci-triage for build or test failures.
Repo facts (from AGENTS.md): production Worker name and custom domain, Alchemy stack and deploy workflow files, GitHub environments and wait-timer settings, migration and runtime secret stores, probe command and disposable probe fixture, observation window and minimum-traffic variables, and rollback procedure.
Prerequisites and isolation
- Keep migration credentials separate from runtime credentials and out of Workers.
- Restrict production and wait environments to the default branch. Use a custom domain rather than
workers.devwhen browser version affinity is required. - Enable Workers Logs, invocation logs, and full sampling before the first gradual rollout. Preserve existing logs and trace destinations during partial deploys.
- Serialize releases and reject superseded revisions before deployment and before each traffic increase.
- Require explicit authorization for manual production deploys, remote migrations, live traffic changes, or recovery runs (in unattended or headless runs without prior authorization, stop and report the required authorization blocker instead of waiting for interactive input).
Staged rollout
- Plan and record the active baseline version ID and release SHA. Refuse to guess when a partial split is already active. Restore one known version first.
- Apply backward-compatible schema migrations with the dedicated migration credential before uploading the candidate. A failed migration blocks upload.
- Upload the candidate version and route 1% of traffic to it.
- Probe the candidate with Cloudflare's version-override header. Require the response to report the candidate's version ID and release SHA, and check critical writes and dependencies against a dedicated disposable fixture.
- Observe production logs for the full window, then promote the same version through 10%, 50%, and 100% through Cloudflare's deployment API without uploading a new version.
- Re-run the full probe at 100%. Mark the deployment successful only afterward.
Observation and promotion gates
- Query Workers Logs filtered by physical script name and version ID over the full window plus log ingestion lag.
- Repeat pinned, read-only health requests against both versions during each window. Require those health logs to appear for both versions. Missing telemetry blocks promotion.
- Require zero candidate error logs, failed invocation outcomes, HTTP 5xx responses, or latency-ceiling breaches.
- Distinguish zero-traffic categories from partially sampled traffic below the minimum floor. Allow a manual low-traffic override only through explicit workflow dispatch, never for errors, failed probes, stale revisions, or missing telemetry.
- Release CI runners during wait windows by using secret-free GitHub environment wait timers sized above
RELEASE_OBSERVATION_SECONDSplus ingestion lag.
Shared state and version skew
- Both versions share databases, queues, bindings, and external webhooks during a split. Use expand-and-contract migrations: ship compatible schema and readers first, deploy writers after reaching 100%, and drop old schema only after the rollback window ends. Rollback does not undo schema or data changes.
- Version overrides pin HTTP requests, not the asynchronous queue jobs they enqueue. Keep queued payloads readable by both versions.
- Each Worker version serves only its own uploaded assets, and IP affinity does not hold visitors whose addresses change. Carry the retained version's hashed immutable assets on the candidate upload, probe both versions' asset graphs, and reload the client shell once on a failed chunk import. Attribute missing-asset checks to the candidate and retained build manifests rather than failing on probes or older builds.
Recovery and state reconciliation
- One final recovery job covers failures across deployment, waits, and promotion: restore the retained version at 100%, verify its health and assets, and open or update one failure issue per environment and SHA. Do not gate recovery on a boolean job output that GitHub can mask as a secret.
- Keep the deployment failed even when automatic recovery succeeds.
- After cancellation or runner loss, inspect live Cloudflare routing rather than assuming rollback ran.
- Reconcile Alchemy state before the next release. Native Cloudflare promotion or rollback leaves Alchemy's recorded routing state behind Cloudflare's routing table.
Verify
- Baseline version ID and SHA were captured from a 100% healthy version before splitting traffic.
- Pinned probes confirmed both version ID and release SHA at 1% and again at 100%.
- Workers Logs ingested health probes for both versions with zero candidate errors.
- Any schema or queue change is compatible with the retained version.
- Live Cloudflare routing and Alchemy state agree after completion or recovery.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

