Token导航 LogoToken导航TokenDH.com
AI 工具需要联网github未标认证来源可访问clear审计通过

file-uploads文件上传

Agent Skill

file-uploads 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

11,407

周安装

490

GitHub Stars

35,728

下载量

3,998
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:file-uploads(文件上传)
来源仓库:https://github.com/sickn33/antigravity-awesome-skills
仓库路径:skills/file-uploads
安装命令:
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill file-uploads
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill file-uploads

简介

使用 S3、Cloudflare R2、预签名 URL 和多部分支持进行专家文件上传处理。

  • 使用预签名 URL 和分段上传高效处理大文件而不会阻塞
  • 支持多个云存储后端:AWS S3和Cloudflare R2
  • 包括针对已处理上传的图像优化功能
  • 强调安全最佳实践:魔术字节验证、文件名清理、上传大小限制和受控预签名 URL 分发

SKILL.md

File Uploads & Storage

Expert at handling file uploads and cloud storage. Covers S3, Cloudflare R2, presigned URLs, multipart uploads, and image optimization. Knows how to handle large files without blocking.

Role: File Upload Specialist

Careful about security and performance. Never trusts file extensions. Knows that large uploads need special handling. Prefers presigned URLs over server proxying.

Principles

  • Never trust client file type claims
  • Use presigned URLs for direct uploads
  • Stream large files, never buffer
  • Validate on upload, optimize after

Sharp Edges

Trusting client-provided file type

Severity: CRITICAL

Situation: User uploads malware.exe renamed to image.jpg. You check extension, looks fine. Store it. Serve it. Another user downloads and executes it.

Symptoms:

  • Malware uploaded as images
  • Wrong content-type served

Why this breaks: File extensions and Content-Type headers can be faked. Attackers rename executables to bypass filters.

Recommended fix:

CHECK MAGIC BYTES

import {fileTypeFromBuffer} from "file-type";

async function validateImage(buffer: Buffer) {const type = await fileTypeFromBuffer(buffer);

const allowedTypes = ["image/jpeg", "image/png", "image/webp"];

if (!type ||!allowedTypes.includes(type.mime)) {throw new Error("Invalid file type");}

return type;}

// For streams import {fileTypeFromStream} from "file-type"; const type = await fileTypeFromStream(readableStream);

No upload size restrictions

Severity: HIGH

Situation: No file size limit. Attacker uploads 10GB file. Server runs out of memory or disk. Denial of service. Or massive storage bill.

Symptoms:

  • Server crashes on large uploads
  • Massive storage bills
  • Memory exhaustion

Why this breaks: Without limits, attackers can exhaust resources. Even legitimate users might accidentally upload huge files.

Recommended fix:

SET SIZE LIMITS

// Formidable const form = formidable({maxFileSize: 10 * 1024 * 1024, // 10MB});

// Multer const upload = multer({limits: {fileSize: 10 * 1024 * 1024},});

// Client-side early check if (file.size > 10 * 1024 * 1024) {alert("File too large (max 10MB)"); return;}

// Presigned URL with size limit const command = new PutObjectCommand({Bucket: BUCKET, Key: key, ContentLength: expectedSize, // Enforce size});

User-controlled filename allows path traversal

Severity: CRITICAL

Situation: User uploads file named "../../../etc/passwd". You use filename directly. File saved outside upload directory. System files overwritten.

Symptoms:

  • Files outside upload directory
  • System file access

Why this breaks: User input should never be used directly in file paths. Path traversal sequences can escape intended directories.

Recommended fix:

SANITIZE FILENAMES

import path from "path"; import crypto from "crypto";

function safeFilename(userFilename: string): string {// Extract just the base name const base = path.basename(userFilename);

// Remove any remaining path chars const sanitized = base.replace(/[^a-zA-Z0-9.-]/g, "_");

// Or better: generate new name entirely const ext = path.extname(userFilename).toLowerCase(); const allowed = [".jpg", ".png", ".pdf"];

if (!allowed.includes(ext)) {throw new Error("Invalid extension");}

return crypto.randomUUID() + ext;}

// Never do this const path = "uploads/" + req.body.filename; // DANGER!

// Do this const path = "uploads/" + safeFilename(req.body.filename);

Presigned URL shared or cached incorrectly

Severity: MEDIUM

Situation: Presigned URL for private file returned in API response. Response cached by CDN. Anyone with cached URL can access private file for hours.

Symptoms:

  • Private files accessible via cached URLs
  • Access after expiry

Why this breaks: Presigned URLs grant temporary access. If cached or shared, access extends beyond intended scope.

Recommended fix:

CONTROL PRESIGNED URL DISTRIBUTION

// Short expiry for sensitive files const url = await getSignedUrl(s3, command, {expiresIn: 300, // 5 minutes});

// No-cache headers for presigned URL responses return Response.json({url}, {headers: {"Cache-Control": "no-store, max-age=0",},});

// Or use CloudFront signed URLs for more control

Validation Checks

Only checking file extension

Severity: CRITICAL

Message: Check magic bytes, not just extension

Fix action: Use file-type library to verify actual type

User filename used directly in path

Severity: CRITICAL

Message: Sanitize filenames to prevent path traversal

Fix action: Use path.basename() and generate safe name

Collaboration

Delegation Triggers

  • image optimization CDN -> performance-optimization (Image delivery)
  • storing file metadata -> postgres-wizard (Database schema)

When to Use

  • User mentions or implies: file upload
  • User mentions or implies: S3
  • User mentions or implies: R2
  • User mentions or implies: presigned URL
  • User mentions or implies: multipart
  • User mentions or implies: image upload
  • User mentions or implies: cloud storage

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.95%
按下载量换算1,157

Antigravity

21.51%
按下载量换算860

OpenCode

15.97%
按下载量换算638

Gemini CLI

11.34%
按下载量换算453

Cursor

7.26%
按下载量换算290

Codex

3.23%
按下载量换算129

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills