Token导航 LogoToken导航

Agent Skill · 效率

context-guardian(context guardian 效率)

context-guardian 用于补充效率相关能力,适合在 OpenClaw 中需要让 Agent 承接效率相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

context-guardian 是效率类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为只读;许可证为 MIT-0,第三方扫描有提醒项,按安装量在效率类的 21,003 个 Skill 里排第 5,735。

总安装 10,454周安装 440GitHub Stars 公开资料未说明下载 3,661核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
1.0.1

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:context-guardian(context guardian 效率)
来源仓库:https://github.com/brucey0017-cloud/context-guardian
安装命令:
openclaw skills install context-guardian
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

ClawHubOpenClaw
openclaw skills install context-guardian

这个 Skill 是做什么的

效率类 Skill 把重复的整理、汇总、转换工作交给助手完成,减少手工复制粘贴。

context-guardian 通过智能三级警报实现主动上下文监控,帮助识别何时需要重启会话以维持输出质量。适用于长时间运行任务或复杂推理场景,防止因上下文退化导致错误累积。自动检测上下文使用率并发出预警,辅助用户及时干预。

安装命令为 openclaw skills install context-guardian,需授权进程监控权限。注意该技能可能涉及系统级资源读取,建议在可信环境中部署。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install context-guardian;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

context-guardian 怎么安装?

在终端执行 openclaw skills install context-guardian。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

context-guardian 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

context-guardian 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

context-guardian 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

context-guardian 用的人多吗?

公开数据是累计安装 10,454 次,近一周安装 440 次,下载 3,661 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

context-guardian 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理效率类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

效率类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
github

GitHub 代码协作 · OpenClaw

7,632,918545需要联网MIT-0通过
nano-pdf

Nano PDF 文档 · OpenClaw

4,249,476231需要联网MIT-0通过
auto-updater

自动更新程序 · OpenClaw

2,964,063386操作浏览器MIT-0通过
video-frames

视频帧 · OpenClaw

2,621,304112需要联网MIT-0通过
gemini

Gemini 助手 · OpenClaw

2,547,39648需要联网MIT-0有提醒
context-guardian

context guardian 效率 · 本页

10,454—只读MIT-0有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
context-guardian
version
1.0.1
description
Proactive context monitoring with smart 3-level alerts. Know when to restart before quality degrades.
author
brucey0017
tags
[monitoring, context, alerts, proactive, quality]

Context Guardian 🛡️

Your context guardian. Alerts before errors happen.

Proactive context monitoring that warns you at 60%, 70%, and 85% usage — before context pollution causes errors and hallucinations.


Why You Need This

The Problem:

  • Long conversations lead to context pollution
  • Quality degrades silently as context fills up
  • You don't know when to restart until it's too late
  • Errors and hallucinations increase after ~70% usage

The Solution:

  • Continuous monitoring of context usage
  • Smart 3-level alerts (⚠️ 60%, 🟠 70%, 🔴 85%)
  • Actionable suggestions at each level
  • Prevents duplicate alerts

Quick Start

For Agents: Heartbeat Integration

When you receive a heartbeat poll, include this check:

  1. Call session_status tool to get current context usage
  2. Parse the context percentage from the output
  3. Compare against thresholds: 60% (warning), 70% (danger), 85% (critical)
  4. If threshold exceeded and not a duplicate alert, display the appropriate alert message
  5. Update state file to track alert history

Implementation:

During heartbeat:
1. Get context usage from session_status
2. Check if usage >= 60%, 70%, or 85%
3. Load state from memory/context-guardian-state.json
4. Determine if alert should be sent (prevent duplicates)
5. If yes, display alert and update state

For Users: Enable in HEARTBEAT.md

Add to your HEARTBEAT.md:

## Context Monitoring
- Check context usage
- Alert if thresholds exceeded (60%, 70%, 85%)

The agent will automatically handle the rest.


How It Works

Monitoring

The skill calls session_status to check your current context usage percentage.

Alert Levels

⚠️ Warning (60%)

⚠️ Context: 60%
Getting full. Consider wrapping up or starting fresh soon.

🟠 Danger (70%)

🟠 Context: 70%
Pollution risk rising. Recommend:
• Finish current task
• Start new session for next task
• Or compress with context-optimizer

🔴 Critical (85%)

🔴 Context: 85% - CRITICAL
High error risk. STRONGLY recommend:
• Save work
• Start new session NOW
• Quality degradation likely

Smart Duplicate Prevention

The skill tracks alert history and only alerts when:

  1. First time reaching a threshold
  2. Alert level upgrades (60% → 70% → 85%)
  3. Usage drops below threshold then rises again

Configuration

Edit config/default.json or create config/user.json:

