What problem does it solve?
It solves the problem of repeatedly performing expensive file processing (like PDF parsing, text extraction, and image analysis) even when the underlying file content has not changed.
Core Features & Use Cases
- Content-hash cache keys: Use SHA-256 over file bytes so cache hits survive file renames/moves and invalidate automatically on content changes.
- Simple file-per-entry storage: Store each cached result as {hash}.json for O(1) lookup without maintaining an index.
- Service-layer separation: Keep extraction logic pure and wrap it with a cache-checking service layer to enable or disable caching via configuration.
- Robustness for cache failures: Treat corrupted cache entries as misses so processing can self-heal on the next run.
- Chunked hashing for large files: Hash in fixed-size chunks (e.g., 64KB) to avoid loading entire files into memory.
Quick Start
Ask the skill to implement a cache-enabled wrapper that computes a SHA-256 content hash for an input file and returns the cached extraction result when {hash}.json exists, otherwise extracts and writes the new cache entry.