BigHugger
sk Skill · affaan-m

content-hash-cache-pattern

Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation. Use when repeated file processing is slow and results should be cached and invalidated by content rather than path.

installs 8w
1,713
30-day movement
starts with the next reading
Related entries
6
Connections
0
pythonJavaScript

A SKILL.md that teaches an AI coding agent the content-hash cache pattern: keying caches on SHA-256 file content instead of paths, storing entries as `{hash}.json`, and wrapping pure processing functions in a separate caching service layer. It covers when to activate, core implementation steps, design decisions, best practices, anti-patterns, and cases where the pattern fits poorly.

Reach for it when your agent is writing file-processing code where the same files get reprocessed and you want caching that invalidates automatically when content changes.

Use it to

  • Add content-hash caching to PDF or OCR pipelines
  • Implement --cache/--no-cache flags in CLI tools
  • Cache text extraction and image analysis results
  • Refactor path-based caches to content-based keys
  • Review code for caching anti-patterns

For Developers building Python file-processing pipelines with repeated expensive work

Host repository
affaan-m/ECC
Installs, lifetime
3,000
Installs, 8 weeks
1,713
Host stars
261k
Host language
JavaScript
topicscachingsha-256file-processingpythondesign-patternsagent-skill