{
  "enabled": true,
  "checkInterval": "heartbeat",
  "thresholds": {
    "warning": 60,
    "danger": 70,
    "critical": 85
  },
  "alertMethod": "message",
  "alertStyle": "emoji",
  "preventDuplicates": true,
  "trackHistory": true,
  "suggestions": {
    "autoSuggest": true,
    "suggestCompression": true,
    "suggestRestart": true
  }
}

Options

checkInterval:

  • "heartbeat" - Check during heartbeat polls (default)
  • "cron" - Independent cron job (future)
  • number - Check every N minutes (future)

thresholds:

  • Customize alert levels (default: 60, 70, 85)

alertMethod:

  • "message" - Send as message (default)
  • "log" - Log only
  • "notification" - System notification (future)

alertStyle:

  • "emoji" - Emoji + concise text (default)
  • "text" - Plain text
  • "detailed" - Full explanation

Manual Check

You can manually check context status:

bash {baseDir}/scripts/check.sh

Integration with Other Skills

context-optimizer

When you reach 70%, the skill suggests using context-optimizer to compress your context instead of restarting.

context-recovery

After context recovery, the skill automatically resumes monitoring.


Implementation Guide for Agents

Step-by-Step Process

1. Get Context Usage

Call session_status tool and parse the output:

Example output: "Context: 54k/200k (27%)"
Extract: 27

2. Determine Alert Level

if (usage >= 85) level = "critical"
else if (usage >= 70) level = "danger"
else if (usage >= 60) level = "warning"
else level = null

3. Load State

Read {workspace}/memory/context-guardian-state.json:

{
  "lastCheck": 1709452800,
  "lastUsage": 54,
  "lastAlertLevel": "warning",
  "lastAlertTime": 1709452500,
  "history": [...]
}

4. Check if Should Alert

Prevent duplicate alerts:

shouldAlert = false

// First time reaching threshold
if (!lastAlertLevel && level) shouldAlert = true

// Level upgrade (warning → danger → critical)
if (levelNum[level] > levelNum[lastAlertLevel]) shouldAlert = true

// Usage dropped below threshold and rose again
if (lastUsage < threshold - 5 && usage >= threshold) shouldAlert = true

5. Send Alert

If shouldAlert, display the appropriate message:

⚠️ Context: 60%
Getting full. Consider wrapping up or starting fresh soon.

6. Update State

Save new state to memory/context-guardian-state.json:

{
  "lastCheck": <current_timestamp>,
  "lastUsage": <current_usage>,
  "lastAlertLevel": <level_if_alerted>,
  "lastAlertTime": <timestamp_if_alerted>,
  "history": [..., {"timestamp": <now>, "usage": <usage>}]
}

Alert Messages

Warning (60%):

⚠️ Context: 60%
Getting full. Consider wrapping up or starting fresh soon.

Danger (70%):

🟠 Context: 70%
Pollution risk rising. Recommend:
• Finish current task
• Start new session for next task
• Or compress with context-optimizer

Critical (85%):

🔴 Context: 85% - CRITICAL
High error risk. STRONGLY recommend:
• Save work
• Start new session NOW
• Quality degradation likely

State Management

State is stored in {workspace}/memory/context-guardian-state.json:

{
  "lastCheck": 1709452800,
  "lastUsage": 54,
  "lastAlertLevel": null,
  "lastAlertTime": null,
  "history": [
    {"timestamp": 1709452800, "usage": 54}
  ]
}

Troubleshooting

No alerts appearing:

  • Check that HEARTBEAT.md includes context monitoring
  • Verify heartbeat is running
  • Check state file for errors

Too many alerts:

  • Increase thresholds in config
  • Check preventDuplicates is enabled

Alerts not accurate:

  • Verify session_status is working
  • Check OpenClaw version compatibility

Examples

Heartbeat Integration

Add to HEARTBEAT.md:

## Context Monitoring
- Check context usage
- Alert if thresholds exceeded

Custom Thresholds

Create config/user.json:

{
  "thresholds": {
    "warning": 50,
    "danger": 65,
    "critical": 80
  }
}

Technical Details

Dependencies:

  • OpenClaw 2026.2.0+
  • session_status tool
  • Bash

Performance:

  • Zero overhead (only checks during heartbeat)
  • Minimal state storage (~1KB)

Privacy:

  • All data stored locally
  • No external calls
  • No telemetry

Roadmap

v1.1.0:

  • Historical trend tracking
  • Usage prediction
  • Independent cron mode

v1.2.0:

  • Auto-trigger context-optimizer
  • Visual trend graphs
  • Multi-session monitoring

Contributing

Found a bug? Have a suggestion? Open an issue or PR on GitHub.


License

MIT

平台分布

OpenClaw

86.74%
按下载量换算3,176

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

未展示

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills