[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M718MQC3Z0P80R5J4219V2TR":3,"skill-same:01M718MQC3Z0P80R5J4219V2TR":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":14,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":51,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":52,"install":53,"resources":66},"01M718MQC3Z0P80R5J4219V2TR","file-uploads",null,"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.","sapsapshen\u002Fai-memory-router","sapsapshen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F20347959?v=4","01M6XDQEF1DP50DKF37H81J3J5","shenmian","01M6XDQEJPE41Y3DT2763X8ZJN",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Ffile-uploads\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"file","uploads","file uploads","s3","Optimization","cloudflare r2","r2","at","2026","storage","how","apache","image","spawner","files","how to","Cloud Storage","cloudflare","expert","multipart","2026-11-10 10:12:30",false,"---\nname: file-uploads\ndescription: Expert at handling file uploads and cloud storage. Covers S3,\n  Cloudflare R2, presigned URLs, multipart uploads, and image optimization.\n  Knows how to handle large files without blocking.\nrisk: none\nsource: vibeship-spawner-skills (Apache 2.0)\ndate_added: 2026-02-27\n---\n\n# File Uploads & Storage\n\nExpert at handling file uploads and cloud storage. Covers S3,\nCloudflare R2, presigned URLs, multipart uploads, and image\noptimization. Knows how to handle large files without blocking.\n\n**Role**: File Upload Specialist\n\nCareful about security and performance. Never trusts file\nextensions. Knows that large uploads need special handling.\nPrefers presigned URLs over server proxying.\n\n### Principles\n\n- Never trust client file type claims\n- Use presigned URLs for direct uploads\n- Stream large files, never buffer\n- Validate on upload, optimize after\n\n## Sharp Edges\n\n### Trusting client-provided file type\n\nSeverity: CRITICAL\n\nSituation: User uploads malware.exe renamed to image.jpg. You check\nextension, looks fine. Store it. Serve it. Another user\ndownloads and executes it.\n\nSymptoms:\n- Malware uploaded as images\n- Wrong content-type served\n\nWhy this breaks:\nFile extensions and Content-Type headers can be faked.\nAttackers rename executables to bypass filters.\n\nRecommended fix:\n\n# CHECK MAGIC BYTES\n\nimport { fileTypeFromBuffer } from \"file-type\";\n\nasync function validateImage(buffer: Buffer) {\n  const type = await fileTypeFromBuffer(buffer);\n  \n  const allowedTypes = [\"image\u002Fjpeg\", \"image\u002Fpng\", \"image\u002Fwebp\"];\n  \n  if (!type || !allowedTypes.includes(type.mime)) {\n    throw new Error(\"Invalid file type\");\n  }\n  \n  return type;\n}\n\n\u002F\u002F For streams\nimport { fileTypeFromStream } from \"file-type\";\nconst type = await fileTypeFromStream(readableStream);\n\n### No upload size restrictions\n\nSeverity: HIGH\n\nSituation: No file size limit. Attacker uploads 10GB file. Server runs\nout of memory or disk. Denial of service. Or massive\nstorage bill.\n\nSymptoms:\n- Server crashes on large uploads\n- Massive storage bills\n- Memory exhaustion\n\nWhy this breaks:\nWithout limits, attackers can exhaust resources. Even\nlegitimate users might accidentally upload huge files.\n\nRecommended fix:\n\n# SET SIZE LIMITS\n\n\u002F\u002F Formidable\nconst form = formidable({\n  maxFileSize: 10 * 1024 * 1024, \u002F\u002F 10MB\n});\n\n\u002F\u002F Multer\nconst upload = multer({\n  limits: { fileSize: 10 * 1024 * 1024 },\n});\n\n\u002F\u002F Client-side early check\nif (file.size > 10 * 1024 * 1024) {\n  alert(\"File too large (max 10MB)\");\n  return;\n}\n\n\u002F\u002F Presigned URL with size limit\nconst command = new PutObjectCommand({\n  Bucket: BUCKET,\n  Key: key,\n  ContentLength: expectedSize, \u002F\u002F Enforce size\n});\n\n### User-controlled filename allows path traversal\n\nSeverity: CRITICAL\n\nSituation: User uploads file named \"..\u002F..\u002F..\u002Fetc\u002Fpasswd\". You use\nfilename directly. File saved outside upload directory.\nSystem files overwritten.\n\nSymptoms:\n- Files outside upload directory\n- System file access\n\nWhy this breaks:\nUser input should never be used directly in file paths.\nPath traversal sequences can escape intended directories.\n\nRecommended fix:\n\n# SANITIZE FILENAMES\n\nimport path from \"path\";\nimport crypto from \"crypto\";\n\nfunction safeFilename(userFilename: string): string {\n  \u002F\u002F Extract just the base name\n  const base = path.basename(userFilename);\n  \n  \u002F\u002F Remove any remaining path chars\n  const sanitized = base.replace(\u002F[^a-zA-Z0-9.-]\u002Fg, \"_\");\n  \n  \u002F\u002F Or better: generate new name entirely\n  const ext = path.extname(userFilename).toLowerCase();\n  const allowed = [\".jpg\", \".png\", \".pdf\"];\n  \n  if (!allowed.includes(ext)) {\n    throw new Error(\"Invalid extension\");\n  }\n  \n  return crypto.randomUUID() + ext;\n}\n\n\u002F\u002F Never do this\nconst path = \"uploads\u002F\" + req.body.filename; \u002F\u002F DANGER!\n\n\u002F\u002F Do this\nconst path = \"uploads\u002F\" + safeFilename(req.body.filename);\n\n### Presigned URL shared or cached incorrectly\n\nSeverity: MEDIUM\n\nSituation: Presigned URL for private file returned in API response.\nResponse cached by CDN. Anyone with cached URL can access\nprivate file for hours.\n\nSymptoms:\n- Private files accessible via cached URLs\n- Access after expiry\n\nWhy this breaks:\nPresigned URLs grant temporary access. If cached or shared,\naccess extends beyond intended scope.\n\nRecommended fix:\n\n# CONTROL PRESIGNED URL DISTRIBUTION\n\n\u002F\u002F Short expiry for sensitive files\nconst url = await getSignedUrl(s3, command, {\n  expiresIn: 300, \u002F\u002F 5 minutes\n});\n\n\u002F\u002F No-cache headers for presigned URL responses\nreturn Response.json({ url }, {\n  headers: {\n    \"Cache-Control\": \"no-store, max-age=0\",\n  },\n});\n\n\u002F\u002F Or use CloudFront signed URLs for more control\n\n## Validation Checks\n\n### Only checking file extension\n\nSeverity: CRITICAL\n\nMessage: Check magic bytes, not just extension\n\nFix action: Use file-type library to verify actual type\n\n### User filename used directly in path\n\nSeverity: CRITICAL\n\nMessage: Sanitize filenames to prevent path traversal\n\nFix action: Use path.basename() and generate safe name\n\n## Collaboration\n\n### Delegation Triggers\n\n- image optimization CDN -> performance-optimization (Image delivery)\n- storing file metadata -> postgres-wizard (Database schema)\n\n## When to Use\n\n- User mentions or implies: file upload\n- User mentions or implies: S3\n- User mentions or implies: R2\n- User mentions or implies: presigned URL\n- User mentions or implies: multipart\n- User mentions or implies: image upload\n- User mentions or implies: cloud storage\n","# File Uploads & Storage\n\nExpert at handling file uploads and cloud storage. Covers S3,\nCloudflare R2, presigned URLs, multipart uploads, and image\noptimization. Knows how to handle large files without blocking.\n\n**Role**: File Upload Specialist\n\nCareful about security and performance. Never trusts file\nextensions. Knows that large uploads need special handling.\nPrefers presigned URLs over server proxying.\n\n### Principles\n\n- Never trust client file type claims\n- Use presigned URLs for direct uploads\n- Stream large files, never buffer\n- Validate on upload, optimize after\n\n## Sharp Edges\n\n### Trusting client-provided file type\n\nSeverity: CRITICAL\n\nSituation: User uploads malware.exe renamed to image.jpg. You check\nextension, looks fine. Store it. Serve it. Another user\ndownloads and executes it.\n\nSymptoms:\n- Malware uploaded as images\n- Wrong content-type served\n\nWhy this breaks:\nFile extensions and Content-Type headers can be faked.\nAttackers rename executables to bypass filters.\n\nRecommended fix:\n\n# CHECK MAGIC BYTES\n\nimport { fileTypeFromBuffer } from \"file-type\";\n\nasync function validateImage(buffer: Buffer) {\n  const type = await fileTypeFromBuffer(buffer);\n  \n  const allowedTypes = [\"image\u002Fjpeg\", \"image\u002Fpng\", \"image\u002Fwebp\"];\n  \n  if (!type || !allowedTypes.includes(type.mime)) {\n    throw new Error(\"Invalid file type\");\n  }\n  \n  return type;\n}\n\n\u002F\u002F For streams\nimport { fileTypeFromStream } from \"file-type\";\nconst type = await fileTypeFromStream(readableStream);\n\n### No upload size restrictions\n\nSeverity: HIGH\n\nSituation: No file size limit. Attacker uploads 10GB file. Server runs\nout of memory or disk. Denial of service. Or massive\nstorage bill.\n\nSymptoms:\n- Server crashes on large uploads\n- Massive storage bills\n- Memory exhaustion\n\nWhy this breaks:\nWithout limits, attackers can exhaust resources. Even\nlegitimate users might accidentally upload huge files.\n\nRecommended fix:\n\n# SET SIZE LIMITS\n\n\u002F\u002F Formidable\nconst form = formidable({\n  maxFileSize: 10 * 1024 * 1024, \u002F\u002F 10MB\n});\n\n\u002F\u002F Multer\nconst upload = multer({\n  limits: { fileSize: 10 * 1024 * 1024 },\n});\n\n\u002F\u002F Client-side early check\nif (file.size > 10 * 1024 * 1024) {\n  alert(\"File too large (max 10MB)\");\n  return;\n}\n\n\u002F\u002F Presigned URL with size limit\nconst command = new PutObjectCommand({\n  Bucket: BUCKET,\n  Key: key,\n  ContentLength: expectedSize, \u002F\u002F Enforce size\n});\n\n### User-controlled filename allows path traversal\n\nSeverity: CRITICAL\n\nSituation: User uploads file named \"..\u002F..\u002F..\u002Fetc\u002Fpasswd\". You use\nfilename directly. File saved outside upload directory.\nSystem files overwritten.\n\nSymptoms:\n- Files outside upload directory\n- System file access\n\nWhy this breaks:\nUser input should never be used directly in file paths.\nPath traversal sequences can escape intended directories.\n\nRecommended fix:\n\n# SANITIZE FILENAMES\n\nimport path from \"path\";\nimport crypto from \"crypto\";\n\nfunction safeFilename(userFilename: string): string {\n  \u002F\u002F Extract just the base name\n  const base = path.basename(userFilename);\n  \n  \u002F\u002F Remove any remaining path chars\n  const sanitized = base.replace(\u002F[^a-zA-Z0-9.-]\u002Fg, \"_\");\n  \n  \u002F\u002F Or better: generate new name entirely\n  const ext = path.extname(userFilename).toLowerCase();\n  const allowed = [\".jpg\", \".png\", \".pdf\"];\n  \n  if (!allowed.includes(ext)) {\n    throw new Error(\"Invalid extension\");\n  }\n  \n  return crypto.randomUUID() + ext;\n}\n\n\u002F\u002F Never do this\nconst path = \"uploads\u002F\" + req.body.filename; \u002F\u002F DANGER!\n\n\u002F\u002F Do this\nconst path = \"uploads\u002F\" + safeFilename(req.body.filename);\n\n### Presigned URL shared or cached incorrectly\n\nSeverity: MEDIUM\n\nSituation: Presigned URL for private file returned in API response.\nResponse cached by CDN. Anyone with cached URL can access\nprivate file for hours.\n\nSymptoms:\n- Private files accessible via cached URLs\n- Access after expiry\n\nWhy this breaks:\nPresigned URLs grant temporary access. If cached or shared,\naccess extends beyond intended scope.\n\nRecommended fix:\n\n# CONTROL PRESIGNED URL DISTRIBUTION\n\n\u002F\u002F Short expiry for sensitive files\nconst url = await getSignedUrl(s3, command, {\n  expiresIn: 300, \u002F\u002F 5 minutes\n});\n\n\u002F\u002F No-cache headers for presigned URL responses\nreturn Response.json({ url }, {\n  headers: {\n    \"Cache-Control\": \"no-store, max-age=0\",\n  },\n});\n\n\u002F\u002F Or use CloudFront signed URLs for more control\n\n## Validation Checks\n\n### Only checking file extension\n\nSeverity: CRITICAL\n\nMessage: Check magic bytes, not just extension\n\nFix action: Use file-type library to verify actual type\n\n### User filename used directly in path\n\nSeverity: CRITICAL\n\nMessage: Sanitize filenames to prevent path traversal\n\nFix action: Use path.basename() and generate safe name\n\n## Collaboration\n\n### Delegation Triggers\n\n- image optimization CDN -> performance-optimization (Image delivery)\n- storing file metadata -> postgres-wizard (Database schema)\n\n## When to Use\n\n- User mentions or implies: file upload\n- User mentions or implies: S3\n- User mentions or implies: R2\n- User mentions or implies: presigned URL\n- User mentions or implies: multipart\n- User mentions or implies: image upload\n- User mentions or implies: cloud storage\n",{"name":5,"risk":44,"source":45,"date_added":46,"description":7},"none","vibeship-spawner-skills (Apache 2.0)",1772150400000,"main","7a38d8e7073e61c16eda85681cb32fb68a8657a5","skills-store\u002Fglobal\u002Ffile-uploads","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router","https:\u002F\u002Fgithub.com\u002Fsapsapshen","2026-04-14 21:12:12",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add sapsapshen\u002Fai-memory-router --skill file-uploads",{"tool":59,"command":60},"bunx","bunx skills add sapsapshen\u002Fai-memory-router --skill file-uploads",{"tool":62,"command":63},"pnpm","pnpm dlx skills add sapsapshen\u002Fai-memory-router --skill file-uploads","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Ffile-uploads\u002FSKILL.md",true,[],[68,78,85,93,99,107],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":72,"licenseFileUrl":73,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":77},"01M72R8PZX1ABFHJGTYPA4CAF1","webapp-testing","To test local web applications, write native Python Playwright scripts.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fwebapp-testing\u002FSKILL.md",[],[],"2026-11-10 22:39:42",{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":77},"01M72QG37MMZNDY7X7GXPAK5W6","python-packaging","Comprehensive guide to creating, structuring, and distributing Python packages using modern packaging tools, pyproject.toml, and publishing to PyPI.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fpython-packaging\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":72,"licenseFileUrl":89,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":77},"01M72NXR0QMP9G46TW6A2DH59C","canvas-design","These are instructions for creating design philosophies - aesthetic movements that are then EXPRESSED VISUALLY. Output only .md files, .pdf files, and .png files.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fcanvas-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fcanvas-design\u002FSKILL.md",[],[],{"skillNo":94,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":72,"licenseFileUrl":95,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":77},"01M72N55TK3EEQ4QK4AWDC2KZS","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":72,"licenseFileUrl":103,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":77},"01M72MTWC150CFAP4Y5GSNKF80","slack-gif-creator","A toolkit providing utilities and knowledge for creating animated GIFs optimized for Slack.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fslack-gif-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fslack-gif-creator\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":72,"licenseFileUrl":111,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":77},"01M72KPT3VVNSP88MNAY466TZT","frontend-design","You are a frontend designer-engineer, not a layout generator.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Ffrontend-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Ffrontend-design\u002FSKILL.md",[],[]]