Skip to content
Back to skills

Hz Error Guard

ASecurity

实时监控错误、自动拦截、预防问题

  • 21 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 7, 2026
toolspythonapi

Works with

  • api

Security analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill hz-error-guard --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Hz Error Guard?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Hz Error Guard
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-hz-error-guard/badge)](https://www.skillsdirectory.com/skills/modbender-hz-error-guard)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: error-guard - 错误守卫
description: 实时监控错误、自动拦截、预防问题
---

# error-guard - 错误守卫

## 功能
实时监控错误、自动拦截、预防问题

## 核心机制

### 1. 错误分类

#### 致命错误 (立即处理)
- 内存溢出
- 磁盘满
- 认证失效
- 系统崩溃

#### 严重错误 (快速处理)
- API 超时
- 连接失败
- 权限不足

#### 警告 (记录并监控)
- 速率限制
- 临时失败
- 资源紧张

#### 信息 (仅记录)
- 调试日志
- 性能指标

### 2. 错误模式识别
```python
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. 错误预防
```python
# 执行前验证
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. 错误恢复
```python
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)
```

---

*🦞 辉仔 - 错误终结者*

Files in this skill

  • SKILL.md2.1 KB
  • benchmark-worker.ts1.7 KB
  • control.ts2.9 KB
  • events.ts599 B
  • heartbeat.ts773 B
  • moltbook-worker.ts1.8 KB
  • spawn.ts706 B
  • state.ts830 B
  • watchdog.ts1.2 KB
  • worker-events.ts1.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.