storage-development

Your requested text has been cleared and is ready for the next step.

6|3|Updated Apr 8, 2022
One-click install
npx skills add https://github.com/Rytass/Utils --skill storage-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: storage-development
Source: https://github.com/Rytass/Utils/tree/main/.claude/skills/storage-development
Command: npx skills add https://github.com/Rytass/Utils --skill storage-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers build and extend the @rytass/storages base package, providing a unified foundation for storage adapters, file converters, and error handling.

Core Features & Use Cases

  • Provides the Storage<O> base class and StorageInterface contract to ensure consistency across adapters.
  • Integrates ConverterManager to apply file transformations (e.g., resizing, encoding) before upload.
  • Demonstrates common implementation patterns for hash-based filenames, error translation, and idempotent operations.

Quick Start

Create a new adapter by extending Storage<MyOptions>, implement write/read/remove/isExists, wire up a converter pipeline, and reuse getBufferFilename/getStreamFilename to produce stable, unique keys.

Frequently Asked Questions about storage-development

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

FAQPage Schema
How do I build a custom storage adapter in TypeScript?

To build a custom storage adapter in TypeScript, extend the Storage<O> base class and implement the write, read, remove, and isExists methods to expose a consistent API. You then wire up a converter pipeline and reuse hash-based filename generation utilities.

How does the file-converter pipeline work with storage uploads?

The file-converter pipeline applies transformations like resizing or encoding to buffers and streams before upload. It uses ConverterManager to process files through the workflow, ensuring data is properly formatted before reaching the final storage destination.

Can I use hash-based filename generation for storage uploads?

Yes, you can use hash-based filename generation for storage uploads by reusing the getBufferFilename and getStreamFilename utilities. These functions produce stable, unique keys that ensure idempotent operations across your storage adapter.

How do I handle storage errors and edge cases in TypeScript?

You handle storage errors in TypeScript by translating exceptions into StorageError instances with specific ErrorCode values. This pattern ensures consistent error handling across temporary uploads, renaming, deletion, and existence checks.

What's the best way to ensure consistent APIs across different storage adapters?

The best way to ensure consistent APIs across storage adapters is to implement the StorageInterface contract and extend the Storage<O> base class. This enforces a unified foundation for file operations and error translation across all implementations.

Do I need TypeScript to implement the storage base package?

Yes, you need TypeScript to implement the storage base package because it relies on generic types like Storage<O> and strongly typed contracts like StorageInterface. This ensures type safety across adapters, hash-based utilities, and converter workflows.