What problem does it solve?
This Skill caches the results of expensive file processing tasks (like PDF parsing or text extraction) using content hashes, ensuring that cached data remains valid even if files are moved or renamed, and automatically invalidates when content changes.
Core Features & Use Cases
- Path-Independent Caching: Uses SHA-256 hash of file content as the cache key, making it resilient to file renames or moves.
- Automatic Cache Invalidation: Cache entries are automatically invalidated when the file content changes.
- Service Layer Separation: Keeps core processing functions pure by handling caching logic in a separate wrapper.
- Use Case: When building a document processing pipeline that involves computationally intensive steps like extracting text from PDFs or analyzing images, this pattern ensures that identical files are processed only once, significantly speeding up batch operations and reducing redundant computation.
Quick Start
Use the content-hash-cache-pattern skill to extract text from the file located at /path/to/document.pdf, utilizing the cache if available.