go-create-cache

Community

Generate Go Redis-backed cache layers with TTL.

Authorcristiano-pacheco
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This skill provides a standardized approach to building Redis-backed cache layers in Go applications, ensuring consistent interfaces and implementations across internal modules.

Core Features & Use Cases

  • Two-file pattern: Port interface in ports/<cache_name>_cache.go and cache implementation in cache/<cache_name>_cache.go.
  • Deterministic structure: Interface naming, constructor, and key-building helpers follow a strict convention to promote maintainability.
  • TTL with randomness: Includes a randomized TTL to prevent cache stampedes and improve cache efficiency.
  • Fx wiring: Ready-to-wire in module.go using fx.Provide with proper As() binding.
  • Real-world scenarios include user activation caches, session caches, and domain-specific caches backed by Redis.

Quick Start

Implement a new cache by adding a port interface and a cache struct following the required two-file pattern in your module directory.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: go-create-cache
Download link: https://github.com/cristiano-pacheco/ai-rules/archive/main.zip#go-create-cache

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.