Agent skill · dmmulroy
cloudflare-composition-root
Composition roots for Hono and Cloudflare. Use when adding a binding-backed service or refactoring raw runtime dependencies out of inner code.
What it needs
About 5k tokens when loaded.
What this skill does
Cloudflare Composition Root Use a composition root: each runtime entrypoint turns raw Cloudflare capabilities into application-owned dependencies, assembles services, and invokes them. Inner code receives ports, never Env, raw bindings, framework service locators, or binding names. Apply ../coding-standards/SKILL.md for TypeScript contracts, parsing, errors, side effects, and tests. When implementation shape is unclear, consult EXAMPLES.md for Hono, WorkerEntrypoint, adapter, and refactor templates. Ownership Entrypoint adapter: parses the external request/event, establishes invocation context, constructs dependencies, invokes a service, and projects its result. Binding adapter: implements an application-owned port using KV, R2, D1, Durable Objects, Queues, service bindings, Workflows, or another external capability. Application service: owns one use case's sequencing, fallback, retry, and best-effort policy. Domain module: owns pure values and invariants. Port: names exactly the capability a consumer needs; it does not mirror a Cloudflare API. Raw platform values may exist only in composition roots and binding adapters. A binding adapter accepts the smallest platform capability, not all of Env. 1. Map the boundary Inspect repository instructions and the affected: Hono app factories, middleware order, route registration, and context types; Worker, WorkerEntrypoint, Durable Object, Workflow, queue, and scheduled entrypoints; Env declarations and every use of the relevant binding; tracer creation, correlation, error reporting, and detached-work ownership; existing services, adapters, ports, tests, and architecture checks. Trace each affected behavior from entrypoint to side effect and caller-visible result. For refactors, record current error, retry, fallback, serialization, and tracing behavior before moving it. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills dmmulroy/cloudflare-composition-root