Agent skill

S3 File Storage

by cohen-liel in cohen-liel/hivemind

AWS S3 (and compatible) file storage patterns. An agent skill from cohen-liel/hivemind.

Apache-2.0Auto-check passedBackend & APIs

Install S3 File Storage

skills CLI
$ npx skills add cohen-liel/hivemind --skill s3-file-storage -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cohen-liel/hivemind s3-file-storage --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cohen-liel/hivemind.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/s3-file-storage .claude/skills/s3-file-storage && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
s3-file-storage
GitHub stars
110
Token cost
~1.2k tokens
SKILL.md length
121 words
Files
1
Skills in repo
33
Repo updated
First seen
Licence
Apache-2.0

At a glance

AWS S3 (and compatible) file storage patterns. An agent skill from cohen-liel/hivemind.

  • Implementing file uploads
  • SKILL.md covers Setup (boto3 + Python), Upload Patterns, Delete and Image Resizing (on upload), plus 2 more sections
  • Needs AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
  • Document management

What it does

S3 File Storage is an agent skill from cohen-liel/hivemind. AWS S3 (and compatible) file storage patterns. Use when implementing file uploads, image storage, document management, CDN delivery, or any cloud file storage.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering File uploads and storage. It works with Amazon S3. The repository describes itself as: One prompt. A full AI engineering team. Go lie on the couch. 🧠. The licence is Apache-2.0.

When your agent uses it

  • Implementing file uploads
  • Document management
  • Any cloud file storage

Example prompts

  • “/s3-file-storage”

Requirements

  • Python 3
  • A credential in AWS_SECRET_ACCESS_KEY

What it can do on your machine

Read from SKILL.md and the folder at commit 918dd9b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python, typescript and json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • AWS_ACCESS_KEY_ID
    • AWS_SECRET_ACCESS_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

S3 File Storage loads about 1.2k tokens when it runs. Until then it costs about 44 tokens; SKILL.md has 121 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~44
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from cohen-liel/hivemind at commit 918dd9b, republished under its Apache-2.0 licence (© cohen-liel). 121 words, ~1,211 tokens.

