Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

circuit-breaker断路器

Agent Skill

circuit-breaker 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

766

周安装

31

GitHub Stars

1

下载量

241
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:circuit-breaker(断路器)
来源仓库:https://github.com/pixel-process-ug/superkit-agents
仓库路径:skills/circuit-breaker
安装命令:
npx skills add https://github.com/pixel-process-ug/superkit-agents --skill circuit-breaker
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/pixel-process-ug/superkit-agents --skill circuit-breaker

简介

circuit-breaker 用于查找、检索和筛选相关信息,适合快速定位候选结果。

  • 适用于需要根据关键词或任务场景从来源线索中筛选信息的场景。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用该技能。
  • 安装前需确认权限范围和维护状态,注意可能触发联网或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Overview

The circuit-breaker skill is a safety mechanism that prevents infinite loops, resource exhaustion, and accidental destruction during autonomous development. It operates at the loop level (complementing resilient-execution which operates at the task level). Without circuit-breaker protection, autonomous loops can waste hours on stagnant problems, exhaust API limits, or accidentally destroy configuration files. This skill enforces hard boundaries that keep autonomous operations productive and safe.

Announce at start: "Circuit breaker is active — monitoring for stagnation, rate limits, and file protection."


Phase 1: Circuit State Check

Before each loop iteration, check the current circuit state:

+-----------+     threshold     +-----------+     cooldown     +------------+
|  CLOSED   |----exceeded----->|   OPEN    |----elapsed------>| HALF-OPEN  |
|  (normal) |                  |  (halted) |                  |  (probe)   |
+-----------+                  +-----------+                  +-----+------+
     ^                                                              |
     |                          success                             |
     +--------------------------------------------------------------+
     |                          failure                             |
     |                    +-----------+                              |
     +--------------------+   OPEN    |<----------------------------+
                          +-----------+
StateMeaningAction
CLOSEDNormal operationExecute iteration, monitor all thresholds
OPENHalted due to threshold breachReport status, wait for cooldown, or escalate
HALF-OPENProbing after cooldownAllow ONE iteration. If success: close. If failure: re-open.
STOP: Check circuit state BEFORE executing any loop iteration. Do NOT execute if circuit is OPEN.

Phase 2: Stagnation Detection

Monitor these thresholds continuously during autonomous operation:

ConditionThresholdDetection MethodAction
No progress3 consecutive loops with zero meaningful changesTrack files modified + tasks completed per loopOPEN circuit
Identical errors5 consecutive loops producing the same errorCompare error messages across iterationsOPEN circuit
Output decline70% decline in output volume across iterationsCompare output line count across last 3 iterationsOPEN circuit
Permission denials3 consecutive tool permission failuresTrack permission errorsOPEN circuit
Test fix loop>80% of effort spent on test fixes onlyTrack work type per iterationOPEN circuit, investigate root cause
Circular approachSame 2-3 approaches alternating without resolutionTrack approach historyOPEN circuit

Stagnation Scoring

Each iteration, compute a progress score:

IndicatorScore
New test passing that was previously failing+3
Task marked complete+5
File modified with meaningful changes+1
Build/lint error resolved+2
Same error as previous iteration-2
No files modified-3
Reverted previous changes-1

Threshold: If cumulative score across 3 iterations is negative, OPEN the circuit.

STOP: If any threshold is breached, OPEN the circuit immediately. Do NOT attempt "one more try."

Phase 3: Recovery Protocol

When the circuit opens, follow this recovery sequence:

Cooldown Period

  • Default: 30 minutes before retry
  • Purpose: Prevents rapid cycling through the same failing state
  • After cooldown: Circuit enters HALF-OPEN state

HALF-OPEN Behavior

  1. Allow exactly ONE iteration to execute
  2. If successful (positive progress score): Close circuit, resume normal operation
  3. If failed (same stagnation pattern): Re-open circuit, double the cooldown timer

Recovery Strategy Decision Table

Stagnation TypeStrategy 1Strategy 2Strategy 3Strategy 4
No progress (stuck on same task)Regenerate plan with fresh analysisBreak stuck task into 3+ subtasksSkip to next task, return laterEscalate to user
Identical errors (same error repeating)Change approach entirelyCheck if error is environmentalSearch for known issue/workaroundEscalate with error log
Test fix loop (tests keep breaking)Review test assumptionsCheck if implementation approach is flawedSimplify implementation scopeEscalate with test analysis
Circular approach (alternating same fixes)Step back and re-analyze root causeTry approach NOT yet attemptedReduce scope to minimal working versionEscalate with approach history
STOP: After recovery, monitor the next 3 iterations closely. If stagnation recurs, escalate immediately.

Phase 4: Rate Limiting

Track and enforce API usage limits:

ParameterDefaultPurpose
MAX_CALLS_PER_HOUR100Prevents API overuse
Reset windowHourly (rolling)Automatic counter reset
Countdown displayActiveShows remaining calls before limit

Rate Limit Behavior

  1. Track API calls per rolling hour
  2. At 80% of limit: display warning, prioritize remaining calls
  3. At 100% of limit: pause execution, display countdown to reset
  4. Never exceed limit — wait for reset window

Three-Layer Timeout Detection

For long-running operations (especially API calls with extended limits):

LayerDetectionFallback
1. Timeout guardExit code 124 or timeout signalCapture partial output, log what completed
2. JSON validationParse response structureAttempt text extraction from raw response
3. Text fallbackRaw output captureLog everything, report for human review

Phase 5: File Protection

