redis
Skill2 starsChanged 10 months agoMITView on GitHub
Implements Redis caching, session management, and distributed coordination for the Sorcha platform. Use when: Adding caching layers, token revocation, rate limiting, SignalR backplane, or distributed state.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- derogab/agent-kittheir own version, first seen Oct 2, 2026
- fworks-tech/agenthoodtheir own version, first seen Sep 28, 2026
- weiweimhy/agent-skillstheir own version, first seen Jul 1, 2026
- ffsshhttiikk/opencode-agents-skillstheir own version, first seen Feb 28, 2026
- dversoza/claude-skillstheir own version, first seen Feb 20, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- derogab/agent-kit★ 4same name
- fworks-tech/agenthood★ 3same name
- dversoza/claude-skills★ 2same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- weiweimhy/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository79 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- docs/llms-full.txtllms.txt
- llms.txtllms.txt
- aspireSkill
- aspnet-coreSkill
- blazorSkill
- blueprint-builderSkill
- configuring-opentelemetry-dotnetSkill
- coverage-analysisSkill
- coverletSkill
- cryptographySkill
- database-expertSkill
- dockerSkill
- dotnetSkill
- entity-framework-coreSkill
- entity-frameworkSkill
- fluent-assertionsSkill
- frontend-designSkill
- grpcSkill
- jwtSkill
- mcpSkill
- microsoft-extensionsSkill
- migrate-xunit-to-xunit-v3Skill
- minimal-api-file-uploadSkill
- minimal-apisSkill
- mongodbSkill
- moqSkill
- nbitcoinSkill
- network-bootstrapSkill
- nunitSkill
- optimizing-ef-core-queriesSkill
- playwrightSkill
- postgresqlSkill
- prodexecSkill
- scalarSkill
- signalrSkill
- sorcha-appSkill
- sorcha-architectureSkill
- sorcha-cliSkill
- sorcha-uiSkill
- speckit-agent-context-updateSkill
- speckit-analyzeSkill
- speckit-checklistSkill
- speckit-clarifySkill
- speckit-constitutionSkill
- speckit-git-commitSkill
- speckit-git-featureSkill
- speckit-git-initializeSkill
- speckit-git-remoteSkill
- speckit-git-validateSkill
- speckit-implementSkill
- speckit-planSkill
- speckit-specifySkill
- speckit-tasksSkill
- speckit-taskstoissuesSkill
- verifiable-credentialsSkill
- walkthrough-builderSkill
- worker-servicesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 106
Add the distributed-cache overlay explicitly, sharing the same connection name:
- Very specific: line 134
Use mcp__context7__resolve-library-id to search for "StackExchange.Redis" or "redis"
- Very specific: line 135
Prefer website documentation (/websites/redis_io) for concepts
- Very specific: line 136
Use /stackexchange/stackexchange.redis for .NET-specific patterns
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Redis Skill
Sorcha uses Redis via StackExchange.Redis for caching, token revocation tracking, rate limiting, and distributed coordination. All services share a single Redis instance managed by .NET Aspire with circuit breaker resilience.
Quick Start
Aspire Configuration
// src/Apps/Sorcha.AppHost/AppHost.cs
var redis = builder.AddRedis("redis")
.WithRedisCommander();
// Reference from any service
var blueprintService = builder.AddProject<Projects.Sorcha_Blueprint_Service>()
.WithReference(redis);Cache Store Usage
// Inject ICacheStore from Sorcha.Storage.Redis
public class MyService(ICacheStore cache)
{
public async Task<User?> GetUserAsync(string id)
{
return await cache.GetAsync<User>($"user:{id}");
}
public async Task SetUserAsync(User user)
{
await cache.SetAsync($"user:{user.Id}", user, TimeSpan.FromMinutes(15));
}
}Direct IConnectionMultiplexer
// For operations beyond ICacheStore (Sets, rate limiting, etc.)
public class TokenService(IConnectionMultiplexer redis)
{
private readonly IDatabase _db = redis.GetDatabase();
public async Task TrackTokenAsync(string userId, string jti)
{
await _db.SetAddAsync($"auth:user_tokens:{userId}", jti);
}
}Key Concepts
| Concept | Usage | Example |
| Key prefix | Namespace isolation | sorcha:, auth: |
| TTL | Automatic expiration | TimeSpan.FromMinutes(15) |
| Circuit breaker | Graceful degradation | Breaks after 5 failures |
| Sets | Token tracking | SetAddAsync, SetMembersAsync |
| Counters | Rate limiting | StringIncrementAsync |
Common Patterns
Rate Limiting
When: Protecting auth endpoints from brute force.
public async Task<bool> IsRateLimitedAsync(string identifier)
{
var key = $"auth:failed:{identifier}";
var count = await _db.StringIncrementAsync(key);
if (count == 1)
await _db.KeyExpireAsync(key, TimeSpan.FromSeconds(60));
return count >= MaxFailedAttempts;
}Token Revocation
When: Invalidating JWTs before expiration.
public async Task RevokeTokenAsync(string jti, DateTimeOffset expiresAt)
{
var ttl = expiresAt - DateTimeOffset.UtcNow;
if (ttl > TimeSpan.Zero)
await _db.StringSetAsync($"auth:revoked:{jti}", "revoked", ttl);
}IDistributedCache is a separate registration from IConnectionMultiplexer
builder.AddRedisClient("redis") wires up IConnectionMultiplexer and IDatabase — sufficient for direct StackExchange.Redis use. It does NOT register Microsoft.Extensions.Caching.Distributed.IDistributedCache. Code that depends on IDistributedCache will throw InvalidOperationException: Unable to resolve service for type 'IDistributedCache' at the first request — not at boot.
Add the distributed-cache overlay explicitly, sharing the same connection name:
builder.AddRedisClient("redis");
builder.AddRedisDistributedCache("redis"); // adds IDistributedCache → RedisRequires the Aspire.StackExchange.Redis.DistributedCaching package alongside the base Aspire.StackExchange.Redis.
Unit-test trap that masks this: tests that construct the SUT directly with new MemoryDistributedCache(Options.Create(new MemoryDistributedCacheOptions())) bypass the DI graph entirely. The test passes; the container fails at runtime. If a service under test depends on IDistributedCache, also add a thin DI-startup test (or an integration test against a TestHost) that asserts the registration exists — not just one that mocks past it. Feature 124 PR #697 was the cautionary tale: 6 unit tests with MemoryDistributedCache green, production 500'd on every endpoint call.
See Also
- patterns - Caching, resilience, key naming
- workflows - Setup, testing, debugging
Related Skills
- aspire - Redis resource configuration and service discovery
- jwt - Token revocation integration
- signalr - Redis backplane for scale-out
- docker - Redis container configuration
Documentation Resources
Fetch latest Redis and StackExchange.Redis documentation with Context7.
How to use Context7:
- Use
mcp__context7__resolve-library-idto search for "StackExchange.Redis" or "redis" - Prefer website documentation (
/websites/redis_io) for concepts - Use
/stackexchange/stackexchange.redisfor .NET-specific patterns
Library IDs:
/stackexchange/stackexchange.redis- .NET client (344 snippets)/websites/redis_io- Redis concepts (29k+ snippets)
Recommended Queries:
- "Connection pooling multiplexer patterns best practices"
- "Caching patterns TTL expiration strategies"
- "Pub/Sub patterns distributed systems"
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

