소스 정보
- 저장소
- mikailustuner/OmniRule
- 최근 소스 활동
- 2026년 5월 8일 23:36
- 감지된 SKILL.md 언어
- 영어
- 스타
- 5
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/mikailustuner/OmniRule --skill file-handling명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | file-handling |
| description | File handling: Upload strategy, storage patterns, CDN integration, processing. |
| triggers | {"extensions":[".ts"],"keywords":["fs","file","upload","stream","multer","S3","storage","download","blob"]} |
| auto_load_when | Implementing file upload/download or storage |
| agent | architect |
| tools | ["Read","Write","Bash"] |
Focus: Upload, storage, CDN, processing
When to use local storage:
├── Development only
├── Single server, no scaling
└── Small files, low traffic
When to use object storage:
├── Production (S3, GCS, Blob)
├── Any production workload
├── Built-in redundancy, CDN integration
└── Scale infinitely
Storage selection:
├── S3/GCS/Blob → Most cases, production
├── Local → Dev only, never prod
├── Database (BLOB) → Small files, rare access
└── CDN origin → Large media, high traffic
Upload approaches:
├── Direct upload (client → storage)
&& Best for large files
&& Server doesn't bottleneck
&& Presigned URLs
│
├── Proxy upload (client → server → storage)
&& Validate before storage
&& Transform/process
&& Easier to control
│
└── Form upload
&& Simple
|| File goes through server
|| Not for large files
When to use each:
├── Large files → Direct (presigned URL)
├── Small files, validation needed → Proxy
├── Very simple → Form upload
└── Mobile → Direct (bandwidth)
When to process files:
├── Immediate (synchronous)
&& Small files
&& Fast processing
&& User waits for result
│
├── Background (asynchronous)
&& Large files
&& Slow processing
&& User notified when done
│
└── On-demand (lazy)
&& Process when accessed
&& Save storage
&& First access slower
Processing location:
├── Before storage → Virus scan, validate
├── At access → Resize images, generate thumbnails
└── Background → Transcode video, OCR
When to use CDN:
├── Static assets (images, videos, documents)
├── Global users
└── High traffic, reduce origin load
When NOT to use CDN:
├── Dynamic content
├── Real-time data
└── Very low traffic
CDN patterns:
├── Cache everything public
├── Invalidate on updates
├── Signed URLs for private
└── Regional edges for global
What to validate:
├── Type
&& Check MIME type, not extension
&& Use magic numbers
│
├── Size
&& Max file size limit
&& Min size (prevent empty)
│
├── Content
&& Virus/malware scan
&& Image validity
|| Document structure
│
└── Name
&& Sanitize characters
&& Limit length
|| Avoid path traversal
When to clean up:
├── Failed uploads → Immediate
├── Expired documents → Scheduled
├── Old versions → Policy-based
└── User deletion → Immediate
Cleanup methods:
├── Immediate: on failed upload
├── Scheduled: nightly/weekend job
├── Policy: TTL-based cleanup
└── Manual: user-triggered delete
❌ Reading entire large file into memory (fs.readFileSync)
✅ Stream large files: createReadStream + pipe
❌ User-controlled file paths without sanitization (path traversal)
✅ path.basename() + restrict to allowed directory
❌ Storing uploaded files on server disk (ephemeral in serverless)
✅ Stream directly to S3 / object storage
❌ No file type validation (accept any extension)
✅ Check magic bytes (file-type library), not just extension
❌ Synchronous file operations in hot paths
✅ Always async: fs.promises / streams in API handlers
| Scenario | API | Note |
|---|---|---|
| Read small file | fs.promises.readFile | Await |
| Read large file | fs.createReadStream | Streaming |
| Write atomically | write to tmp then rename | Prevents corruption |
| Upload to S3 | @aws-sdk/lib-storage | Multipart auto |
| Temp file | tmp / os.tmpdir | Clean up on close |
| Watch file | fs.watch / chokidar | chokidar more reliable |