Nietzsche247

Context Sentinel

AI 智能体v1.0.0
作者:Nietzsche247更新于 2026-05-17context-sentinel@clawhub_nietzsche247/context-sentinel
任务自动化工作流编排上下文管理#Cron Job

据 AlphaMoat 统计,截至 2026-09,Context Sentinel 累计下载 2,510 次、获 4 个星标,在全部 5,078 个 AI 技能中排名第 4,090 位,在「AI 智能体」分类(969 个)中排名第 832 位。

累计安装
102
累计下载
2,510
星标
4
全站排名
#4,090
全站前 81% · 「AI 智能体」前 86%
平台累计安装累计下载星标评论
ClawHub ↗762,51042
SkillHub ↗1022,4744—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

文档建议将检查脚本定期用于 cron 或 heartbeat;但当前材料未提供被引用的脚本实现。自动接入前应先审阅实际逻辑,并确认模型切换和交接操作的授权边界,不应仅凭输出字符串执行未核实的动作。

资料发布于 2026-10-29

可以用来做什么

  • 整理周期性上下文检查的接入方式。
  • 解释状态输出所代表的不同处理分支。
  • 核对自动化前需要查看的脚本和交接逻辑。

什么时候用

  • 需要规划会话上下文监测或模型切换流程时。
  • 需要把状态检查纳入 heartbeat 或定时任务前。
  • 启用自动切换或写入交接文件前,需要先审阅实际脚本并确认授权时。

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

根据文档说明状态检查的输出分支和下一步人工复核项;不要执行模型切换或写交接文件。
为周期性检查拟定安全审查清单,先指出必须检查的缺失脚本和交接逻辑。

月度数据趋势

累计下载2,510
1,1031,8592,6142026-03 · 累计下载 1,2072026-05 · 累计下载 1,7772026-07 · 累计下载 2,1782026-08 · 累计下载 2,3622026-09 · 累计下载 2,51026-0326-09
星标4
3452026-03 · 星标 42026-05 · 星标 42026-07 · 星标 42026-08 · 星标 42026-09 · 星标 426-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-092,510—4
2026-082,362+8.4%4
2026-072,178—4
2026-051,777—4
2026-031,207—4

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

2.4 KB · ClawHub v1.0.0
---
name: context-sentinel
description: "Monitors session context and automatically manages model switching based on a cascading protocol. Use as part of a heartbeat or cron job to maintain session health and optimize token usage."
version: 1.0.0
---

# Context Sentinel

This skill provides a script to automate the "Cascading Model Protocol," ensuring the agent gracefully degrades from high-cost models to high-context models as the session grows.
展开全部(共 70 行)
## Protocol Summary

1.  **Opus 4.6:** Use until 80% context, then switch to Opus 4.5.
2.  **Opus 4.5:** Use until 80% context, then switch to Gemini 2.5 Pro.
3.  **Gemini Pro:** Use until 80% context, then trigger a handoff.

This skill operationalizes the logic defined in `MEMORY.md`.

## How to Use

This skill is designed to be run periodically, either via a `cron` job or as part of the main agent's `HEARTBEAT.md` checklist.

### Workflow

1.  **Execute the script:**
    Run the `check_context.ps1` script to get the current session status and determine the required action.

    ```powershell
    powershell -File scripts/check_context.ps1
    ```

2.  **Evaluate the output:**
    The script will return one of three possible string commands:
    *   `SWITCH_TO:<model_id>`
    *   `HANDOFF_NOW`
    *   `STATUS_OK`

3.  **Take Action:**
    Based on the output, execute the appropriate agent command.

    *   If `SWITCH_TO:<model_id>`, run `session_status` with the new model ID:
        ```
        session_status model=<model_id>
        ```

    *   If `HANDOFF_NOW`, trigger the handoff process by writing to the handoff file. This is typically done by running a specific, pre-defined prompt or script.

    *   If `STATUS_OK`, no action is needed.

### Example Usage in `HEARTBEAT.md`

You can replace the manual checks in your `HEARTBEAT.md` with a call to this skill's script.

**Old `HEARTBEAT.md`:**
```markdown
## Cascading Model Protocol (Check Every Heartbeat)
1.  **Check Status:** Get current model and context %.
2.  **Opus 4.6:** If model is `Opus 4.6` and context > 80% -> Switch to `Opus 4.5`.
...
```

**New `HEARTBEAT.md` using this skill:**
```markdown
## Context Sentinel (Check Every Heartbeat)
1. Run `powershell -File skills/context-sentinel/scripts/check_context.ps1`.
2. Evaluate the output and take action (`SWITCH_TO`, `HANDOFF_NOW`, or `STATUS_OK`).
```

This makes the logic reusable and keeps the `HEARTBEAT.md` file clean and focused on execution.

「AI 智能体」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。