Skip to main content
Agent skill

Offload R2

Upload Remotion repository media assets to the Cloudflare R2 bucket behind remotion.media, switch source code to hosted URLs, verify the public objects, and remove repository-local copies.

Get started

Get the complete skill folder, including its scripts and reference files.

When to use this skill

Use Offload R2 when an AI agent needs a reusable SKILL.md workflow for this job: Upload Remotion repository media assets to the Cloudflare R2 bucket behind remotion.media, switch source code to hosted URLs, verify the public objects, and remove repository-local copies.

When not to use it

Skip Offload R2 when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.

How to install

Where will you use it?

Install scope
Claude Code folder setup
mkdir -p ~/.claude/skills/offload-r2
# Save SKILL.md to ~/.claude/skills/offload-r2/SKILL.md
  1. Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/offload-r2/SKILL.md. For a shared project, commit the folder at .claude/skills/offload-r2/ instead.
  2. Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
  3. For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.

Full install guide for Claude, Cursor, and Codex →

Try a starter prompt

After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.

Starter prompt
Use the Offload R2 skill for this task: Find the main worktree with git worktree list --porcelain. Prefer the worktree on refs/heads/main, normally /Users/jonathanburger/remotion. Confirm any required inputs or files before making changes.

What supports this recommendation?

83/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.

Documentation
92/100
Practical detail
92/100
Source evidence
63/100
Source signals
70/100
Model compatibility evidence
  • claudeuntested

    No model-specific signal or recorded compatibility test was found.

  • chatgptuntested

    No model-specific signal or recorded compatibility test was found.

  • geminiuntested

    No model-specific signal or recorded compatibility test was found.

  • copilotuntested

    No model-specific signal or recorded compatibility test was found.

  • llamauntested

    No model-specific signal or recorded compatibility test was found.

  • perplexityuntested

    No model-specific signal or recorded compatibility test was found.

  • mistraluntested

    No model-specific signal or recorded compatibility test was found.

  • grokuntested

    No model-specific signal or recorded compatibility test was found.

Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.

What this skill does

# Offload R2 Asset

Host media on `https://remotion.media/`, update every in-scope source reference to the public object, and remove the repository-local copy after verification.

## Workflow

1. Find the main worktree with `git worktree list --porcelain`. Prefer the worktree on `refs/heads/main`, normally `/Users/jonathanburger/remotion`.

2. Choose a stable, descriptive object key. Use a feature-specific directory prefix when it prevents collisions, for example `studio-close-ups/demo.mp4`. When replacing an asset, prefer a new versioned key so browser and Studio caches cannot serve the previous bytes.

3. Load credentials from the main worktree without printing them:

```bash --env-file=/Users/jonathanburger/remotion/packages/remotion-media/.env ```

The required variables are `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.

4. Upload to the `parser-media` bucket with Bun's S3-compatible client:

```bash bun --env-file=/Users/jonathanburger/remotion/packages/remotion-media/.env -e "import {S3Client} from 'bun'; const filePath='<local-file>'; const key='<object-key>'; const client=new S3Client({accessKeyId:Bun.env.AWS_ACCESS_KEY_ID,secretAccessKey:Bun.env.AWS_SECRET_ACCESS_KEY,endpoint:'https://2fe488b3b0f4deee223aef7464784c46.r2.cloudflarestorage.com',bucket:'parser-media'}); const bytes=new Uint8Array(await Bun.file(filePath).arrayBuffer()); await client.write(key,bytes); const remote=await client.file(key).arrayBuffer(); if (remote.byteLength!==bytes.byteLength) throw new Error('Size mismatch'); console.log('uploaded',key,remote.byteLength);" ```

5. Verify the public object and compare its SHA-256 hash with the local file before removing anything:

```bash curl -I --fail https://remotion.media/<object-key> test "$(shasum -a 256 <local-file> | cut -d' ' -f1)" = "$(curl --fail --silent https://remotion.media/<object-key> | shasum -a 256 | cut -d' ' -f1)" ```

6. Replace every in-scope source usage with the public URL. Do not wrap remote URLs in `staticFile()` because it rejects `http://` and `https://` URLs.

7. After the public hash matches and source references are remote, remove the local copy. Use `git rm -- <local-file>` for a tracked file or remove the exact untracked/ignored file directly. Remove obsolete asset-specific `.gitignore` entries and empty asset directories. Do not use recursive deletion or broad globs.

8. Verify the local copy is gone and search the affected package for remaining local references:

```bash test ! -e <local-file> rg -n '<local-filename>|staticFile\(' <affected-package> ```

9. Run focused lint or style checks for touched packages. Commit or push only when requested.

Intended uses

  • Find the main worktree with git worktree list --porcelain. Prefer the worktree on refs/heads/main, normally /Users/jonathanburger/remotion.
  • Choose a stable, descriptive object key. Use a feature-specific directory prefix when it prevents collisions, for example studio-close-ups/demo.mp4. When replacing an asset, prefer a new versioned key so browser and Studio caches cannot serve the previous bytes.
  • Load credentials from the main worktree without printing them:
  • Upload to the parser-media bucket with Bun's S3-compatible client:
  • Verify the public object and compare its SHA-256 hash with the local file before removing anything:
  • Replace every in-scope source usage with the public URL. Do not wrap remote URLs in staticFile() because it rejects http:// and https:// URLs.
  • After the public hash matches and source references are remote, remove the local copy. Use git rm -- <local-file> for a tracked file or remove the exact untracked/ignored file directly. Remove obsolete asset-specific .gitignore entries and empty asset directories. Do not use recursive deletion or broad globs.
  • Verify the local copy is gone and search the affected package for remaining local references:
  • Run focused lint or style checks for touched packages. Commit or push only when requested.

Implementation notes

  • Review the source instructions and adapt inputs before running the workflow.

Try it, then tell us how it went

A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.