dotnet-resiliency-ai-kit

Configure resilient .NET HttpClient and Refit clients with retry, circuit breaker, and rate limiting.

Updated May 11, 2026
One-click install
npx skills add https://github.com/ducthang-hub/nw-ai-kit --skill dotnet-resiliency-ai-kit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-resiliency-ai-kit
Source: https://github.com/ducthang-hub/nw-ai-kit/tree/main/.agents/skills/dotnet-resiliency-ai-kit
Command: npx skills add https://github.com/ducthang-hub/nw-ai-kit --skill dotnet-resiliency-ai-kit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you prevent cascading failures and improve the reliability of outbound HTTP dependencies by adding standardized resiliency patterns (retry, timeouts, circuit breakers, and rate limiting) to your .NET HttpClient and Refit clients.

Core Features & Use Cases

  • Standard Resilience Pipeline: Applies an ordered set of strategies—rate limiting, total request timeout, retry, circuit breaker, and attempt timeout—using Microsoft.Extensions.Http.Resilience.
  • Granular Handling for Transient Failures: Enables selective retries based on specific conditions such as HTTP 503 or 429 responses to avoid unnecessary retries.
  • Custom Pipelines When Needed: Supports replacing the standard pipeline with a named custom resilience handler for scenarios where default retry/circuit behavior isn’t appropriate.

Quick Start

Add Microsoft.Extensions.Http.Resilience and configure your HttpClient or Refit client with AddStandardResilienceHandler so retry, circuit breaking, and rate limiting protect your upstream calls from transient faults and overload.

Frequently Asked Questions about dotnet-resiliency-ai-kit

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

FAQPage Schema
How do I add a retry policy and circuit breaker to .NET HttpClient?

To add a retry policy and circuit breaker to .NET HttpClient, configure Microsoft.Extensions.Http.Resilience using AddStandardResilienceHandler. This applies an ordered resilience pipeline to prevent cascading failures from transient HTTP errors.

Can I use standard resilience handlers with Refit clients in .NET?

Yes, you can apply standard resilience handlers to Refit clients in .NET. Configuring AddStandardResilienceHandler on your Refit client protects upstream calls from transient faults, timeouts, and overload scenarios using rate limiting and circuit breaking.

How do I handle HTTP 503 and 429 responses in .NET without causing cascading failures?

Handle HTTP 503 and 429 responses in .NET by applying a standard resilience pipeline. This configuration enables selective retries with exponential backoff and rate limiting to reduce impact from transient dependency errors and prevent cascading failures.

What is the default resilience pipeline order in Microsoft.Extensions.Http.Resilience?

The default resilience pipeline order in Microsoft.Extensions.Http.Resilience applies rate limiting, total request timeout, retry with exponential backoff, circuit breaker, and per-attempt timeout to ensure reliable outbound HTTP communication.

When should I use a custom resilience handler instead of AddStandardResilienceHandler?

Use a custom resilience handler instead of AddStandardResilienceHandler when the default retry and circuit breaker behavior is not appropriate for your scenario. You can configure a named custom pipeline using AddResilienceHandler for granular control.

Does .NET HttpClient support rate limiting for outbound HTTP calls?

Yes, .NET HttpClient supports rate limiting for outbound HTTP calls. By configuring Microsoft.Extensions.Http.Resilience, you can apply rate limiting as part of the standard resilience pipeline to protect upstream services from overload scenarios.