PinMe Worker R2 Storage
A skill that guides Claude to build secure file upload, download, and delete APIs on PinMe-deployed Cloudflare Workers using only the injected env.R2 binding.
Web & APIIntermediate★ 3,732⑂ 274AI score 8/10Last updated: Jul 25, 2026
What it does
- Assumes the
env.R2binding PinMe auto-injects into every deployed Worker, so no credentials, bucket names, or Wrangler edits are needed. - Ships route-level TypeScript for streaming uploads, Range/conditional downloads, HEAD metadata, deletes, and owner-prefixed listing.
- Enforces one security sequence on every route: authenticate → authorize → validate size and media policy → generate a server-side key → call env.R2 → return a sanitized response.
- Clarifies R2 vs D1 responsibilities (bodies in R2, searchable metadata in D1) with a pending → ready state-transition and compensation pattern.
- Includes a status-code contract (400/411/412/413/416...) and an anti-pattern table to block common insecure implementations.
Who it's for
- Developers shipping Cloudflare Worker backends through PinMe that need file or image storage.
- Teams hardening upload APIs that currently trust client-supplied object keys or user IDs.
- Anyone combining R2 and D1 who needs a consistency plan without shared transactions.
Examples
- "Add an image upload endpoint" → handler that prechecks Content-Length, enforces a MIME allowlist, streams
request.bodystraight intoenv.R2.put, and re-verifies the stored size. - "Video seeking is broken" → adds Range header validation, 206 responses with
content-range/accept-ranges, and 412 on failed conditional requests. - "List a user's files" → calls
list()with only the authenticated owner's prefix and paginates onpage.truncatedrather than object count.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/glitternetwork/pinme/HEAD/skills/pinme-r2/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/pinme-r2 folder from the GitHub repo glitternetwork/pinme into my ~/.claude/skills/pinme-r2/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/glitternetwork/pinme.git && mkdir -p ~/.claude/skills && cp -r pinme/skills/pinme-r2 ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repo:
git clone https://github.com/glitternetwork/pinme.git - Create the skills folder:
mkdir -p ~/.claude/skills - Copy the skill:
cp -r pinme/skills/pinme-r2 ~/.claude/skills/ - Confirm
~/.claude/skills/pinme-r2/SKILL.mdexists. - Restart Claude Code, then inside a PinMe Worker project ask something like "add an R2 file upload route" to trigger the skill.
- Because the skill assumes a PinMe-deployed Worker (
pinme save/pinme update-worker), install the PinMe CLI first for the full workflow.
View source on GitHub ↗License: MIT