hai-storage

Unify file operations across local and S3-compatible storage backends.

3|7|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/hai-series/hai-framework --skill hai-storage
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hai-storage
Source: https://github.com/hai-series/hai-framework/tree/main/packages/cli/templates/skills/hai-storage
Command: npx skills add https://github.com/hai-series/hai-framework --skill hai-storage

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provide a unified file storage interface across local filesystem and S3-compatible storage, simplifying cross-environment storage operations.

Core Features & Use Cases

  • Unified file operations: put, get, head, exists, delete, deleteMany, copy for files and directory listings via storage.dir
  • Presign and public access: generate signed URLs for client uploads and downloads, and obtain public URLs
  • Cross-backend support: LocalProvider and S3Provider with config-driven selection
  • Use cases include: user file uploads, asset management, backups, and cross-environment data migration

Quick Start

Initialize the storage system with your config and start using storage.file and storage.presign APIs for uploading and accessing files.

Frequently Asked Questions about hai-storage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I unify file storage operations across local filesystems and S3?

You can unify file storage across local and S3-compatible backends by using a consistent storage API that supports file-level operations like put, get, head, exists, delete, and copy without changing code logic.

How do I generate pre-signed URLs for client uploads and private downloads?

You can generate pre-signed URLs for client uploads and private downloads by using the presign workflow, allowing secure direct browser uploads and private file retrieval without exposing backend credentials.

Can I manage directory listings and batch file deletions with S3 storage APIs?

Yes, you can manage directory listings via the storage.dir API and execute batch file deletions using the deleteMany operation across both local and S3-compatible storage providers.

Does this unified storage API require external dependencies for S3 integration?

No external dependencies are required beyond the configured storage provider, as the API enforces structured error handling with clear HaiStorageError codes and ensures type-safe integration.

What is the best way to handle user file uploads and asset management across different environments?

The best way to handle user file uploads, asset management, and backups across environments is implementing config-driven provider selection to seamlessly switch between LocalProvider and S3Provider.