[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EF0TPRSZBHQSD5JQQHT27T":3,"skill-same:01M6EF0TPRSZBHQSD5JQQHT27T":121},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":22,"linkOnly":23,"markdownContent":24,"markdownBody":24,"frontMatter":25,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M6EF0TPRSZBHQSD5JQQHT27T","file-upload-processor",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Ffile-upload-processor\u002FSKILL.md",[],[18,19,20,21],"file","processor","upload","file upload processor","2026-11-10 10:12:30",false,"# File Upload Processor\n\n## Overview\n\nBuilds secure file upload endpoints for web applications. Handles multipart form uploads, presigned URL generation for large files, file type validation via magic bytes (not just extensions), size limits, cloud storage integration (S3, GCS, R2), and upload status tracking. Produces production-ready code with streaming (no temp files on disk for small files).\n\n## Instructions\n\n### 1. Choose Upload Strategy\n\nBased on file size:\n\n- **Small files (\u003C 10MB)**: Stream through server to storage. Simple, one request.\n- **Medium files (10-100MB)**: Server-side streaming with progress tracking.\n- **Large files (> 100MB)**: Presigned multipart upload — client uploads directly to S3.\n\n### 2. File Validation\n\nAlways validate by magic bytes, never trust file extensions:\n\n```typescript\nconst MAGIC_BYTES = {\n  'image\u002Fjpeg': [0xFF, 0xD8, 0xFF],\n  'image\u002Fpng': [0x89, 0x50, 0x4E, 0x47],\n  'image\u002Fwebp': [0x52, 0x49, 0x46, 0x46], \u002F\u002F + \"WEBP\" at offset 8\n  'application\u002Fpdf': [0x25, 0x50, 0x44, 0x46],\n  'video\u002Fmp4': null, \u002F\u002F Check for \"ftyp\" at offset 4\n  'video\u002Fwebm': [0x1A, 0x45, 0xDF, 0xA3],\n};\n\nfunction detectFileType(buffer: Buffer): string | null {\n  \u002F\u002F Read first 12 bytes\n  \u002F\u002F Match against known signatures\n  \u002F\u002F Return MIME type or null if unknown\n}\n```\n\nAdditional validation:\n- Check file size BEFORE reading the full body (Content-Length header)\n- Set hard limits on multer\u002Fbusboy to abort oversized uploads\n- Scan for double extensions: `image.jpg.exe`\n- Reject files with null bytes in filename\n\n### 3. Storage Integration\n\n```typescript\n\u002F\u002F S3-compatible storage client\nclass StorageService {\n  async upload(key: string, stream: Readable, contentType: string): Promise\u003Cstring>\n  async getPresignedUploadUrl(key: string, contentType: string, expiresIn: number): Promise\u003Cstring>\n  async getPresignedDownloadUrl(key: string, expiresIn: number): Promise\u003Cstring>\n  async initiateMultipartUpload(key: string): Promise\u003C{ uploadId: string, parts: PresignedPart[] }>\n  async completeMultipartUpload(key: string, uploadId: string, parts: CompletedPart[]): Promise\u003Cvoid>\n  async delete(key: string): Promise\u003Cvoid>\n}\n```\n\nKey naming convention: `{type}\u002F{userId}\u002F{fileId}\u002F{filename}`\n\n### 4. Upload Status Tracking\n\nDatabase model:\n\n```\nfiles:\n  id: UUID\n  user_id: UUID\n  original_name: string\n  storage_key: string\n  mime_type: string\n  size_bytes: bigint\n  status: enum(uploading, uploaded, processing, processed, failed)\n  variants: jsonb (null until processed)\n  error: text (null unless failed)\n  created_at: timestamp\n  updated_at: timestamp\n```\n\n### 5. API Endpoints\n\n```\nPOST   \u002Fapi\u002Ffiles\u002Fupload          — Multipart form upload (\u003C 100MB)\nPOST   \u002Fapi\u002Ffiles\u002Fpresign         — Get presigned URL for large file upload\nPOST   \u002Fapi\u002Ffiles\u002Fmultipart\u002Finit  — Start multipart upload (> 100MB)\nPOST   \u002Fapi\u002Ffiles\u002Fmultipart\u002Fcomplete — Complete multipart upload\nGET    \u002Fapi\u002Ffiles\u002F:id\u002Fstatus      — Get upload\u002Fprocessing status\nGET    \u002Fapi\u002Ffiles\u002F:id\u002Fdownload    — Get presigned download URL\nDELETE \u002Fapi\u002Ffiles\u002F:id             — Soft delete file\n```\n\n## Examples\n\n### Example 1: Express Upload Endpoint\n\n**Prompt**: \"Create a file upload endpoint for my Express app. Accept images and PDFs, store in S3.\"\n\n**Output**: Upload route with multer streaming, magic-byte validation, S3 upload, database record creation, and error handling. Returns file ID for status polling.\n\n### Example 2: Presigned Upload for Large Videos\n\n**Prompt**: \"Users upload videos up to 2GB. I don't want them going through my server.\"\n\n**Output**: Presigned URL generation endpoint, client-side upload code with progress tracking, multipart upload for files > 100MB, and a webhook endpoint to confirm upload completion and trigger processing.\n\n## Guidelines\n\n- **Stream, don't buffer** — never load entire files into memory\n- **Validate magic bytes** — file extensions lie, magic bytes don't\n- **Set upload limits at every layer** — nginx, reverse proxy, and application\n- **Generate unique storage keys** — include user ID and file ID, never use original filename as key\n- **Return immediately** — upload ack should be instant, processing happens async\n- **Clean up on failure** — if DB write fails, delete the S3 object; if S3 fails, don't create DB record\n- **Rate limit uploads** — per user, per time window (e.g., 20 uploads per hour)\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Ffile-upload-processor",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill file-upload-processor",{"tool":41,"command":42},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill file-upload-processor",{"tool":44,"command":45},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill file-upload-processor","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Ffile-upload-processor\u002FSKILL.md",true,[49,55,59,63,67,71,75,79,83,87,91,95,99,103,107,111,115],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"BENCHMARK.md","REFERENCE","参考文档",4035,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002FBENCHMARK.md",{"path":56,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":57,"sourceHtmlUrl":58},"evals\u002Fevals.json",839,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Fevals\u002Fevals.json",{"path":60,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Ferror-patterns.md",3315,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Freferences\u002Ferror-patterns.md",{"path":64,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fimportant-parameters.md",7474,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Freferences\u002Fimportant-parameters.md",{"path":68,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fparent-model-inference.md",3052,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Freferences\u002Fparent-model-inference.md",{"path":72,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fsetup-and-run.md",5602,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Freferences\u002Fsetup-and-run.md",{"path":76,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fskill_info.yaml",4479,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Freferences\u002Fskill_info.yaml",{"path":80,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fspec_template_deploy.yaml",2733,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Freferences\u002Fspec_template_deploy.yaml",{"path":84,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fspec_template_evaluate.yaml",1890,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Freferences\u002Fspec_template_evaluate.yaml",{"path":88,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fspec_template_export.yaml",1870,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Freferences\u002Fspec_template_export.yaml",{"path":92,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fspec_template_inference.yaml",1835,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Freferences\u002Fspec_template_inference.yaml",{"path":96,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fspec_template_train.yaml",2707,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Freferences\u002Fspec_template_train.yaml",{"path":100,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":101,"sourceHtmlUrl":102},"references\u002Fspec-overrides.md",3497,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Freferences\u002Fspec-overrides.md",{"path":104,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":105,"sourceHtmlUrl":106},"references\u002Ftao-deploy-fast-foundation-stereo.md",19675,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Freferences\u002Ftao-deploy-fast-foundation-stereo.md",{"path":108,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":109,"sourceHtmlUrl":110},"references\u002Ftao-deploy-fast-foundation-stereo.skill_info.yaml",3741,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Freferences\u002Ftao-deploy-fast-foundation-stereo.skill_info.yaml",{"path":112,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":113,"sourceHtmlUrl":114},"skill-card.md",4105,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Fskill-card.md",{"path":116,"resourceType":117,"resourceTypeDesc":118,"sizeBytes":119,"sourceHtmlUrl":120},"skill.oms.sig","OTHER","其他",7889,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-train-fast-foundation-stereo\u002Fskill.oms.sig",[122,136,146,155,161,168],{"skillNo":123,"name":124,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":132,"publishedAt":22},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[127],{"categoryNo":128,"categoryName":129,"taxonomyType":130,"taxonomyTypeDesc":131},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[133,134,135],"model","model hierarchy","model hierarchy skill",{"skillNo":137,"name":138,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":142,"publishedAt":22},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[141],{"categoryNo":128,"categoryName":129,"taxonomyType":130,"taxonomyTypeDesc":131},[143,144,145],"MCP","zoom","zoom mcp",{"skillNo":147,"name":148,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":22},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[152,153,154,144],"sdk","zoom apps sdk","apps",{"skillNo":156,"name":157,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":22},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[157],{"skillNo":162,"name":163,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":167,"publishedAt":22},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[166],{"categoryNo":128,"categoryName":129,"taxonomyType":130,"taxonomyTypeDesc":131},[163],{"skillNo":169,"name":170,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":22},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[170]]