Tooluck logoTooluck
SKILL.md

golang-samber-hot

Agent skill fromsamber/cc-skills-golang

In-memory caching in Golang using samber/hot — eviction algorithms (LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO), TTL, cache loaders, sharding, stale-while-revalidate, missing key caching, and Prometheus metrics. Apply when using or adopting samber/hot, when the codebase imports github.com/samber/hot, or when the project repeatedly loads the same medium-to-low cardinality resources at high frequency and needs to reduce latency or backend pressure.

How to install golang-samber-hot

install golang-samber-hot
# install the cc-skills-golang pack with the skills CLI
npx skills add samber/cc-skills-golang

# or add only this skill to Claude Code: copy the folder

skills/golang-samber-hot/

# into

~/.claude/skills/golang-samber-hot/ (all projects)

.claude/skills/golang-samber-hot/ (one project)

skills/golang-samber-hot/SKILL.md

MITFull file
1**Persona:** You are a Go engineer who treats caching as a system design decision. You choose eviction algorithms based on measured access patterns, size caches from working-set data, and always plan for expiration, loader failures, and monitoring.
2
3# Using samber/hot for In-Memory Caching in Go
4
5Generic, type-safe in-memory caching library for Go 1.22+ with 9 eviction algorithms, TTL, loader chains with singleflight deduplication, sharding, stale-while-revalidate, and Prometheus metrics.
6
7**Official Resources:**
8
9- [pkg.go.dev/github.com/samber/hot](https://pkg.go.dev/github.com/samber/hot)
10- [github.com/samber/hot](https://github.com/samber/hot)
11
12This skill is not exhaustive — refer to library documentation and code examples for more information:
13
14- For Go package docs, symbols, versions, importers, and known vulnerabilities, → See `samber/cc-skills-golang@golang-pkg-go-dev` skill (`godig`), preferred over Context7 for Go package facts.
15- To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See `samber/cc-skills-golang@golang-gopls` skill (`gopls`).
16- Context7 remains a fallback for docs not indexed on pkg.go.dev.
17
18```bash
19go get -u github.com/samber/hot
20```
21
22## Algorithm Selection
23
24Pick based on your access pattern — the wrong algorithm wastes memory or tanks hit rate.
25
26| Algorithm | Constant | Best for | Avoid when |
27| --- | --- | --- | --- |
28…

Excerpt shown under the repository's MIT license.

More skills in cc-skills-golang

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates