davidcastagnetoa/skills

circuit_breaker

Patrón circuit breaker con pybreaker/tenacity para aislar fallos de agentes sin afectar al sistema completo

First seen Mar 2, 2026

Installation

$ npx skills add davidcastagnetoa/skills --skill circuit_breaker

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from davidcastagnetoa/skills · top by installs.

npx skills add davidcastagnetoa/skills

Browse all from davidcastagnetoa/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 1
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,457 B
  • docs SUMMARY.md 131 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 13 installs

SKILL.md

circuit_breaker

El circuit breaker detecta cuando un servicio/agente está fallando repetidamente y corta el flujo de peticiones temporalmente, evitando la cascada de fallos y permitiendo recuperación.

When to use

Envolver todas las llamadas a servicios externos, modelos ML y otros agentes con un circuit breaker.

Instructions

  1. Instalar: pip install pybreaker tenacity.
  2. Con pybreaker:

```python import pybreaker facematchbreaker = pybreaker.CircuitBreaker(failmax=5, resettimeout=60)

@facematchbreaker def callfacematchservice(embedding1, embedding2): return facematchclient.compare(embedding1, embedding_2) ```

  1. Estados: CLOSED (normal) → OPEN (fallo, rechaza peticiones) → HALF_OPEN (prueba recuperación).
  2. Configurar failmax=5 (5 fallos consecutivos → OPEN) y resettimeout=60 (60s antes de HALF_OPEN).
  3. En OPEN: devolver respuesta de fallback o error con código específico SERVICE_UNAVAILABLE.
  4. Emitir métrica a Prometheus cuando el breaker cambia de estado.

Notes

  • tenacity complementa el circuit breaker con retry + backoff exponencial para errores transitorios.
  • Cada agente debe tener su propio circuit breaker con parámetros ajustados a su SLO.