resilience
Skill5 starsChanged 7 days agoMITView on GitHub
Polly v8 resilience patterns for .NET — retry, circuit breaker, timeout, hedging, and IHttpClientFactory integration using Microsoft.Extensions.Resilience.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- codewithmukesh/dotnet-claude-kittheir own version, first seen Nov 8, 2026
- vindreshsingh/engineering-skillstheir own version, first seen Oct 20, 2026
- TJM-NZ/claude-skillstheir own version, first seen Oct 11, 2026
- Resgrid/Coretheir own version, first seen Oct 8, 2026
- Rinisnotarobot/rinco-pi-skills-commandstheir own version, first seen Sep 11, 2026
- MANVENDRA-github/agentrytheir own version, first seen Jul 6, 2026
Used with
Projects with it also use observability and accessibility.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
OpenAISkillobservability
Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.
Also in 3 projects that use this
ElasticSkillaccessibility
Accessibility guidance for Kibana. Use this skill when working with or reviewing EUI components, resolving a11y-related (@elastic/eui) ESLint issues, and ensuring proper use of ARIA attributes, focus management, keyboard interactions, and accessible naming conventions.
Also in 3 projects that use this
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- codewithmukesh/dotnet-claude-kit★ 808same name
- Resgrid/Core★ 238same name
- microsoft/scope★ 78same name
- harness-studio/harness-studio★ 9same name
- Rinisnotarobot/rinco-pi-skills-commands★ 2same name
- MANVENDRA-github/agentry★ 0same name
- TJM-NZ/claude-skills★ 0same name
- vindreshsingh/engineering-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 repository15 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- aspnet-api-patternsSkill
- authenticationSkill
- cachingSkill
- clean-architectureSkill
- convention-learnerSkill
- dddSkill
- dotnet-project-initSkill
- ef-core-patternsSkill
- error-handlingSkill
- loggingSkill
- modern-csharpSkill
- opentelemetrySkill
- testing-dotnetSkill
- vertical-sliceSkill
The file
Files
Resilience Patterns (Polly v8)
Reference for building fault-tolerant .NET services using Polly v8 and Microsoft.Extensions.Resilience.
Package Reference
<PackageReference Include="Microsoft.Extensions.Resilience" Version="9.*" />
<!-- For HTTP clients: -->
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.*" />Breaking change from Polly v7: the Policy.Handle<>().Retry() API is gone. Use ResiliencePipelineBuilder exclusively.
Core Concepts
| Concept | Purpose |
ResiliencePipeline | Executes a delegate through a chain of strategies |
ResiliencePipelineBuilder | Fluent builder — add strategies in order (outermost first) |
ResiliencePipelineProvider<TKey> | DI-resolved registry; resolve pipelines by key |
ResilienceContext | Per-execution metadata (cancellation token, properties) |
Strategies execute in the order they are added. Outer strategies wrap inner ones — add timeout last to apply it per-attempt, or first to apply it to the whole pipeline.
References
Load only the file the task needs:
| File | Covers |
references/strategies.md | DI registration of pipelines; retry, circuit breaker, timeout, and hedging strategy options |
references/httpclient.md | AddStandardResilienceHandler, a custom pipeline per client, consuming the named client |
references/named-pipelines.md | Resolving keyed pipelines from ResiliencePipelineProvider<TKey> for non-HTTP work |
Recommended Pipeline Compositions
| Use Case | Strategies (outer → inner) |
| Database queries | Retry (3x exponential) → Timeout (5s) |
| HTTP API calls | Total timeout (30s) → Retry (3x) → Circuit Breaker → Attempt timeout (10s) |
| Payment processing | Circuit Breaker → Timeout (30s) — no retry (idempotency risk) |
| Read-heavy low-latency | Hedging → Timeout |
| Background job step | Retry (5x linear) → Timeout (60s) |
Gotchas
- A timeout placed inside the retry is per attempt. The worst-case wall time is roughly
attempts × attempt-timeout plus back-off delays. Add an outer timeout when callers need a hard cap
(
AddStandardResilienceHandlerdoes this: 30s total, 10s per attempt). - Polly retry stacks with EF Core's
EnableRetryOnFailure. EF's retrying execution strategy already retries transient SQL errors (SQL Server default: 6 retries). A Polly retry around the sameSaveChangesAsyncmultiplies attempts and latency. Pick one retry layer for database calls. With EF's strategy enabled, a user-initiated transaction must run insidedb.Database.CreateExecutionStrategy().ExecuteAsync(...). - Retrying a non-idempotent POST can duplicate the side effect. Retry it only with an idempotency key.
Do / Don't
| Do | Don't |
Always pass CancellationToken to ExecuteAsync | Let the pipeline ignore cancellation |
Add UseJitter = true to retry strategies | Use fixed delays (thundering herd) |
Log retries with OnRetry callback | Retry silently — you lose observability |
Set ShouldHandle to specific exceptions | Handle all exceptions with default predicate in payment flows |
| Place timeout after retry for per-attempt timeout | Nest retry inside retry (doubles the attempt count unexpectedly) |
Use AddStandardResilienceHandler for new HTTP clients | Hand-roll retry loops around HttpClient |
| Use circuit breaker for downstream service calls | Use circuit breaker for local in-memory operations |
See Also
skills/caching/SKILL.md— HybridCache stampede protection reduces load, complementing circuit breakersskills/error-handling/SKILL.md—BrokenCircuitExceptionshould surface as aResult.Failureat domain boundaries
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.

