Skip to content
Back to skills

Coding

ASecurity

Handle large files and uploads without exhausting memory: streaming, presigned uploads, malware scanning, background exports, file-type checks. Use when code reads or writes big files, accepts user uploads or exports large datasets.

  • 24 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added October 14, 2026
ai-agentspythonrustgonodenodejsbackend

Works with

  • cli

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned November 22, 2026

npx -y skills add andreibesleaga/GABBE --skill coding --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Coding?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Coding
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/andreibesleaga-coding-3c52984d/badge)](https://www.skillsdirectory.com/skills/andreibesleaga-coding-3c52984d)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: file-processing
description: "Handle large files and uploads without exhausting memory: streaming, presigned uploads, malware scanning, background exports, file-type checks. Use when code reads or writes big files, accepts user uploads or exports large datasets."
triggers: [file processing, large file upload, stream a large file, presigned url upload, csv export, malware scan upload]
tags: [coding]
role: eng-backend
context_cost: low
---
# file-processing Skill

## Goal
This skill guides the handling of binary data and large datasets without blowing up RAM.

## Steps
## 1. Streaming (Chunks)
- **Problem**: Reading 1GB CSV into memory (RAM).
- **Solution**: Stream it line by line.
  - nodejs: `fs.createReadStream().pipe(csvParser())`.
  - python: `pd.read_csv(chunksize=1000)`.

## 2. Uploads (Presigned URLs)
- **Anti-Pattern**: Client -> Server (RAM buffer) -> S3.
- **Pattern**: Client -> (Request URL) -> Server; Server -> (Signed URL) -> Client; Client -> (Direct Upload) -> S3.
- **Benefit**: Server CPU/RAM is zero during upload. Infinite scalability.

## 3. Malware Scanning
- Never trust user files.
- **Sync**: ClamAV scan on upload (slow).
- **Async**: Upload to S3 (Quarantine Bucket) -> Lambda triggers Scan -> Move to Clean Bucket.

## 4. Exporting Large Data
- Don't return 100k rows in JSON response (timeout).
- **Pattern**:
  1. User requests Export.
  2. Server puts job in Queue.
  3. Worker generates CSV, uploads to S3.
  4. Server notifies User with Download Link.

## 5. File Types
- **Magic Bytes**: Check file signature (hex), not just extension.
- **Image Processing**: Resize/Optimize *async*. Use `sharp` (Node) or `Pillow` (Python).

## Constraints
- Process data as a stream with bounded memory: do not collect chunks in an array before handling them.
- Check the file type by its signature (magic bytes), not by extension.
- Never trust a user file: scan it before it is served.

## Output Format
Code for the file pipeline, plus a short note on chunk size, size limits, where files are stored and how they are scanned.

## Limits and safety
- Archives: cap total size, decompression ratio and entry count, and reject any entry whose path leaves the target directory.
- Presigned upload URLs: one object key, PUT only, expiry of 15 minutes or less.
- The application must not serve an uploaded file before the scan has finished and the file has moved out of quarantine.
- Rate-limit and deduplicate export and upload jobs, with a quota per user.
- Inspect untrusted files with maintained libraries in an isolated worker, not in the main application process.

Files in this skill

  • agent-trajectory-eval.skill.md5.7 KB
  • artisan-commands.skill.md3.7 KB
  • browser-tdd.skill.md7 KB
  • chaos-fault-injection.skill.md8.1 KB
  • ci-autofix.skill.md4.2 KB
  • clean-coder.skill.md4.5 KB
  • code-review.skill.md6.1 KB
  • debug.skill.md6.5 KB
  • documentation.skill.md7.3 KB
  • eval-driven-development.skill.md6.9 KB
  • evals/code-review.eval.yaml1 KB
  • excalidraw.skill.md3.7 KB
  • file-processing.skill.md4.3 KB
  • git-workflow.skill.md7.2 KB
  • metamorphic-testing.skill.md7.8 KB
  • mobile-dev.skill.md4.2 KB
  • nodejs-expert.skill.md1.6 KB
  • output-validation.skill.md5.4 KB
  • pbt-strategy.skill.md8 KB
  • performant-ai.skill.md3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.