forge-cache: Caching
Engine: Hybrid — Forge + Vercel, Cloudflare
Purpose
First decide whether caching is justified, then audit keys, invalidation, consistency, privacy, and failure behavior.
Deterministic runtime composition
Before loading any provider procedure, run:
Resolve ../../runtime/cli/src/composition-entry.js relative to this SKILL.md, then run:
node "<resolved-absolute-runner-path>" cache compose --workflow audit --root "<repository-root>" --dry-run --json
Add one repeatable --request <provider-or-source> flag for each explicit user request. Add
--condition <task-condition> or --risk-surface <surface> only for a task fact you directly
proved; never infer one from generic wording. The command above is the default for this
audit-oriented module; for implementation use --workflow build, and for a fix, retest, or
release gate use --workflow fix, verify, or ship respectively. Read the JSON response,
keep the Forge contract at index zero, and resolve paths against the absolute runtime_root
reported in that response. Read eager[].runtimePath when entering the module. The full
selected[] list is availability/provenance; load only deferred[].runtimePath when the task
reaches that concern, in tier order. Refuse any path that escapes the root. Respect every reported
suppression and context budget. If missing is non-empty, stop and report the installation as
damaged; do not improvise a prose fallback. The runner and specialist content may live in a plugin
cache or global installation; never assume they are inside the audited repository.
Resolve and read ../fullstack-forge/references/shared/module-contract.md (applicability,
execution, mutation, verification, completion) and
../fullstack-forge/references/shared/evidence-rules.md (statuses, standards, tools, findings via
../fullstack-forge/references/PROTOCOL.md) relative to this module SKILL.md before reporting.
Never hide failed checks or claim that an operation ran when it did not.
Automatic activation signals
Activate when a request or direct repository evidence involves caching, when
the user explicitly names forge-cache, or when discovery proves an applicable boundary.
- Detected caches, CDNs, memoization, or a measured proposal to add caching
When not to activate
- No cache and no measured latency or load need
Automated support
Relevant discovery inputs are:
- cache clients and configuration
- query and request flows
- performance evidence
Deterministic support, bounded evidence only:
Agent inspection procedure
- First establish necessity: find the measured bottleneck a cache addresses; if none exists, conclude that no cache — including Redis — is justified.
- Inventory cache layers (browser, CDN, application, framework) and every key-construction site.
- Verify keys include every dimension that changes the value: user, tenant, locale, and version; test two-user and two-tenant collisions.
- Trace invalidation for each write path that changes cached data, and check TTL, stampede protection, and negative caching.
- Inspect failure behavior (cache down must degrade correctly), sensitive-data exposure in shared caches, and memory or eviction limits.
Manual inspection requirements:
- Review consistency tolerance with product owners
- Validate managed cache eviction and network policy
Stack-specific guidance:
- Account for framework, CDN, browser, server, and data caches as separate layers
Evidence to collect
Standards used as criteria:
- Redis eviction documentation
- RFC 9111
Common production failures
- Require a measured bottleneck and explicit freshness contract before recommending a cache
- Inspect key completeness, tenant and user scope, TTL, invalidation, stampede control, negative caching, serialization, and versioning
- Check sensitive-data exposure, authorization changes, eviction, memory limits, outage fallback, and observability
Missing-control checks
Each item needs direct evidence or one reasoned status.
- Evidence that caching is justified
- Cache layers
- Browser caching
- CDN caching
- Server caching
- Framework caching
- Redis usage
- Cache keys
- Tenant isolation
- User isolation
- TTL
- Invalidation
- Stampede protection
- Stale-data tolerance
- Negative caching
- Cache size
- Serialization
- Failure fallback
- Sensitive data
- Cache poisoning
- Cross-user leakage
- Cross-tenant leakage
- Cache observability
- An explicit conclusion that Redis is unnecessary when evidence supports it
Commands and tools
- Run
forge cache audit --json or fullstack-forge cache audit --json when
an explicit audit is requested and the CLI is installed. Normal feature work does not require it.
Safe fixes
- Namespace incomplete keys and add bounded TTLs where semantics are established
- Add cache hit/miss and fallback telemetry without sensitive values
Approval-required changes
- Introducing Redis or changing consistency and invalidation semantics
Verification
- Exercise hit, miss, stale, invalidated, stampede, and cache-down paths
- Confirm cross-user and cross-tenant isolation
Completion contract
Follow fullstack-forge/references/shared/completion.md and the limitations below.
Known limitations
- Cache value requires workload measurements
- Cache-key resolution is bounded to local static expressions; cross-file helpers, dynamic computed properties, and non-linear reassignment remain NOT_VERIFIED
1---2name: forge-cache-33description: First decide whether caching is justified, then audit keys, invalidation, consistency, privacy, and failure behavior.4---56# forge-cache: Caching78Engine: Hybrid — Forge + Vercel, Cloudflare910## Purpose1112First decide whether caching is justified, then audit keys, invalidation, consistency, privacy, and failure behavior.131415## Deterministic runtime composition1617Before loading any provider procedure, run:1819Resolve `../../runtime/cli/src/composition-entry.js` relative to this `SKILL.md`, then run:2021`node "<resolved-absolute-runner-path>" cache compose --workflow audit --root "<repository-root>" --dry-run --json`2223Add one repeatable `--request <provider-or-source>` flag for each explicit user request. Add24`--condition <task-condition>` or `--risk-surface <surface>` only for a task fact you directly25proved; never infer one from generic wording. The command above is the default for this26audit-oriented module; for implementation use `--workflow build`, and for a fix, retest, or27release gate use `--workflow fix`, `verify`, or `ship` respectively. Read the JSON response,28keep the Forge contract at index zero, and resolve paths against the absolute `runtime_root`29reported in that response. Read `eager[].runtimePath` when entering the module. The full30`selected[]` list is availability/provenance; load only `deferred[].runtimePath` when the task31reaches that concern, in tier order. Refuse any path that escapes the root. Respect every reported32suppression and context budget. If `missing` is non-empty, stop and report the installation as33damaged; do not improvise a prose fallback. The runner and specialist content may live in a plugin34cache or global installation; never assume they are inside the audited repository.353637Resolve and read `../fullstack-forge/references/shared/module-contract.md` (applicability,38execution, mutation, verification, completion) and39`../fullstack-forge/references/shared/evidence-rules.md` (statuses, standards, tools, findings via40`../fullstack-forge/references/PROTOCOL.md`) relative to this module `SKILL.md` before reporting.4142Never hide failed checks or claim that an operation ran when it did not.4344## Automatic activation signals4546Activate when a request or direct repository evidence involves caching, when47the user explicitly names `forge-cache`, or when discovery proves an applicable boundary.4849- Detected caches, CDNs, memoization, or a measured proposal to add caching5051## When not to activate5253- No cache and no measured latency or load need5455## Automated support5657Relevant discovery inputs are:5859- cache clients and configuration60- query and request flows61- performance evidence6263Deterministic support, bounded evidence only:6465- `inspect-cache-usage`6667## Agent inspection procedure68691. First establish necessity: find the measured bottleneck a cache addresses; if none exists, conclude that no cache — including Redis — is justified.702. Inventory cache layers (browser, CDN, application, framework) and every key-construction site.713. Verify keys include every dimension that changes the value: user, tenant, locale, and version; test two-user and two-tenant collisions.724. Trace invalidation for each write path that changes cached data, and check TTL, stampede protection, and negative caching.735. Inspect failure behavior (cache down must degrade correctly), sensitive-data exposure in shared caches, and memory or eviction limits.7475Manual inspection requirements:7677- Review consistency tolerance with product owners78- Validate managed cache eviction and network policy7980Stack-specific guidance:8182- Account for framework, CDN, browser, server, and data caches as separate layers8384## Evidence to collect8586Standards used as criteria:8788- Redis eviction documentation89- RFC 91119091## Common production failures9293- Require a measured bottleneck and explicit freshness contract before recommending a cache94- Inspect key completeness, tenant and user scope, TTL, invalidation, stampede control, negative caching, serialization, and versioning95- Check sensitive-data exposure, authorization changes, eviction, memory limits, outage fallback, and observability9697## Missing-control checks9899Each item needs direct evidence or one reasoned status.100101- Evidence that caching is justified102- Cache layers103- Browser caching104- CDN caching105- Server caching106- Framework caching107- Redis usage108- Cache keys109- Tenant isolation110- User isolation111- TTL112- Invalidation113- Stampede protection114- Stale-data tolerance115- Negative caching116- Cache size117- Serialization118- Failure fallback119- Sensitive data120- Cache poisoning121- Cross-user leakage122- Cross-tenant leakage123- Cache observability124- An explicit conclusion that Redis is unnecessary when evidence supports it125126## Commands and tools127128- Run `forge cache audit --json` or `fullstack-forge cache audit --json` when129 an explicit audit is requested and the CLI is installed. Normal feature work does not require it.130131## Safe fixes132133- Namespace incomplete keys and add bounded TTLs where semantics are established134- Add cache hit/miss and fallback telemetry without sensitive values135136## Approval-required changes137138- Introducing Redis or changing consistency and invalidation semantics139140## Verification141142- Exercise hit, miss, stale, invalidated, stampede, and cache-down paths143- Confirm cross-user and cross-tenant isolation144145## Completion contract146147Follow `fullstack-forge/references/shared/completion.md` and the limitations below.148149## Known limitations150151- Cache value requires workload measurements152- Cache-key resolution is bounded to local static expressions; cross-file helpers, dynamic computed properties, and non-linear reassignment remain NOT_VERIFIED