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
累計下載
2510
星標
4
全站排名
#4,090
全站前 81% · 「AI 智慧體」前 86%
平台累計安裝累計下載星標評論
ClawHub ↗76251042
SkillHub ↗10224744—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

文件建議將檢查指令碼定期用於 cron 或 heartbeat;但當前材料未提供被引用的指令碼實現。自動接入前應先審閱實際邏輯,並確認模型切換和交接操作的授權邊界,不應僅憑輸出字串執行未核實的動作。

資料釋出於 2026-10-29

可以用來做什麼

  • 整理週期性上下文檢查的接入方式。
  • 解釋狀態輸出所代表的不同處理分支。
  • 核對自動化前需要檢視的指令碼和交接邏輯。

什麼時候用

  • 需要規劃會話上下文監測或模型切換流程時。
  • 需要把狀態檢查納入 heartbeat 或定時任務前。
  • 啟用自動切換或寫入交接檔案前,需要先審閱實際指令碼並確認授權時。

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

根據文件說明狀態檢查的輸出分支和下一步人工複核項;不要執行模型切換或寫交接檔案。
為週期性檢查擬定安全審查清單,先指出必須檢查的缺失指令碼和交接邏輯。

月度資料趨勢

累計下載2510
1103185926142026-03 · 累計下載 12072026-05 · 累計下載 17772026-07 · 累計下載 21782026-08 · 累計下載 23622026-09 · 累計下載 251026-0326-09
星標4
3452026-03 · 星標 42026-05 · 星標 42026-07 · 星標 42026-08 · 星標 42026-09 · 星標 426-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-092510—4
2026-082362+8.4%4
2026-072178—4
2026-051777—4
2026-031207—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),按月更新。口徑說明見資料方法。