plan-forge caching.instructions.md

plan-forge caching.instructions.md is an instructions file for GitHub Copilot from srnichols/plan-forge. It costs 733 tokens per session, scanned A, original, MIT.

Guidance for adding caching to .NET applications, including temporary storage in memory or Redis, a separate data-storage service. It covers cache-aside lookups and expiration times.

In plain words
What is it for?
Use it when adding Redis or in-memory caching, choosing cache expiration rules, or implementing cache-aside reads in .NET.
Why use it?
It helps avoid repeatedly retrieving the same data from the main data store, while showing how to keep cached data from lasting too long.

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot instructions file.

Good fit Use it when adding Redis or in-memory caching, choosing cache expiration rules, or implementing cache-aside reads in .NET.

Compare 6 instructions from other repositories ↓
Install with agentmods
npx agentmods add instructions/srnichols/plan-forge/caching
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/srnichols/plan-forge

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for plan-forge caching.instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/srnichols/plan-forge/caching/github.svg)](https://agentmods.dev/instructions/srnichols/plan-forge/caching)
Your own site
<a href="https://agentmods.dev/instructions/srnichols/plan-forge/caching"><img src="https://agentmods.dev/badge/instructions/srnichols/plan-forge/caching/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for plan-forge caching.instructions.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/srnichols/plan-forge/caching"><img src="https://agentmods.dev/badge/instructions/srnichols/plan-forge/caching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 733 This file is loaded in full into every session.
When invoked 733 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. ✓ AI security review Fable 5.1 · 6 Sept 2026 📄 Read the review
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00733 $0.00733
Opus 5.5 $0.00293 $0.00293
Sonnet 5.5 $0.00147 $0.00147
Haiku 4.5 $0.00073 $0.00073

Measured 3mo ago against content hash 031d9171d0f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

plan-forge caching.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

presets/dotnet/.github/instructions/caching.instructions.md · 102 lines

How it starts

The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.

.NET Caching Patterns

Cache Strategy

Cache-Aside Pattern (Default)

public async Task<Producer?> GetByIdAsync(string id, CancellationToken ct = default)
{
    string cacheKey = $"producer:{id}";
    var cached = await _cache.GetStringAsync(cacheKey, ct);
    if (cached is not null)
        return JsonSerializer.Deserialize<Producer>(cached);

    var producer = await _repository.GetByIdAsync(id, ct);
    if (producer is not null)
    {
        await _cache.SetStringAsync(cacheKey, JsonSerializer.Serialize(producer),
            new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(15) }, ct);
    }
    return producer;
}

Redis via IDistributedCache

// Program.cs — Registration
builder.Services.AddStackExchangeRedisCache(options =>
{
    options.Configuration = builder.Configuration.GetConnectionString("Redis");
    options.InstanceName = "myapp:";
});

In-Memory Cache (Single-Instance Only)

// Use for non-distributed scenarios or local hot cache
builder.Services.AddMemoryCache();

// Hot-path lookup tables — use FrozenDictionary
private static readonly FrozenDictionary<string, string> StatusMap =
    new Dictionary<string, string>
    {
        ["active"] = "Active",
        ["inactive"] = "Inactive",
    }.ToFrozenDictionary();

Key Naming Convention

{service}:{entity}:{id}           → myapp:producer:abc-123
{service}:{entity}:list:{hash}    → myapp:producers:list:tenant-xyz
{service}:{entity}:count:{scope}  → myapp:producers:count:active

TTL Strategy

Data Type TTL Rationale
User session 30 min Security, re-auth
Entity by ID 15 min Balances freshness vs load
List/search results 5 min Volatile, frequent changes
Config/reference data 1 hr+ Rarely changes
Count/aggregate 2 min Must stay reasonably current

Cache Invalidation

// Invalidate on write
public async Task UpdateAsync(Producer producer, CancellationToken ct = default)
{
    await _repository.UpdateAsync(producer, ct);
    await _cache.RemoveAsync($"producer:{producer.Id}", ct);
    // Also invalidate list caches if needed
}

Read the full file on GitHub · 102 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 102 lines · 733 tokens per session scan A 031d9171d0f7

Subscribe to this mod's changes

plan-forge caching.instructions.md is an instructions file published in the GitHub repository srnichols/plan-forge (6 stars, last pushed 29d ago), licensed MIT. It adds 733 tokens to every session, about $0.0029 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

plan-forge caching.instructions.md compared with instructions from other repositories

plan-forge caching.instructions.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
plan-forge caching.instructions.mdsrnichols/plan-forgeInstructions file629d agoMITA733GitHub Copilot
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA9,887GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA7,230Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA3,303GitHub Copilot
deno copilot-instructions.mddenoland/denoInstructions file109ktodayMITA3,077GitHub Copilot