heymegabyte/agent-skills / 05-architecture-and-stack
architecture-and-stack
VerifiedCloudflare-first platform selection. Workers, D1, R2, KV, DO, Queues, Vectorize, Containers, Workflows, native Go CLIs and measured Rust/WASM acceleration. Default stack, override conditions, auth, data patterns and reliability.
cf-2026-updates.md
View on GitHub# Cloudflare 2026 Platform Updates — Quick Reference
Pin this alongside the other `05-architecture-and-stack` submodules. Reflects the platform state as of Oct 2026.
## Workers Runtime
- **WorkerEntrypoint RPC** — default for service-to-service calls between Workers. Promise pipelining, 32 MiB payload limit, JSRPC compat date `2024-04-03`. Prefer over `fetch()`-over-HTTP service bindings.
- **Smart Placement** — no longer co-locates with D1 (D1 has global replicas now). Drop any guidance saying "enable Smart Placement when bound to D1."
- **Workers Builds** — recommended CI for new projects (native, GitHub/GitLab integration, PR checks, rollbacks, pnpm 10 support)
- **Gradual deployments** + Version Metadata binding — 1% → 10% → 100% traffic splits with `version_id`/`version_tag` access inside the Worker. mTLS bindings compatible.
- **Workers Automatic Tracing (OTLP)** — `[observability] enabled = true` in `wrangler.jsonc`. BILLED since 2026-10-01 (Paid: 10M trace+log events/mo incl, $0.05/M extra; `persist:false` to skip dashboard-storage double-charge). NEW unified Observability model from **2026-12-01**: ingestion-based ($0.25/GB ingested + $0.10/GB-mo stored; Paid 50GB + 10GB-mo incl) supersedes per-event.
- **WebSocket payload up to 32 MiB** — both Workers and Durable Objects (2025-10-25)
## D1
- **Read replication GA** via the Sessions API — `db.withSession(bookmark)` for sequentially-consistent reads, no extra cost
- **Read-only queries auto-retry** (2025-09-11) — remove custom retry wrappers around SELECT/EXPLAIN
- **Storage cap** — 1 TB per account (raised from 250 GB), 10 GB per database (hard cap)
- **Jurisdiction pinning** (2025-11-05) — set EU/FedRAMP at create time for compliance
- **Time Travel** — 30-day PIT recovery via `wrangler d1 time-travel restore`
- D1 has **no transactions** — use `db.batch([stmt1, stmt2])` for atomic multi-statement execution
- **D1 → R2** for long-term backups beyond 30 days
## R2
- **Infrequent Access storage class** + lifecycle transitions — default lifecycle Standard → IA after 30 days for backups/exports/old uploads
- **Event notifications → Queues** at 5,000 msg/sec — wire R2 → Queue → consumer Worker for thumbnailing/AV-scan/index instead of polling
- Cross-region replication available for compliance and latency
- Production R2 binding requires Workers Paid ($5/mo); Infrequent-Access class gets NO free tier
## Durable Objects
- **SQLite-backed DOs GA** (2025-04-07), 10 GB per DO, available on Free plan. Paid storage billing began 2026-01-07.
- New DOs default to `new_sqlite_classes` not `new_classes`
- **`DurableObjectNamespace.getByName(name)`** (2025-08-21) — replaces `idFromName` → `get` two-step pattern
- Alarms remain idempotent — handler must tolerate replay
## Workflows v2 (2026-05)
- 50,000 concurrent instances (was 4,500), 300 creates/sec, 2M queued per workflow
- Deterministic step-based execution — `step.do`, `step.sleep`, `step.waitForEvent`, `step.sleepUntil`
- New default for any agentic or long-running task
### Decision matrix
- **Workflows v2** — multi-step, deterministic, durable, agentic
- **Queues** — fan-out, fire-and-forget, R2 event ingestion
- **DO alarms** — per-entity scheduled work tied to entity state
- **Cron Triggers** — simple periodic tasks (sweeps, summaries)
## Vectorize
- 5M dimensions per index (was 200K)
- topK up to 100 (50 with values/metadata)
- 10 metadata indexes per index, 10 KiB metadata per vector
## Hyperdrive
- Now supports **MySQL + Postgres**, free on Workers Free (100K queries/day cap; $0 unlimited on Paid)
- Connection pooling and query caching included at no charge
- Front any external Postgres/MySQL with Hyperdrive — never direct connection
## AI Gateway
- `env.AI.run()` auto-routes through AI Gateway when configured
- Direct Anthropic via `https://gateway.ai.cloudflare.com/v1/{account}/{gateway}/anthropic/v1/messages`
- Provides logging, caching, rate-limit, fallback
- Wire as the 4th observability pillar
## Containers
- `await env.MY_CONTAINER.fetch()` from a Worker spins a Docker container on demand
- Escape hatch for non-JS runtimes — Playwright headful, ffmpeg, Python ML, Java services
- GPU instances "coming soon"
## Wrangler / Config
- **`cf` CLI open beta (still beta 2026-10-05; `1.0.0-beta.x`, patch increments every few days — no GA date)** — ~3,000 generated API commands vs wrangler's ~280; defaults to JSON output + `cf cli search` NL discovery; Vite-by-default (drops esbuild); `cf migrate` converts Workers; wrangler gets ONE final major redirecting to cf then 18-month maintenance (clock starts at beta-END, not yet counting); config moving `wrangler.jsonc` → `cloudflare.config.ts` (typed bindings); wrangler now requires Node ≥22. **Beta gaps still need wrangler: no live-log streaming (`wrangler tail`), no single-secret set (`wrangler secret put`), + esbuild/Rust/Python Workers run wrangler under cf. Doctrine: wrangler-first while cf is beta — re-evaluate at cf GA (watch for a non-beta npm dist-tag).**
- **`wrangler.jsonc`** — new default (not `.toml`). New features ship JSON-only.
- **`secrets.required`** — config property declares required secrets. Validated at `wrangler dev`/`deploy`/`vite dev`. Feeds `wrangler types`.
- **`wrangler types`** — supported way to get typed bindings (over `@cloudflare/workers-types`)
- **Remote bindings** via `remote: true` per binding — routes operations through Miniflare to real prod resources during dev. New default workflow — local code + remote bindings for hard-to-mock services (R2, AI, Vectorize).
## Clerk + Workers
- **Clerk M2M JWT tokens** (2026-02-24) — free, networkless verification for service-to-service identity
- `CLERK_JWT_KEY` PEM verification for zero-RTT session checks at the edge
- Use Clerk M2M instead of static API keys between Workers
## Drizzle v1 + RQBv2
- **RQBv2** — `with` for nested relations, JIT-compiled row mapper opt-in, single SQL query always
- `._query` removed for Postgres
- Pin Drizzle to v1.x
## Canonical Bindings Stack (saas-starter template)
- `d1_databases` — Sessions API enabled, jurisdiction-pinned if regulated
- `kv_namespaces` — CACHE (5min default TTL), CONFIG, RATE_LIMIT
- `r2_buckets` — UPLOADS (IA lifecycle 30d), BACKUPS (IA lifecycle 7d)
- `ai` — Workers AI gateway
- `hyperdrive` — for external Postgres/MySQL
- `vectorize_indexes` — for RAG
- `queues` — R2 event consumers
- `durable_objects` — `new_sqlite_classes` for entity state
- `containers` — non-JS workloads
- `assets` — Workers Assets binding
- `secrets` — `secrets.required` block enforces declaration
- `[observability] enabled = true` — Workers Tracing OTLP
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |