← Back to Skills Marketplace
davienzomq

Context Gatekeeper

by Davienzomq · GitHub ↗ · v0.1.1
cross-platform ✓ Security Clean
1594
Downloads
3
Stars
3
Active Installs
2
Versions
Install in OpenClaw
/install context-gatekeeper
Description
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.
README (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).

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install context-gatekeeper
  3. After installation, invoke the skill by name or use /context-gatekeeper
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug context-gatekeeper
Version 0.1.1
License
All-time Installs 3
Active Installs 3
Total Versions 2
Frequently Asked Questions

What is 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. It is an AI Agent Skill for Claude Code / OpenClaw, with 1594 downloads so far.

How do I install Context Gatekeeper?

Run "/install context-gatekeeper" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Context Gatekeeper free?

Yes, Context Gatekeeper is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Context Gatekeeper support?

Context Gatekeeper is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Context Gatekeeper?

It is built and maintained by Davienzomq (@davienzomq); the current version is v0.1.1.

💬 Comments