← Back to Skills Marketplace
Huizai Error Guard
by
lidekahdjdhdhsjjs-lang
· GitHub ↗
· v1.0.0
567
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install hz-error-guard
Description
Monitors, classifies, intercepts errors in real-time, enforces auto-retry and circuit breaking, and ensures graceful recovery and prevention.
README (SKILL.md)
error-guard - 错误守卫
功能
实时监控错误、自动拦截、预防问题
核心机制
1. 错误分类
致命错误 (立即处理)
- 内存溢出
- 磁盘满
- 认证失效
- 系统崩溃
严重错误 (快速处理)
- API 超时
- 连接失败
- 权限不足
警告 (记录并监控)
- 速率限制
- 临时失败
- 资源紧张
信息 (仅记录)
- 调试日志
- 性能指标
2. 错误模式识别
def detect_error_pattern(errors):
# 检测重复错误
if len(set(errors[-5:])) == 1:
return "repeating_error"
# 检测错误累积
if error_rate() > threshold:
return "error_accumulation"
# 检测级联错误
if has_cascade(errors):
return "cascade_failure"
return "isolated_error"
3. 自动拦截规则
IF 同一错误出现 3 次 THEN
记录并警告
暂停相关操作
进入熔断模式
END
IF 错误率 > 10% THEN
降低操作频率
增加重试延迟
通知管理员
END
IF 致命错误 THEN
保存完整上下文
执行优雅关闭
触发重启
END
4. 错误预防
# 执行前验证
async def pre_execution_check(command):
checks = {
"auth": verify_token(),
"resources": check_resources(),
"rate_limit": check_rate_limit(),
"dependencies": check_services()
}
if not all(checks.values()):
raise PreExecutionError("验证失败")
return True
5. 错误恢复
async def error_recovery(error):
strategies = {
"auth_error": refresh_and_retry,
"timeout_error": retry_with_backoff,
"rate_limit_error": wait_and_retry,
"resource_error": free_resources_and_retry
}
strategy = strategies.get(error.type, default_retry)
return await strategy(error)
🦞 辉仔 - 错误终结者
Usage Guidance
This skill appears to implement an agent control-plane watchdog and is internally consistent with that purpose. Before installing: 1) Review whether you are comfortable with the skill creating skills/error-guard/state.json in the agent working directory. 2) Note the skill can spawn isolated sub-agents and send events to sessions — expected for monitoring but increases blast radius if misused. 3) The flush/recover functions call SDK process.kill to terminate exec sessions; confirm that behavior is acceptable in your environment. 4) Test in a sandboxed agent first and restrict its use (or require explicit user invocation) until you are satisfied. If you want higher assurance, ask the author for signed releases or a hosted repository and verify the SDK calls (sessions_spawn/sessions_send/process.kill) are constrained by your platform's permission model.
Capability Analysis
Type: OpenClaw Skill
Name: hz-error-guard
Version: 1.0.0
The skill is classified as suspicious due to the `flush()` function in `control.ts`. This function uses the `@openclaw/sdk` to enumerate all active sessions (`process.list`) and then programmatically kill them (`process.kill`). While described as an 'emergency stop' for an 'error-guard' skill, this capability grants the skill the power to terminate arbitrary agent sessions, posing a significant risk for denial of service or unintended disruption if misused or triggered by faulty logic. This is a high-risk capability that could be exploited, rather than clear evidence of intentional malice like data exfiltration or backdoor installation.
Capability Assessment
Purpose & Capability
The name/description (error monitoring, circuit breaking, auto-retry) match the code and SKILL.md: control plane, watchdog evaluation, worker helpers, and sub-agent spawning are all present and expected for this purpose.
Instruction Scope
SKILL.md stays on-topic (error detection, pre-checks, recovery strategies). It does not instruct reading unrelated system files or exfiltrating data. The code implements event emission, registry persistence, heartbeat evaluation, and control commands consistent with the documented behavior.
Install Mechanism
No install spec (instruction-only) is provided. The package includes TypeScript runtime files but does not download external archives or run remote installers. No high-risk install URLs are present.
Credentials
The skill requests no credentials or special env vars, which aligns with its scope. It does persist a small state file to process.cwd()/skills/error-guard/state.json — this is reasonable for a local registry but you should note it writes to disk under the agent's working directory.
Persistence & Privilege
always:false and model invocation allowed (default). The code can spawn sub-agents (sessions_spawn), send messages to main sessions (sessions_send), and (on flush) list/kill execution sessions via the SDK (process.list/process.kill). Those capabilities are coherent for an emergency control-plane, but they are powerful: a flush call can attempt to terminate other exec sessions. The skill does not modify other skills' configs directly, and persistence is limited to its own state file.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install hz-error-guard - After installation, invoke the skill by name or use
/hz-error-guard - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of hz-error-guard
- Provides real-time error monitoring and interception with preventive measures.
- Categorizes errors into fatal, severe, warning, and informational levels for targeted response.
- Includes automatic error pattern detection (repetition, accumulation, cascading).
- Implements interception and mitigation rules, including circuit-breaking and alerting.
- Offers pre-execution validation and automated error recovery strategies.
Metadata
Frequently Asked Questions
What is Huizai Error Guard?
Monitors, classifies, intercepts errors in real-time, enforces auto-retry and circuit breaking, and ensures graceful recovery and prevention. It is an AI Agent Skill for Claude Code / OpenClaw, with 567 downloads so far.
How do I install Huizai Error Guard?
Run "/install hz-error-guard" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Huizai Error Guard free?
Yes, Huizai Error Guard is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Huizai Error Guard support?
Huizai Error Guard is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Huizai Error Guard?
It is built and maintained by lidekahdjdhdhsjjs-lang (@lidekahdjdhdhsjjs-lang); the current version is v1.0.0.
More Skills