cascading-failures

cascading-failures is a skill for Claude Code, Codex from luanpdd/kit-mcp. It costs 49 tokens per session (3,346 once invoked), scanned A, original, MIT.

A guide to preventing cascading failures, where one failing or overloaded service causes other services to fail in turn. It covers time limits, safer retries, deadline sharing, circuit breakers, and reducing load.

In plain words
What is it for?
Use it when designing or reviewing services that call external dependencies, especially their timeouts, retry behavior, circuit breakers, deadlines, and load shedding.
Why use it?
It prevents slow dependencies, repeated retries, and resource exhaustion from spreading an outage through the system. This keeps one service problem from becoming a wider failure.

Skill for Claude CodeCodex

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

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is Além dos triggers canônicos do cap 22 (sem timeout, retry sem jitter, sem circuit breaker), clock skew é failure mode adicional em sistemas distribuídos: nó com.

Good fit Use it when designing or reviewing services that call external dependencies, especially their timeouts, retry behavior, circuit breakers, deadlines, and load shedding.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/luanpdd/kit-mcp
agentmods
npx agentmods add skills/luanpdd/kit-mcp/cascading-failures

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 cascading-failures

README.md
[![agentmods](https://agentmods.dev/badge/skills/luanpdd/kit-mcp/cascading-failures.svg)](https://agentmods.dev/skills/luanpdd/kit-mcp/cascading-failures)
Your own site
<a href="https://agentmods.dev/skills/luanpdd/kit-mcp/cascading-failures"><img src="https://agentmods.dev/badge/skills/luanpdd/kit-mcp/cascading-failures.svg" alt="Measured on agentmods" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,346 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00049 $0.03346
Opus 5 $0.00024 $0.01673
Sonnet 5 $0.00010 $0.00669
Haiku 4.5 $0.00005 $0.00335

Measured 4d ago against content hash 86e539892fe6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

cascading-failures 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 4d 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.

kit/skills/cascading-failures/SKILL.md · 313 lines

How it starts

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

SRE — Addressing Cascading Failures

Quando usar

LLM carrega esta skill ao analisar serviço com risco de cascade, ou durante incident em progresso onde failure se amplifica. Trigger phrases:

  • "cascading failure", "falha em cascata"
  • "retry storm", "thundering herd"
  • "outage propagando", "serviço caindo um após outro"
  • "como prevenir cascade?", "circuit breaker"
  • "cap 22 Google SRE"
  • "deadline propagation", "load shedding"

Regras absolutas

  • Cascade tem 5 triggers canônicos: server overload, resource exhaustion, service unavailability, latency spike sem timeout, retry sem jitter. Memorize-os.
  • Prevenção custa 1×, recuperação custa 100×. Toda dep crítica DEVE ter timeout + retry com jitter + circuit breaker + deadline propagation. Sem isso, cascade é questão de tempo.
  • Saturation (cap 6 v1.10) é early warning de cascade. Quando saturation > 80%, ainda há tempo. Quando hit 100%, já está em cascade.
  • Retry SEMPRE com jitter. Full jitter por default (delay = random(0, base × 2^attempt)). Sem jitter = thundering herd garantido.
  • Retry SEMPRE com deadline. Retry sem timeout amplifica cascade — call de 30s vira 90s vira 270s. Deadline propagation evita work zumbi.
  • Circuit breaker DEFAULT em qualquer dep externa. Estados closed/open/half-open. Open dispara após N failures consecutivas; half-open permite 1 probe; closed após probe verde.
  • Load shedding > 503 graceful > queue overflow. Server saturated DEVE retornar 503 com Retry-After ANTES de aceitar request que vai falhar. Aceitar e cair = pior que rejeitar.
  • Slow start em recovery. Após outage, ramp-up gradual (10% → 25% → 50% → 100%). Full blast em recovery = falha de novo (caches frios, conn pools).

Patterns canônicos

Pattern 1: 5 triggers canônicos de cascade (cap 22)

1. SERVER OVERLOAD
   Sintoma: load > capacity → latency p99 sobe 10× → errors 5xx → crashes
   Trigger upstream: traffic spike, outage de cache, batch job rodou em horário ruim
   Detect: Saturation gauge (cap 6) > 80% por > 5 min
   Resposta: load shedding + escalação manual

2. RESOURCE EXHAUSTION
   Tipos: CPU, memory, file descriptors, threads, connection pool
   Sintoma específico:
     CPU 100% → latency sobe; FDs esgotados → "too many open files"
     Memory OOM → process kill; threads → deadlock; conn pool empty → wait
   Detect: monitor por recurso específico; alarmes em 80% de cada
   Resposta: configure limits; circuit breaker; rate limit caller

3. SERVICE UNAVAILABILITY (DEP DOWN)
   Sintoma: dep externa retorna 5xx ou timeout. Sem circuit breaker:
   N clients × M retries × T deadline = explosão de calls
   Detect: error rate de dep > 50% por 1 min; latency dep > p99 normal × 5
   Resposta: circuit breaker abre; fallback (cache, default value, degraded mode)

4. LATENCY SPIKE SEM TIMEOUT
   Sintoma: dep responde lento mas não falha. Caller fica esperando.
   Conn pool de caller esgota; novos requests também ficam pendurados.
   Detect: dep latency p99 > baseline × 5
   Resposta: timeout AGRESSIVO (ex: p99.9 baseline + 50%); circuit breaker

5. RETRY SEM JITTER
   Sintoma: 1000 clients retentam ao mesmo tempo após dep recovery.
   Server recém-recuperado é matado pelo wake-up.
   Detect: traffic spike no momento exato de recovery
   Resposta: full jitter; retry budget global; slow start

Read the full file on GitHub · 313 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. 4d ago First seen · 313 lines · 49 tokens per session scan A 86e539892fe6

Subscribe to this mod's changes

cascading-failures is a skill published in the GitHub repository luanpdd/kit-mcp (1 stars, last pushed yesterday), licensed MIT. It adds 49 tokens to every session and 3,346 once invoked, about $0.0002 per session on Opus 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-09-03.

Related

Other skills, from other repositories

stripe-projects

Provision SaaS services + sync creds via Stripe Projects.

NousResearch/hermes-agent · 15 tokens

azure-eventhub-dotnet

Azure Event Hubs SDK for .NET. Use for high-throughput event streaming: sending events (EventHubProducerClient, EventHubBufferedProducerClient), receiving events (EventProcessorClient with checkpointing), partition management, and real-time data ingestion. Triggers: "Event Hubs", "event streaming"…

microsoft/skills · 94 tokens

azure-mgmt-botservice-dotnet

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".

microsoft/skills · 78 tokens

django-storages-s3

Use when configuring Django to store static and media files on AWS S3 with django-storages. Invoke when working with the STORAGES setting, S3 buckets, presigned URLs, CloudFront, or boto3-backed file storage in settings.py. Configures the Django 4.2+ STORAGES dict, public/private custom backends, presigned GET/POST…

Jeffallan/claude-skills · 138 tokens

wikipedia

Search and read Wikipedia via x wkp — MediaWiki API, no API key, zero install; query, extract, suggest, and DDG route in one module. Load for wiki, wikipedia, encyclopedia lookup, article summary.

x-cmd/x-cmd · 49 tokens

cve

Look up CVE records via x cve — cached, zero-API-key, daily xz TSV. Load for cve, vulnerability id, kev, epss, nvd, cvelist, or security advisory.

x-cmd/x-cmd · 49 tokens