go-cms-cache

Implements cache architecture rules for GO CMS stores, aliases, keys, tags, and invalidation.

Updated Jun 15, 2026
One-click install
npx skills add https://github.com/vernal96/go-cms --skill go-cms-cache-vernal96
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: go-cms-cache
Source: https://github.com/vernal96/go-cms/tree/main/.codex/skills/go-cms-cache
Command: npx skills add https://github.com/vernal96/go-cms --skill go-cms-cache-vernal96

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing caching in GO CMS is error-prone: modules can couple to physical stores, keys and tags get mixed up, and cross-store invalidation breaks cache coherence. This Skill defines the architectural model and implementation rules so cache changes stay correct and consistent. ## Core Features & Use Cases - Layered cache model: Separates physical stores (Redis, filesystem, memory) from module-local aliases, deterministic keys, and semantic dependency tags. - Cross-store invalidation: Defines a runtime-owned coherence mechanism so one mutation invalidates dependent entries across aliases and stores without exposing the global cache manager to modules. - Read-through caching and testing: Prescribes a typed Remember helper, TTL-plus-tag policy, fail-open observability, and behavior-driven tests for hits, misses, expiry, and cross-store invalidation. - Use Case: When adding caching to a resource repository, use this Skill to choose the alias, key format, dependency tags, TTL, and the mutation paths that must trigger invalidation, then write the required behavioral tests. ## Quick Start Ask the AI to design or review a cache implementation for a GO CMS module following the go-cms-cache rules, specifying the store, alias, key, tags, TTL, and invalidation paths.

Frequently Asked Questions about go-cms-cache

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add caching to a GO CMS module?▼

Request a cache alias through the module-scoped manager with ctx.Caches().Store(alias), never resolving physical stores by technology name. Define deterministic keys, semantic dependency tags, and a TTL, then use a typed Remember helper for read-through loading.

What is the difference between a cache store, alias, key, and tag?▼

A store is physical infrastructure like Redis or filesystem owned by the application layer. An alias is a module-local storage policy bound to a store, a key identifies the cached value, and a tag identifies dependencies that trigger invalidation.

How does cross-store cache invalidation work in GO CMS?▼

A runtime-owned coherence mechanism tracks cache targets and fans dependency invalidation out to every participating alias and store. Modules must not iterate physical stores, hardcode other modules' aliases, or receive the global cache manager directly.

Should I use TTL or tags for cache invalidation?▼

Use tags as the primary correctness mechanism for data with semantic dependencies and TTL as a safety bound. TTL alone is acceptable only for data whose staleness is inherently time-based and needs no mutation-triggered invalidation.

What happens when the cache backend fails in GO CMS?▼

Cache failures follow a fail-open policy so domain operations continue from the authoritative source, since cache is an optimization rather than the source of truth. Hits, misses, read and write errors, and invalidation errors must still be logged and measured.

What tests are required for cache changes in GO CMS?▼

Required behavior-driven tests cover miss-then-load-then-hit, write followed by fresh read, TTL expiry, corrupt payload recovery, and backend failure handling. Cross-store changes need at least one test proving invalidation crosses the intended alias and store boundary.