Skip to content
Back to skills

Deploy And Runtime Verification

ASecurity

MANDATORY deploy after every code change. Typecheck → deploy → purge CDN → E2E on production → visual verify → fix-forward loop. Workers Builds native CI/CD, D1 Time Travel PIT recovery, D1→R2 long-term backups, wrangler rollback, wrangler secrets management, structured observability, cross-browser smoke tests, rollback procedures, and GitHub auto-configuration.

  • 33 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added November 26, 2026
ai-agentspythonrustgoshellsqlnodegitapidatabaseci/cd

Works with

  • claude code
  • cli
  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned November 29, 2026

npx -y skills add heymegabyte/agent-skills --skill deploy-and-runtime-verification --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Deploy And Runtime Verification?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Deploy And Runtime Verification
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/heymegabyte-deploy-and-runtime-verification/badge)](https://www.skillsdirectory.com/skills/heymegabyte-deploy-and-runtime-verification)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "deploy-and-runtime-verification"
description: "MANDATORY deploy after every code change. Typecheck → deploy → purge CDN → E2E on production → visual verify → fix-forward loop. Workers Builds native CI/CD, D1 Time Travel PIT recovery, D1→R2 long-term backups, wrangler rollback, wrangler secrets management, structured observability, cross-browser smoke tests, rollback procedures, and GitHub auto-configuration."
license: "Rutgers"
compatibility:
  agentskills: ">=1.0.0"
source: "08-deploy-and-runtime-verification/SKILL.md (heymegabyte/agent-skills)"
---

<!-- GENERATED by bin/gen-codex-skills.mjs from the category's SKILL.md — do not hand-edit.
     Path legend: `<agent-home>` = your AI tool's config directory
     (Claude Code: ~/.claude · Codex: ~/.codex · others: see your tool's docs). -->

# 08 — Deploy and Runtime Verification

Enforce `rules/production-delivery-closure.md` after every authorized code-changing prompt: validate → exact tested commit → normal main push → established deploy → exact-commit production E2E. Fail closed rather than bypassing authority or evidence gates.

For package qualification, registry publication and offline package recovery, load `08-deploy-and-runtime-verification/changelog-and-releases.md` for archive verification and publication evidence.

For package-owned D1 migrations on a consumer database, load
`08-deploy-and-runtime-verification/ci-cd-pipeline.md` for ledger ownership,
combined rehearsal, and primary schema verification.

For OpenTofu plan review, load `08-deploy-and-runtime-verification/ci-cd-pipeline.md` for private rendering, Conftest validation, and saved-plan identity checks.

## Mandatory deploy loop (every code change)

Activate this loop only for authorized repository changes. Read-only prompts, explicit local-only requests, prohibited deployment, unavailable authority/credentials, destructive approval gaps, failed required validation, and required PR/review are `BLOCKED`, not reasons to bypass controls.

When a repository supports hosted and local deployment, share the preflight
entrypoint for both. Include required asset existence before publishing.
After deployment and any required cache purge, verify the deployed revision,
HTTP status, and expected media type for the public assets in the release
contract. For API probes, validate both release identity and response bodies
using the declared wire schemas. Retry stale revisions or transient edge
errors within a fixed limit. Fail on a confirmed candidate contract
violation even if a concurrent probe reports a transient error.

1. Build + typecheck
2. Commit only the intended tested tree and push that exact commit normally to `main`
3. `wrangler deploy` (or the repository's established platform equivalent) for that exact commit
4. Purge CDN only through the established authorized path when required
5. Fetch each changed route on PROD URL via curl + Playwright
6. Assert new content / headers / JSON-LD / status and deployed commit/version live
7. AI vision QA at 6 viewports (per `_kernel/standards.md#breakpoints`)
8. Fix-forward (max 3 redeploys) or execute the documented rollback — never silently fail
9. Only then mark DONE

"Local typecheck + build pass" is NOT done. Per `rules/verification-loop.md`.

## Retired endpoints and delivery evidence

For a sensitive retired endpoint, remove active UI entry points and define the
response for clients that still call the old route. Use a generic response
uniform across inputs and record existence. For permanent withdrawal of a
known public route, use `410 Gone` where its existence is safe to disclose.
Set `Cache-Control: no-store` and return before reading submission data or
performing side effects. Verify the declared methods and response contract on
the canonical production URL and known serving aliases. Check previously
cacheable variants through the authorized purge and verification path. Probe
with approved synthetic inputs and retain observations without private request
data, historical records, or credentials.

For email, webhook, analytics, and other external delivery claims, record the
strongest observed state: accepted by the app, queued, accepted by the provider,
or observed at the destination. Use an approved synthetic marker and a scoped
receiver lookup or receipt, tied to the operation ID, revision and timestamp.
When only a sender-side result exists, leave destination delivery unverified.

References: [HTTP status semantics](https://www.rfc-editor.org/rfc/rfc9110.html#name-410-gone)
and [Cloudflare URL purge and cache variants](https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-single-file/).

## Asset compatibility across Worker releases

For a Worker that serves content-hashed client assets, qualify the asset paths
needed by already-open pages during rollout and rollback. Use the version
routing and retention strategy supported by that deployment. When shipping
retained assets, verify the previous names and bytes before upload. Treat a
missing file, digest mismatch, collision, or SPA fallback document in place
of an asset as a release failure.

Keep the exact prepared upload directory or its digest manifest as release
evidence. Rehearse through the actual asset binding and after promotion verify
current and required retained paths against the prepared digests at the edge.
Use the serving aliases affected by the release. Treat a local binding test,
successful upload, or healthy homepage as evidence for that step only. Record
the serving Worker version with the edge result. See [Cloudflare version skew and static assets](https://developers.cloudflare.com/workers/versions-and-deployments/version-skew/).

## Auth fallback chain

- `CLOUDFLARE_API_TOKEN` from `get-secret`
- On 401: `CLOUDFLARE_API_KEY` + `CLOUDFLARE_EMAIL`
- Both stale: prompt `! npx wrangler login`, resume deploy once fresh
- NEVER silently skip deploy because creds missing — surface as blocker

## Cloudflare `cf` CLI transition (beta — doctrine stays wrangler-first)

- `cf` CLI open beta since 2026-09-28: ~3,000 generated API commands (vs wrangler's ~280). Wrangler gets ONE final major redirecting to cf, then 18-month maintenance; config format moves `wrangler.jsonc` → `cloudflare.config.ts` with typed bindings. Wrangler now requires Node ≥22.
- Keep every deploy command wrangler-based while cf is beta (still beta 2026-10, no GA date); re-evaluate at cf GA (signal: non-beta npm dist-tag). Even post-GA, cf shells out to wrangler for esbuild/Rust/Python Workers + can't yet stream live logs (`wrangler tail`) or set single secrets (`wrangler secret put`).

## Workers Builds (native CI/CD)

- Configure in `wrangler.jsonc` `build` block
- Auto-deploys on push to `main` per `rules/main-only-branch.md`
- Runs `npm install` + `npm run build` + `wrangler deploy`
- Secrets injected via dashboard or `wrangler secret put` per `rules/secret-provisioning.md`

## Secrets management

- `wrangler secret put KEY` — runtime secrets; `wrangler secret list` — names only, never values
- Two-way mirror: every prod secret also in chezmoi (`~/.local/share/chezmoi/home/.chezmoitemplates/secrets/{KEY}`)
- `scripts/check-secrets.mjs --audit` runs before every deploy
- Per `rules/secret-provisioning.md` + `rules/secret-auto-provisioning.md`

## D1 backup strategy

- **Time Travel** — 30-day PIT, free: `wrangler d1 time-travel restore <db> --timestamp=<ts>`
- **D1 → R2 long-term** — `wrangler d1 export <db> --output=backup.sql` + upload to R2 daily via cron
- **Pre-migration safety** — `wrangler d1 export` BEFORE any destructive migration
- 1 TB storage limit per account, 10 GB per database

## Rollback procedures

- **Worker** — `wrangler rollback <version-id>` in <30s
- **D1** — Time Travel PIT to known-good timestamp
- **R2** — bucket versioning enabled; revert via object version
- **Combined deploy** — log `{commit, version_id, timestamp}` to D1 after every deploy; rollback target one query away

## Auto-rollback gates (gradual deployment)

- 1% → watch error rate 5 min → 10% → watch 5 min → 100%
- Auto-rollback at p99 error >1% or LCP regression >20%

## Browser console gate

Per `rules/verification-loop.md` § Console-error gate — all must be 0:

- Console errors / CSP report-uri violations / Trusted Types violations / Deprecation warnings / Third-party script errors

Run as part of `npm run e2e:prod` Playwright suite.

## Cross-browser smoke

Per `_kernel/standards.md#breakpoints` × 3 browsers (Chromium, Firefox, WebKit):

- Homepage loads; primary CTA clickable; form submit succeeds (Turnstile invisible)
- No console errors at any breakpoint
- Lighthouse Perf ≥75 + A11y ≥95

## Observability check post-deploy

Verify each is firing (missing = blocker):

- Sentry — recent events in dashboard
- PostHog — recent pageviews + captures
- Workers Tracing — recent traces in Axiom (Tier 2)
- AI Gateway — recent LLM calls logged (Tier 3)
- GA4 — recent events (Tier 2)

## GitHub auto-configuration

- New project: `gh repo create` with template
- Add CF Workers Builds via dashboard or API
- Wire OIDC + `cloudflare/wrangler-action@v3` for CI
- Trust policy: GitHub OIDC token verifies repo + branch — no long-lived `CLOUDFLARE_API_TOKEN` in repo secrets

## Per-deploy CHANGELOG entry

Every deploy logs to `CHANGELOG.md` (`## [version] — YYYY-MM-DD` / `### Added / Changed / Fixed`). Auto-generated by `changelog-generator` agent from conventional commits.

## See submodules: workers-builds.md, d1-backups.md, rollback.md, github-config.md.

## Prompt Hydration deployment handoff

Deploy only when the hydrated acceptance evidence and subsequent verification receipts authorize the production edge. Use applicable operations, migration, maintenance, and cost rows from `coverageMatrix`; unresolved consequential assumptions remain blockers. Record the exact tested commit, deployment version, production checks, rollback state, and evidence IDs. This skill owns deployment procedure only—it does not repeat hydration, architecture conference, worker routing, or improvement logic.

## Theme.tools ecosystem contract (required)

Use the delivery/status/telemetry packages mapped in `config/theme-tools-skill-map.json`; canonical shared-capability procedure remains in `rules/theme-tools-skill-integration.md`.

For material work, follow [the parallel delivery workflow](../../../rules/parallel-multi-swarm-orchestration.md).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.