Protected Paths

PathTypeWhy Protected
.ralph/DirectoryLoop state and configuration
.ralphrcFileRalph configuration
IMPLEMENTATION_PLAN.mdFileCurrent plan — source of truth for loop
AGENTS.mdFileAgent definitions
specs/DirectorySpecifications — source of truth for features
.claude/DirectoryClaude Code configuration
CLAUDE.mdFileAgent operating manual
memory/DirectoryPersisted learnings across sessions

Protection Mechanisms

MechanismHow It WorksWhen It Triggers
Allowlist enforcementOnly permitted tools can modify protected filesBefore any file write to protected path
Integrity validationCheck protected files exist after each iterationEnd of every loop iteration
Pre-operation checksVerify protected files before destructive operationsBefore rm, git clean, git checkout.
Restricted commandsBlock git clean, git rm on protected paths, rm -rf on config dirsWhen command targets protected path

Pre-Destructive Operation Checklist

Before any rm, git clean, or git checkout.:

  1. List all files that will be affected
  2. Check each against the protected paths list
  3. If ANY protected file would be affected: ABORT and report
  4. If safe: proceed with caution
  5. After operation: verify all protected files still exist
STOP: If a protected file is missing after any operation, halt immediately and restore it.

Phase 6: Monitoring and Metrics

Track these metrics across loop iterations:

MetricPurposeAlert Threshold
Loop countTotal iterations executed>20 for a single task
Tasks completedProgress measurement0 for 3+ iterations
Files modifiedChange velocity0 for 3+ iterations
Test pass rateQuality trendDeclining for 3+ iterations
Error frequencyStagnation early warningIncreasing for 3+ iterations
Output volumeProductivity trend70% decline
API calls remainingRate limit proximity<20% remaining
Progress scoreOverall healthNegative for 3 iterations

Per-Iteration Status Log

## Iteration [N] — [timestamp]
- Circuit state: CLOSED / HALF-OPEN
- Tasks completed: [N]
- Files modified: [list]
- Tests: [X passed, Y failed, Z skipped]
- Errors encountered: [list]
- Progress score: [+/- N]
- API calls remaining: [N]
- Stagnation risk: LOW / MEDIUM / HIGH

Anti-Patterns / Common Mistakes

What NOT to DoWhy It FailsWhat to Do Instead
Ignore stagnation signalsWastes hours on unsolvable problemsOpen circuit at threshold breach
Manually override open circuitBypasses safety mechanismFollow recovery protocol properly
Skip file protection checksConfig deletion derails entire projectAlways verify protected files after operations
Set cooldown to zeroRapid cycling through same failureRespect 30-minute minimum cooldown
Count test-fix-only iterations as progressMasks the real problem (flawed approach)Flag >80% test-fix effort as stagnation
Delete and recreate protected filesLoses configuration stateNever delete protected files, only update
Ignore rate limit warningsHits hard limit mid-operationPrioritize when at 80% of limit
Run destructive commands without pre-checksMay delete protected filesAlways check affected files first

Anti-Rationalization Guards

ThoughtReality
"One more try will fix it"That is what you said 3 iterations ago. Open the circuit.
"The error is almost fixed""Almost" for 5 iterations means the approach is wrong.
"I cannot stop now, I am so close"Sunk cost fallacy. Open circuit, reassess.
"The cooldown is too long"The cooldown prevents wasting more time on the same failure.
"These config files are not important"They are protected for a reason. Do not delete them.
"The rate limit will not be hit"Track it. Do not guess.
"This is a different error"Check if it is truly different or the same root cause manifesting differently.
Do NOT override an open circuit. Follow the recovery protocol.

Integration Points

SkillRelationship
resilient-executionTask-level retries (3 attempts). Circuit-breaker activates AFTER resilient-execution exhausts retries within individual tasks.
autonomous-loopCircuit-breaker monitors the loop. Opens circuit when loop-level stagnation detected.
ralph-statusStatus block provides metrics for stagnation detection.
verification-before-completionCircuit-breaker ensures verification passes before closing a loop.
self-learningStagnation patterns are persisted to memory for future avoidance.
auto-improvementCircuit-breaker events feed into improvement metrics.

Scope Clarification

ScopeSkillBehavior
Task-levelresilient-executionTry 3 approaches for a single failing task
Loop-levelcircuit-breakerHalt the entire loop when patterns indicate systemic failure

The circuit breaker activates AFTER resilient-execution has exhausted its retries within individual tasks. If tasks keep failing despite 3 retries each, the circuit breaker detects the pattern.


Process Summary

  1. Before each loop iteration: Check circuit state (CLOSED/HALF-OPEN/OPEN)
  2. If OPEN: Report status, wait for cooldown, or escalate
  3. If HALF-OPEN: Allow one probe iteration, evaluate result
  4. If CLOSED: Execute normally, monitor all thresholds
  5. After each iteration: Update metrics, compute progress score, evaluate thresholds
  6. If threshold exceeded: Open circuit, report reason, begin cooldown
  7. After cooldown: Enter HALF-OPEN, allow one probe
  8. After probe: Close if successful, re-open with doubled cooldown if failed

Skill Type

RIGID — Thresholds and protection rules must be followed exactly. Do not relax circuit breaker conditions. Do not override open circuits. Do not skip file protection checks. Do not ignore stagnation signals.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.11%
按下载量换算82

Claude

30.33%
按下载量换算73

Cursor

17.62%
按下载量换算42

Gemini CLI

8.1%
按下载量换算20

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills