Context Gatekeeper

v0.1.1

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.

3· 1.5k·3 current·3 all-time
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
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.
Assessment
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.

Like a lobster shell, security has layers — review code before you run it.

latestvk97abpwnvxkxefsvym862b6dc580nbkn
1.5kdownloads
3stars
2versions
Updated 1mo ago
v0.1.1
MIT-0

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).

Comments

Loading comments...