Download SKILL.mdSave it as .claude/skills/s3-file-storage/SKILL.md (or your agent's skills folder).
name
s3-file-storage
description
AWS S3 (and compatible) file storage patterns. Use when implementing file uploads, image storage, document management, CDN delivery, or any cloud file storage.

S3 File Storage Patterns

Setup (boto3 + Python)

python
# storage.py
import boto3
from botocore.exceptions import ClientError
import uuid, mimetypes

s3 = boto3.client(
    "s3",
    aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
    aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
    region_name=settings.AWS_REGION,
    # For S3-compatible services (Cloudflare R2, MinIO):
    # endpoint_url=settings.S3_ENDPOINT_URL,
)
BUCKET = settings.S3_BUCKET
CDN_URL = settings.CDN_URL  # e.g. "https://cdn.example.com"

Upload Patterns

Direct upload from server
python
async def upload_file(file: UploadFile, folder: str = "uploads") -> str:
    """Upload file, return public URL."""
    # Validate
    MAX_SIZE = 10 * 1024 * 1024  # 10MB
    ALLOWED_TYPES = {"image/jpeg", "image/png", "image/webp", "application/pdf"}

    content = await file.read()
    if len(content) > MAX_SIZE:
        raise ValueError(f"File too large (max {MAX_SIZE // 1024 // 1024}MB)")
    if file.content_type not in ALLOWED_TYPES:
        raise ValueError(f"File type not allowed: {file.content_type}")

    # Generate unique key
    ext = mimetypes.guess_extension(file.content_type) or ".bin"
    key = f"{folder}/{uuid.uuid4()}{ext}"

    s3.put_object(
        Bucket=BUCKET,
        Key=key,
        Body=content,
        ContentType=file.content_type,
        CacheControl="max-age=31536000",  # 1 year cache for immutable files
    )

    return f"{CDN_URL}/{key}"
Presigned URL (client uploads directly — no server bottleneck)
python
def generate_upload_url(filename: str, content_type: str, folder: str = "uploads") -> dict:
    """Client uploads directly to S3 — bypasses your server entirely."""
    ext = filename.rsplit(".", 1)[-1].lower() if "." in filename else "bin"
    key = f"{folder}/{uuid.uuid4()}.{ext}"

    url = s3.generate_presigned_url(
        "put_object",
        Params={
            "Bucket": BUCKET,
            "Key": key,
            "ContentType": content_type,
            "ContentLength": 5 * 1024 * 1024,  # Max 5MB
        },
        ExpiresIn=300,  # URL valid for 5 minutes
    )
    return {
        "upload_url": url,
        "key": key,
        "public_url": f"{CDN_URL}/{key}",
    }

# FastAPI endpoint
@router.post("/upload-url")
async def get_upload_url(
    filename: str = Query(...),
    content_type: str = Query(...),
    user: User = Depends(get_current_user),
):
    return generate_upload_url(filename, content_type, folder=f"users/{user.id}")
Client-side direct upload
typescript
async function uploadFile(file: File): Promise<string> {
  // 1. Get presigned URL from your API
  const { upload_url, public_url } = await fetch('/api/upload-url?' + new URLSearchParams({
    filename: file.name,
    content_type: file.type,
  })).then(r => r.json())

  // 2. Upload directly to S3 (no server in the middle)
  await fetch(upload_url, {
    method: 'PUT',
    body: file,
    headers: { 'Content-Type': file.type },
  })

  return public_url
}

Delete

python
async def delete_file(key: str):
    try:
        s3.delete_object(Bucket=BUCKET, Key=key)
    except ClientError as e:
        logger.error(f"S3 delete failed for {key}: {e}")

def extract_key_from_url(url: str) -> str:
    """Extract S3 key from CDN URL."""
    return url.replace(f"{CDN_URL}/", "")

Image Resizing (on upload)

python
from PIL import Image
import io

def resize_image(content: bytes, max_size: tuple[int, int] = (1920, 1080)) -> bytes:
    img = Image.open(io.BytesIO(content))
    img.thumbnail(max_size, Image.LANCZOS)
    if img.mode in ("RGBA", "P"):
        img = img.convert("RGB")
    output = io.BytesIO()
    img.save(output, format="JPEG", optimize=True, quality=85)
    return output.getvalue()

Bucket Policy (public read for CDN)

json
{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "PublicRead",
    "Effect": "Allow",
    "Principal": "*",
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::your-bucket/*"
  }]
}

Rules

  • NEVER store files on local disk in production (not portable, not scalable)
  • Validate file type server-side (don't trust Content-Type from client)
  • Validate file size before uploading (not after reading all bytes into RAM)
  • Use presigned URLs for large files (avoids server memory/bandwidth)
  • Generate unique keys (UUID) — never use original filenames (path traversal risk)
  • Set CacheControl headers for immutable files (images don't change after upload)
  • Delete from S3 when deleting the record in DB (no orphaned files)
  • Use lifecycle rules to auto-delete tmp/ folder after 24h

© cohen-liel, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/s3-file-storage of cohen-liel/hivemind.

Open the folder on GitHubat commit 918dd9b

Compare with similar skills

S3 File Storage next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

S3 File Storage compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
S3 File Storage this skillcohen-liel/hivemind110—~1.2kAutomated safety check: PassApache-2.0
Processing S3 Uploads With Step Functionsaws/agent-toolkit-for-aws2.8k—~4kAutomated safety check: PassApache-2.0
S3 User Filesaws-samples/sample-host-openclaw-on-amazon-bedrock-agentcore177—~779Automated safety check: PassMIT-0
Django Storages for S3Jeffallan/claude-skills12k—~1.9kAutomated safety check: PassMIT
Neon Object Storageneondatabase/agent-skills100—~3.5kAutomated safety check: NotesApache-2.0
AWS S3sickn33/agentic-awesome-skills47k2 repos~3.1kAutomated safety check: PassMIT

Similar skills

  • Official

    Deploy an event-driven workflow that routes S3 uploads to either Lambda or Fargate via Step Functions based on file size.

    2.8k GitHub stars~4k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • S3 User Files

    aws-samples/sample-host-openclaw-on-amazon-bedrock-agentcore

    Official

    Per-user persistent file storage backed by AWS S3. An agent skill from aws-samples/sample-host-openclaw-on-amazon-bedrock-agentcore.

    177 GitHub stars~779 tokensUpdated 12 days ago
    Backend & APIsAuto-check passed
  • Django Storages for S3

    Jeffallan/claude-skills

    Sets up Django 4.2+ to keep static and media files on AWS S3 through django-storages, with public and private backends, presigned URLs and CloudFront.

    12k GitHub stars~1.9k tokensUpdated 7 days ago
    Backend & APIsAuto-check passed
  • Neon Object Storage

    neondatabase/agent-skills

    Official

    S3-compatible object storage that branches with your Neon project, so files and the database stay in sync across every branch.

    100 GitHub stars~3.5k tokensUpdated 2 days ago
    Backend & APIsAuto-check: notes
  • AWS S3

    sickn33/agentic-awesome-skills

    Configure S3 buckets, policies, and lifecycle rules. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~3.1k tokens
    Backend & APIsAuto-check passed
  • R2 Upload

    zebbern/claude-code-guide

    Upload files to Cloudflare R2, AWS S3, or any S3-compatible storage (like MinIO) and generate secure, time-limited presigned download links with configurable expiration, typically set to 5 minutes.

    4.7k GitHub stars~886 tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from cohen-liel/hivemind

All 33 skills in this repo
  • API Design

    cohen-liel/hivemind

    REST API design principles and best practices. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~857 tokensUpdated 5 mo ago
    Auto-check passed
  • Async Python

    cohen-liel/hivemind

    Python asyncio patterns for high-performance async code. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~992 tokensUpdated 5 mo ago
    Auto-check passed
  • Celery Tasks

    cohen-liel/hivemind

    Celery background task patterns for Python apps. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~1.1k tokensUpdated 5 mo ago
    Auto-check passed
  • Docker Deployment

    cohen-liel/hivemind

    Docker, docker-compose, and deployment configuration best practices.

    110 GitHub stars~674 tokensUpdated 5 mo ago
    Auto-check passed
  • E2E Testing

    cohen-liel/hivemind

    End-to-end testing patterns with Playwright. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~1.2k tokensUpdated 5 mo ago
    Auto-check passed
  • Email Service

    cohen-liel/hivemind

    Email sending patterns for transactional and marketing emails.

    110 GitHub stars~1.8k tokensUpdated 5 mo ago
    Auto-check passed

Works with

Categories

Questions about S3 File Storage

What does S3 File Storage do?

AWS S3 (and compatible) file storage patterns. An agent skill from cohen-liel/hivemind. S3 File Storage is an agent skill from cohen-liel/hivemind. AWS S3 (and compatible) file storage patterns.

When should I use S3 File Storage?

S3 File Storage fits situations like: implementing file uploads; document management; any cloud file storage.

How do I install S3 File Storage in Claude Code?

Run `npx skills add cohen-liel/hivemind --skill s3-file-storage -a claude-code`. Or copy the skill folder (.claude/skills/s3-file-storage in cohen-liel/hivemind) into .claude/skills/s3-file-storage in your project. Claude Code loads it when a task matches its description.

How do I install S3 File Storage in Codex?

Run `npx skills add cohen-liel/hivemind --skill s3-file-storage -a codex`. Or copy the skill folder (.claude/skills/s3-file-storage in cohen-liel/hivemind) into .agents/skills/s3-file-storage in your project. Codex loads it when a task matches its description.

Can I use S3 File Storage in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cohen-liel/hivemind --skill s3-file-storage -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/s3-file-storage, .gemini/skills/s3-file-storage, .github/skills/s3-file-storage and .opencode/skills/s3-file-storage in your project.

What does S3 File Storage need to run?

Going by SKILL.md and its folder, S3 File Storage needs credentials named AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. Our summary lists: Python 3; A credential in AWS_SECRET_ACCESS_KEY.

Does S3 File Storage access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is S3 File Storage safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does S3 File Storage use?

S3 File Storage is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does S3 File Storage use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to S3 File Storage?

Skills that share tags, products or a category with S3 File Storage: Processing S3 Uploads With Step Functions (aws/agent-toolkit-for-aws, 2.8k stars), S3 User Files (aws-samples/sample-host-openclaw-on-amazon-bedrock-agentcore, 177 stars), Django Storages for S3 (Jeffallan/claude-skills, 12k stars) and Neon Object Storage (neondatabase/agent-skills, 100 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains S3 File Storage?

cohen-liel (a GitHub user) maintains it in cohen-liel/hivemind, which has 110 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on April 18, 2026.

Source: cohen-liel/hivemind on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.