contember

Assets To R2 — DevOps skill for Claude Code

DevOps community

Claude skill + Bun CLI: move committed repo assets to Cloudflare R2 behind cdn.nuasite.com, rewriting references to absolute CDN URLs so nuasite keeps emitting correct /cdn-cgi/image transform.

How to install Assets To R2

This entry records only its repository, not the path inside it, so there is no exact command to give. Open contember/assets-to-r2 and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Assets To R2 does

Claude skill + Bun CLI: move committed repo assets to Cloudflare R2 behind cdn.nuasite.com, rewriting references to absolute CDN URLs so nuasite keeps emitting correct /cdn-cgi/image transforms

Alternatives in DevOps

  • Claudable — Claudable is an open-source web builder that leverages local CLI agents, such as Claude Code, Codex, Gemini CL 4k ★
  • WP CLI And Ops — WordPress CLI and operations management 902 ★
  • Codeg — Aggregate and browse AI coding agent sessions (Claude Code, Codex, Gemini CLI, etc.) in one place 850 ★

README

assets-to-r2

A Claude Code skill (plus a standalone Bun CLI) that moves heavy binary assets out of a git repository onto Cloudflare R2 behind `cdn.nuasite.com`, and rewrites every reference to absolute CDN URLs.

Built for the recurring problem where a site repo accumulates gigabytes of committed article photos, uploaded PDFs and crawled media — typically after a site rebuild — and every clone pays for it.

Why the rewrite is mandatory

The nuasite `` component (`@nuasite/components`) builds Cloudflare transform URLs by splicing the origin of `src` into the prefix:

src emitted
/assets/a.jpg /cdn-cgi/image/…/assets/a.jpg — against the site's own host
https://cdn.nuasite.com/assets/x/a.jpg https://cdn.nuasite.com/cdn-cgi/image/…/assets/x/a.jpg

Same-zone is structural — the component never emits a cross-origin form. So once an asset lives on R2, a root-relative reference asks the site's zone to transform a file it no longer hosts. See `reference/nuasite-image.md`.

Install

Clone into your Claude skills directory; the checkout *is* the skill:

git clone git@github.com:contember/assets-to-r2.git ~/.claude/skills/assets-to-r2

Claude picks it up automatically. Requires Bun — the CLI has no dependencies (it uses `Bun.S3Client`).

Use

Ask Claude: *"presuň assety z tohohle repa na CDN"*. Or drive the CLI directly from the target repo's root:

A2R=~/.claude/skills/assets-to-r2/scripts/a2r.ts

bun $A2R preflight --slug my-project        # prove creds + that the zone fronts the bucket
bun $A2R inventory --slug my-project        # classify assets → .a2r/plan.json
bun $A2R mark move --class uncertain        # adjust the plan
bun $A2R upload --dry-run                   # then without --dry-run
bun $A2R rewrite                            # dry-run; then --apply
bun $A2R verify                             # CDN reachability + a real cdn-cgi transform
bun $A2R prune --apply                      # del