polly

polly is a skill for Claude Code, Codex from znlgis/opengis-skills. It costs 87 tokens per session (4,800 once invoked), scanned A, original, MIT.

A .NET library for handling temporary failures in calls to services, databases, and other dependencies. It combines rules such as retries, time limits, circuit breakers, rate limits, and fallback actions.

In plain words
What is it for?
Use it to retry failed HTTP or database calls, stop waiting past a timeout, pause calls to a failing service, limit request rates, and define fallback results.
Why use it?
It keeps short-lived failures from immediately breaking an application and prevents repeated calls to an unavailable dependency from making the problem worse.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to retry failed HTTP or database calls, stop waiting past a timeout, pause calls to a failing service, limit request rates, and define fallback results.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/znlgis/opengis-skills/polly
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.

Any agent
npx skills add znlgis/opengis-skills --skill polly
Clone the repo
git clone --depth 1 https://github.com/znlgis/opengis-skills

Made for: Claude Code, Codex.

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 polly

README.md
[![agentmods](https://agentmods.dev/badge/skills/znlgis/opengis-skills/polly/github.svg)](https://agentmods.dev/skills/znlgis/opengis-skills/polly)
Your own site
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/polly"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/polly/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 polly

Your own site · 80×15
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/polly"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/polly.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,800 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00087 $0.04800
Opus 5.5 $0.00035 $0.01920
Sonnet 5.5 $0.00017 $0.00960
Haiku 4.5 $0.00009 $0.00480

Measured yesterday against content hash ef11cbac5a97, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

polly scanned grade A with 1 finding 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

for i in $(seq 1 30); do curl -s -o /dev/null -w "%{http_code} " http://localhost:5080/api/pay/charge; done; echo
csharp/polly/SKILL.md · 411 lines

How it starts

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

项目地址: https://github.com/App-vNext/Polly

官方文档: https://www.pollydocs.org/

NuGet: Polly.Core 8.8.1(v8 管道与策略)、Polly.Extensions 8.8.1(DI 注册 + 遥测)、Polly.RateLimiting 8.8.1(限流策略)、Polly 8.8.1(仅承载 v7 旧 API)

配套: Microsoft.Extensions.Http.Resilience 10.11.0(IHttpClientFactory 标准弹性 handler,版本跟随 Microsoft.Extensions.*)

目标框架: net8.0 / net6.0 / netstandard2.0 / .NET Framework 4.6.2+

许可证: BSD-3-Clause

概述

Polly 是 .NET 的弹性与瞬时故障处理库。v8 起以 ResiliencePipeline 为核心:把若干策略(retry / timeout / circuit breaker / rate limiter / hedging / fallback)组合成一条管道,业务代码只负责把委托交给管道执行。

  • 策略组合:AddRetry、AddTimeout、AddCircuitBreaker 可链式叠加,顺序即执行顺序(外层先执行)
  • 同步/异步统一:Execute / ExecuteAsync,异步重载接收 CancellationToken
  • 结果型重试:ShouldHandle = PredicateBuilder.HandleResult(...) 能对 HttpResponseMessage 等返回值判定,而不只是异常
  • DI 原生支持:AddResiliencePipeline(name, builder => ...) 注册命名管道,ResiliencePipelineProvider<string> 按名解析
  • 可观测:Polly.Extensions 提供 Telemetry(日志 + 指标),与 OpenTelemetry 打通

v7 的 Policy.Handle<...>().Retry(...) 写法仍可用但不推荐:它们只存在于 Polly 包中,v8 新能力(hedging、结果型管道、DI 管道、遥测)都不会覆盖旧 API。

包 内容 什么时候用
Polly.Core ResiliencePipelineBuilder、retry / timeout / circuit-breaker / fallback / hedging 策略 新代码默认选它
Polly.Extensions AddResiliencePipeline(...)、ConfigureTelemetry(...)、DI 与遥测 需要在 IServiceCollection 里配管道
Polly.RateLimiting AddRateLimiter(...) / RateLimiterStrategyOptions 需要限流策略时单独安装(不在 Polly.Core 里)
Polly v7 旧 API:Policy / AsyncPolicy / BrokenCircuitException 只在维护既有 v7 代码时
Microsoft.Extensions.Http.Resilience AddStandardResilienceHandler 等 HTTP 专用 handler 用 IHttpClientFactory 调外部 HTTP

安装

方式一:dotnet CLI

# 只用管道本体
dotnet add package Polly.Core

# 需要 DI 注册 / 遥测
dotnet add package Polly.Extensions

# 需要限流策略(独立包)
dotnet add package Polly.RateLimiting

# 维护 v7 旧代码
dotnet add package Polly

# HttpClient 标准弹性(含重试/熔断/超时/限流)
dotnet add package Microsoft.Extensions.Http.Resilience

Read the full file on GitHub · 411 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. yesterday First seen · 411 lines · 87 tokens per session scan A ef11cbac5a97

Subscribe to this mod's changes

polly is a skill published in the GitHub repository znlgis/opengis-skills (75 stars, last pushed 2d ago), licensed MIT. It adds 87 tokens to every session and 4,800 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-28.

Related

Other skills, from other repositories

error-handling

Use when designing the reaction to a class of failures — typed error taxonomies, retry/backoff/timeout policy, circuit breakers, React/Next error boundaries, and the user-message vs operator-log split. NOT diagnosing one specific crash (that is debug), NOT logs/metrics/traces (that is observability), NOT the wire…

ericrisco/rsc-harness · 78 tokens

api-rate-limit-handler

Implement bounded, idempotency-aware API throttling, backoff, and retry handling for 429 and transient 5xx responses.

sickn33/agentic-awesome-skills · 32 tokens

webhook-architecture

Build a reliable event delivery system with automatic retries, HMAC signature verification, and dead-letter queues so no webhook is ever lost.

finsilabs/awesome-ecommerce-skills · 30 tokens

backend-resilience-patterns

Use this skill when the user says 'resilience', 'circuit breaker', 'retry', 'bulkhead', 'timeout', 'fallback', 'resilience4j', 'fault tolerance', 'rate limiter', 'backoff', 'retry strategy', 'bulkhead pattern'. This skill applies production fault-tolerance patterns: circuit breaker, retry with backoff, bulkhead…

j4flmao/agent-skills · 121 tokens

architecture-microservices-patterns

Use this skill when the user says 'microservices patterns', 'split the monolith', 'saga', 'circuit breaker', 'service decomposition', 'database per service', 'API gateway', 'strangler fig', 'distributed monolith', 'service-to-service resilience'. Decides whether and how to decompose into services, then applies the…

j4flmao/agent-skills · 150 tokens

circuit-breakers-and-retries

Building resilient distributed systems with circuit breakers, retries with full-jitter exponential backoff, retry budgets (per-request 3-attempt + per-client 10% ratio per Google SRE), deadline propagation, and the cascading-failure math (4 layers × 3 retries = 64x amplification). Grounded in Resilience4j, Microsoft…

curiositech/windags-skills · 94 tokens