activestorage-uploads

activestorage-uploads is a skill for Claude Code, Codex from sandeepmvl/rails-skills. It costs 152 tokens per session (3,346 once invoked), scanned A, original, MIT.

A guide for handling file uploads in Ruby on Rails 8 with Active Storage, Rails’ built-in file-attachment system. It covers direct cloud uploads, image variants, validation, and private download links.

In plain words
What is it for?
Use it to build avatar and document uploads, send files directly to S3 or GCS, resize images in background jobs, and enforce file type and size limits.
Why use it?
It prevents large uploads from tying up the Rails server and reduces risks from oversized, unsafe, or publicly exposed files.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build avatar and document uploads, send files directly to S3 or GCS, resize images in background jobs, and enforce file type and size limits.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sandeepmvl/rails-skills/13-activestorage-uploads
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add sandeepmvl/rails-skills --skill 13-activestorage-uploads
Clone the repo
git clone --depth 1 https://github.com/sandeepmvl/rails-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for activestorage-uploads

README.md
[![agentmods](https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/13-activestorage-uploads/github.svg)](https://agentmods.dev/skills/sandeepmvl/rails-skills/13-activestorage-uploads)
Your own site
<a href="https://agentmods.dev/skills/sandeepmvl/rails-skills/13-activestorage-uploads"><img src="https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/13-activestorage-uploads/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for activestorage-uploads

Your own site · 80×15
<a href="https://agentmods.dev/skills/sandeepmvl/rails-skills/13-activestorage-uploads"><img src="https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/13-activestorage-uploads.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 152 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,346 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00152 $0.03346
Opus 5.5 $0.00061 $0.01338
Sonnet 5.5 $0.00030 $0.00669
Haiku 4.5 $0.00015 $0.00335

Measured 2mo ago against content hash fddae311a548, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

activestorage-uploads scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/13-activestorage-uploads/SKILL.md · 362 lines

How it starts

The opening of the file, as written. The whole thing — 362 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Active Storage Uploads

File uploads done right in Rails 8. AI agents generate the simplest possible has_one_attached :avatar and call it a day — missing direct uploads (so the Rails server proxies every byte), variant generation (computed in the request thread), and pre-signed URL safety. This skill closes those gaps.

Why this matters

File uploads are an attack surface and a performance liability. The naïve "user posts the file, Rails saves it" pattern blocks request workers for the duration of the upload, eats RAM on multi-MB files, and gives attackers an easy way to upload malware or oversized payloads. Direct upload + signed URLs + variant generation in jobs fixes all three.

The opinion

Direct uploads to S3/GCS (Rails server never sees the byte payload). image_processing + libvips for variants (NOT imagemagick). Variants generated in background jobs, never in the request. Pre-signed URLs with short TTLs (5–15 min) for downloads. Private buckets by default. Validate content-type + size on the model. Never accept user-provided filenames as URLs.

Counter-positions:

  • CarrierWave / Shrine — predate Active Storage. Still legitimate; Shrine especially has features Active Storage lacks (multi-step processing, plugins). Default to Active Storage; reach for Shrine if you need its specific features.
  • Cloudinary / Imgix — managed image CDNs that handle variants for you. Worth it for image-heavy apps; over-investment for an avatar field.

Core patterns

Pattern 1: Direct upload to S3 (skip the Rails server)

Before (AI default — every byte through Rails):

class User < ApplicationRecord
  has_one_attached :avatar
end
<%= form.file_field :avatar %>

User uploads 50MB → Rails server holds the whole thing in memory → forwards to S3. A worker is blocked for the upload duration. Memory spikes. Concurrent uploads OOM.

After (direct upload):

<%= form.file_field :avatar, direct_upload: true %>

Plus the JS:

Read the full file on GitHub · 362 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · +1 lines fddae311a548
  2. 3mo ago First seen · 361 lines · 152 tokens per session scan A 53e3cfc069c8

Subscribe to this mod's changes

activestorage-uploads is a skill published in the GitHub repository sandeepmvl/rails-skills (22 stars, last pushed 2mo ago), licensed MIT. It adds 152 tokens to every session and 3,346 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

activestorage-uploads compared with skills from other repositories

activestorage-uploads next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
activestorage-uploadssandeepmvl/rails-skillsSkill222mo agoMITA152Claude Code, Codex
alchemy-providerpingdotgg/t3codeSkill87ktodayMITA153Claude Code, Codex
stripe-projectsNousResearch/hermes-agentSkill268ktodayMITA15Claude Code, Codex
django-storages-s3Jeffallan/claude-skillsSkill13k2d agoMITA138Claude Code
websocket-engineerJeffallan/claude-skillsSkill13k2d agoMITA36Claude Code
azure-eventhub-dotnetmicrosoft/skillsSkill3.3kyesterdayMITA94Claude Code
azure-mgmt-botservice-dotnetmicrosoft/skillsSkill3.3kyesterdayMITA78Claude Code