← 返回 Skills 市场
davienzomq

Context Gatekeeper

作者 Davienzomq · GitHub ↗ · v0.1.1
cross-platform ✓ 安全检测通过
1594
总下载
3
收藏
3
当前安装
2
版本数
在 OpenClaw 中安装
/install context-gatekeeper
功能描述
Keeps the conversation token-friendly by summarizing recent exchanges, surfacing pending actions, and delivering a compact briefing for each turn before calling the model. Trigger this skill whenever you need to prune a bloated thread or keep the next prompt lean.
使用说明 (SKILL.md)

Context Gatekeeper

Objetivo

Reduzir o volume de tokens enviados ao modelo preservando apenas o essencial: o resumo das decisões, os próximos passos e os trechos mais recentes da conversa. Este skill roda em paralelo à sua rotina habitual, produzindo o artefato context/current-summary.md que serve como contexto de substituição (em vez de reenviar toda a conversa).

Fluxo mínimo

  1. Registre as trocas: a cada prompt/resposta, grave uma linha formatada ROLE: texto em um arquivo de histórico (context/history.txt ou qualquer caminho acessível). Exemplo:
    USER: Quero definir metas para o Q2
    ASSISTANT: Fiz um plano com marcos e métricas
    
  2. Execute o guardião:
    python skills/context-gatekeeper/scripts/context_gatekeeper.py \
      --history context/history.txt \
      --summary context/current-summary.md
    
    O script limita o resumo (até 6 sentenças por padrão), extrai atividades abertas (TODO, próxima ação, tarefa, follow-up) e inclui as últimas 4 jogadas para contexto imediato.
  3. Use o resumo: antes de chamar a API (ou responder ao usuário), injete o conteúdo de context/current-summary.md e cite os itens pendentes. Apenas depois disso, se for necessário, adicione as últimas trocas concretas (máximo de 2-3 mensagens) para clareza imediata.
  4. Repita: atualize context/history.txt com a nova resposta e execute o script novamente antes do próximo turno.

Argumentos do script

  • --history: caminho do arquivo com o log das trocas (cada linha deve ser ROLE: texto). Usa STDIN se omitido.
  • --summary: destino do resumo (substitui o arquivo se já existir).
  • --max-summary-sents: limite de sentenças resumidas (padrão 6).
  • --max-recent-turns: quantas trocas finais aparecerão na seção "Últimos turnos" (padrão 4).

Dica de operação diária

  • Monte um cron/loop leve que chame o script antes de cada resposta automática.
  • Guarde um paralelo context/pending-tasks.md e copie a seção "Pendências" do resumo para lá.
  • Sempre cite o caminho do resumo no parágrafo inicial da resposta (por exemplo: "Resumo compacto: ...") para facilitar auditoria.

Por quê isso funciona?

OpenClaw já persiste memórias em arquivos Markdown e executa /compact quando precisa. Este skill assume a mesma disciplina: em vez de confiar nos 100+ mensagens antigas que ainda estão no contexto, você carrega um briefing de 1 página antes de cada chamada. Economiza tokens e mantém o modelo focado no que realmente importa (decisões, pendências, mudanças recentes).

安全使用建议
This skill appears to do what it says: compress conversation history into a short Markdown briefing. Before installing, consider privacy and operational hygiene: 1) the skill stores entire messages in plaintext (context/history.txt, context/current-summary.md and a monitor log) — ensure those files are on an encrypted filesystem or restrict their permissions (chmod 600) and limit who can read them; 2) if you enable the auto-monitor, know it will run continuously and write logs — run it under a service account or in a sandbox if you have sensitive data; 3) there is no network exfiltration in the code, but you should still review and run the scripts in a controlled environment first; 4) the README references an ensure_context_monitor.sh that is not present — double-check startup integration before following those instructions. If you need the summary but not persistent monitoring, run the context_gatekeeper.py manually before each model call instead of enabling the auto-monitor.
功能分析
Type: OpenClaw Skill Name: context-gatekeeper Version: 0.1.1 The OpenClaw AgentSkills skill bundle 'context-gatekeeper' is designed to manage conversation context by summarizing history and identifying pending tasks. It uses local Python scripts (`context_gatekeeper.py`) for text processing and file I/O, writing summaries to `context/current-summary.md` and reading from `context/history.txt`. The `auto_monitor.py` script runs in a continuous loop, executing `context_gatekeeper.py` via `subprocess.run` whenever the history file changes, which provides a form of persistence for its stated purpose. All file operations and command executions are confined to the skill's local directory and are directly aligned with its benign function. There is no evidence of data exfiltration, unauthorized remote control, or other malicious intent, and prompt instructions are clear and purpose-driven.
能力评估
Purpose & Capability
Name/description match the included scripts and README: the Python scripts read a ROLE: message history, extract summary sentences, detect 'pendências' keywords, and write a compact Markdown briefing. No unrelated binaries, credentials, or external services are requested.
Instruction Scope
SKILL.md and the scripts explicitly instruct the agent/operator to append every incoming/outgoing message to context/history.txt and to inject context/current-summary.md before model calls. This is coherent for the purpose but means full conversation content is stored on disk in plaintext; the instructions also recommend running a persistent monitor that regenerates the summary automatically, which increases the amount of time sensitive content is retained.
Install Mechanism
There is no install spec and all code is local. The skill contains only small Python scripts and Markdown files — no downloads or external package installs are specified.
Credentials
The skill requires no environment variables, credentials, or configuration paths. The files it accesses are local (context/history.txt and context/current-summary.md), which are appropriate for the skill's stated function.
Persistence & Privilege
The skill does not force installation (always:false) and has no special platform privileges. However, the README and SKILL.md recommend running auto_monitor.py (via nohup/ensure script or cron) so the monitor can run continuously; if enabled, that background process will regularly read/write conversation logs and should be treated as persistent software on the host.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install context-gatekeeper
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /context-gatekeeper 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.1
- Updated the description in SKILL.md from Portuguese to English for broader accessibility. - No functional changes to code or workflow; only documentation was modified.
v0.1.0
- Initial release of context-gatekeeper skill. - Summarizes recent conversation history, highlighting pending actions and decisions. - Produces a compact context summary (default: up to 6 sentences plus last 4 exchanges) before each API/model call. - Helps reduce token usage by substituting full conversation history with a concise briefing. - Supports configurable history and summary file paths.
元数据
Slug context-gatekeeper
版本 0.1.1
许可证
累计安装 3
当前安装数 3
历史版本数 2
常见问题

Context Gatekeeper 是什么?

Keeps the conversation token-friendly by summarizing recent exchanges, surfacing pending actions, and delivering a compact briefing for each turn before calling the model. Trigger this skill whenever you need to prune a bloated thread or keep the next prompt lean. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1594 次。

如何安装 Context Gatekeeper?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install context-gatekeeper」即可一键安装,无需额外配置。

Context Gatekeeper 是免费的吗?

是的,Context Gatekeeper 完全免费(开源免费),可自由下载、安装和使用。

Context Gatekeeper 支持哪些平台?

Context Gatekeeper 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Context Gatekeeper?

由 Davienzomq(@davienzomq)开发并维护,当前版本 v0.1.1。

💬 留言讨论