skills/aayushbaniya2006/s3-upload-handler/SKILL.md
Handle S3 file uploads including UI components, client-side logic, and server-side processing
npx skillsauth add aiskillstore/marketplace s3-upload-handlerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides methods to handle file uploads to AWS S3 using pre-built UI components, custom client-side logic, or server-side processing.
S3Uploader for drag-and-drop or button uploads.ClientS3Uploader class for custom upload interfaces.uploadFromServer for backend file processing and uploading.Use the S3Uploader component for most user-facing upload needs.
import { S3Uploader } from "@/components/ui/s3-uploader/s3-uploader";
// Usage in a form or page
<S3Uploader
presignedRouteProvider="/api/app/your-upload-route" // API route to get signed URL
variant="dropzone" // or "button"
maxFiles={5}
accept="image/*" // or specific extensions like ".pdf,.doc"
onUpload={async (fileUrls) => {
console.log("Files uploaded:", fileUrls);
// Handle success (e.g., update form state)
}}
/>
Use ClientS3Uploader when you need full control over the UI (e.g., hidden inputs, custom buttons).
import { ClientS3Uploader } from "@/lib/s3/clientS3Uploader";
// Initialize
const uploader = new ClientS3Uploader({
presignedRouteProvider: "/api/app/your-upload-route"
});
// Upload a file
const url = await uploader.uploadFile(fileObject);
Use uploadFromServer in API routes or Server Actions for processing files (resizing, generating PDFs) before storage.
import uploadFromServer from "@/lib/s3/uploadFromServer";
// In a server context (API route/Action)
const url = await uploadFromServer({
file: base64String, // File content as base64
path: "uploads/users/avatar.jpg", // Destination path in bucket
contentType: "image/jpeg" // MIME type
});
Ensure .env.local has the necessary AWS credentials:
AWS_ACCESS_KEY_ID="your-access-key"
AWS_SECRET_ACCESS_KEY="your-secret-key"
AWS_REGION="us-east-1"
AWS_S3_BUCKET_NAME="your-bucket-name"
You typically need an API route to generate presigned URLs for the client uploader.
// src/app/api/app/upload-input-images/route.ts
import { createPresignedPost } from "@aws-sdk/s3-presigned-post";
import { S3Client } from "@aws-sdk/client-s3";
import { v4 as uuidv4 } from "uuid";
export async function POST(request: Request) {
const { fileName, fileType } = await request.json();
const client = new S3Client({ region: process.env.AWS_REGION });
const { url, fields } = await createPresignedPost(client, {
Bucket: process.env.AWS_S3_BUCKET_NAME!,
Key: `uploads/${uuidv4()}-${fileName}`,
Conditions: [
["content-length-range", 0, 10485760], // up to 10 MB
["starts-with", "$Content-Type", fileType],
],
Fields: {
acl: "public-read",
"Content-Type": fileType,
},
Expires: 600, // Seconds before the presigned post expires. 3600 by default.
});
return Response.json({ url, fields });
}
Refer to reference.md for more details.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.