agentsclimarketplace

File storage design

Skill Amey-Thakur/AI-SKILLS/skills/backend/file-storage-design

Store user files in object storage with presigned transfers, validation, and lifecycle rules. Use when building upload/download features or moving file handling off application servers.From its SKILL.md

Install
npx -y skills add Amey-Thakur/AI-SKILLS --skill file-storage-design

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 24 days oldThe repository was created 24 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.8 KB, 594 tokens by cl100k_base, as published. Nobody here has run it

File storage design

Files go to object storage; your servers handle authorization and metadata, never the bytes. Every design decision follows from keeping payloads off your request path.

Method

  1. Presign uploads, direct to the bucket. Client asks your API for an upload URL; you authorize, generate a presigned PUT (or POST policy) scoped to one key, content-type, size limit, and short expiry; client uploads directly. Your API never proxies bytes, so uploads cannot exhaust your workers.
  2. Own the keys, never trust filenames. Server generates the object key (tenant/{id}/uploads/{uuid}); the user's filename is metadata, stored and returned as Content-Disposition. User-controlled paths are traversal and overwrite attacks waiting (see path-traversal-defense).
  3. Verify after upload, before use. A confirm endpoint (or bucket event) checks the object exists, size matches, magic bytes match the declared type (not the extension), then flips DB status to ready and enqueues scanning/thumbnailing as jobs. Files never referenced by a confirm get lifecycle-deleted (abandoned uploads are storage cost).
  4. Serve through presigned GETs or signed CDN URLs. Short-lived (minutes) per-object URLs after your authz check; long-cache public assets go behind the CDN with immutable keys. Buckets stay private; a public bucket is an incident report with a delay timer.
  5. Model metadata in your database. Owner, tenant, size, type, checksum, status, created_at; the bucket is a blob heap, your DB is the truth about whose file is whose. Deletes are DB-first (soft), object cleanup async, so a failed delete never orphans authorization.
  6. Set lifecycle rules in code. Abandoned multipart uploads aborted after a day; temp/exports expire in days; cold originals transition to infrequent-access tiers; versioning plus a deletion grace window where compliance demands undelete.
  7. Bound everything. Max size per type, allowed content types, per-user quotas and rate limits on URL issuance; large files go multipart with the same per-part signing.

Boundaries

  • User-uploaded HTML/SVG served from your domain is stored XSS; serve from a sandboxed domain with Content-Disposition: attachment or strict CSP (see file-upload-safety for the security-side detail).
  • Files that must join transactions (tiny configs, thumbnails under a few KB) can live in the DB; anything bigger pays for itself in operational pain.
  • Direct-to-bucket requires CORS configuration on the bucket; scope it to your origins and the PUT/POST methods only.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,750. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.