Skip to content
Development
Command

/r2-setup

Quickly create R2 bucket and configure binding in wrangler.jsonc

From plugin
claude-skills
24162 skills42 agents62 commands2 MCP
$ npx -y skills add secondsky/claude-skills --agent claude-code

Command definition

r2-setup.md
name: cloudflare-r2:setup
description: Quickly create R2 bucket and configure binding in wrangler.jsonc

R2 Quick Setup

Create an R2 bucket and configure Worker binding for instant file storage.

Required Information

1. **Bucket name** (3-63 chars, lowercase, numbers, hyphens only): `{{bucket_name}}` 2. **Binding name** (uppercase, used in code like `env.MY_BUCKET`): `{{binding_name}}` 3. **Preview bucket** (optional, for dev environment): `{{preview_bucket_name}}`

What This Command Does

1. **Creates R2 bucket** via `wrangler r2 bucket create` 2. **Adds binding to wrangler.jsonc** in r2_buckets array 3. **Generates TypeScript types** in env.d.ts 4. **Shows example usage code** for uploads/downloads

Example Execution

# Create bucket
bunx wrangler r2 bucket create my-uploads

# Configure wrangler.jsonc
{
  "r2_buckets": [
    {
      "binding": "MY_UPLOADS",
      "bucket_name": "my-uploads",
      "preview_bucket_name": "my-uploads-preview"
    }
  ]
}

# Add TypeScript types
type Bindings = {
  MY_UPLOADS: R2Bucket;
};

# Example upload/download code
app.put('/upload/:filename', async (c) => {
  const data = await c.req.arrayBuffer();
  await c.env.MY_UPLOADS.put(c.req.param('filename'), data, {
    httpMetadata: {
      contentType: c.req.header('content-type') || 'application/octet-stream',
    },
  });
  return c.json({ success: true });
});

app.get('/download/:filename', async (c) => {
  const object = await c.env.MY_UPLOADS.get(c.req.param('filename'));
  if (!object) return c.json({ error: 'Not found' }, 404);
  return new Response(object.body);
});

Next Steps

1. Test with `bunx wrangler dev` 2. Upload a test file 3. Verify download works 4. Deploy with `bunx wrangler deploy`

Read more
@secondsky
Ships withclaude-skills

145 production-ready skills for Claude Code CLI 🔌 Platform / Harness Support These plugins ship as Claude Code marketplace plugins (.claude-plugin/ manifests) and Codex CLI plugins (.codex-plugin/ manifests).

241183 skills42 agents2 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
241
Star history of secondsky/claude-skills on GitHub, a chart by star-history.com

Other commands on claude-skills.

better-auth-setup

better-auth-setup

Command

Interactive setup wizard for better-auth authentication. Guides through database, framework, OAuth providers, and plugin…

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command