Rechercher

PythonReactSEOPDF
OpenClaw

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.

davienzomq0 installations selon la source☆ 0 Étoiles du dépôt

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

SkillHub CLI

skillhub install davienzomq/context-gatekeeper

Examinez la source et la compatibilité, puis suivez les étapes d’installation.

Donnez le lien à votre agent et demandez-lui d’examiner instructions et dépendances avant d’expliquer les étapes.

Voir la source ↗Guides

Instructions

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

Informations sur la source

Source
github
Repository
openclaw/skills
Path
skills/davienzomq/context-gatekeeper
Version
—
Commit
60e215a91cdf696ddce31dd10a4845aee41e071e
Source de classification
rules
Statut
active
Visibilité
public

Ces informations proviennent de l’analyse indexée et peuvent être anciennes. Vérifiez les fichiers actuels.

README

Context Gatekeeper — Full documentation

Purpose

Context Gatekeeper keeps OpenClaw sessions token-efficient by compressing the active conversation. It summarizes the tail of the thread, spots open tasks, and keeps a short log of the latest turns so you only send what matters to the model.

Repository layout

skills/context-gatekeeper/
├── SKILL.md                  # Meta description (triggers and usage)
├── README.md                 # This reference for ClawHub and contributors
├── scripts/
│   ├── context_gatekeeper.py  # Builds the compact summary, highlights, and recent-turn log
│   ├── auto_monitor.py        # Watches history.txt and regenerates the summary automatically
│   └── ensure_context_monitor.sh  # Starts (or restarts) the monitor safely
├── context/
│   ├── history.txt           # Rolling log (ROLE: message)
│   ├── current-summary.md    # Briefing used before every reply
│   └── sample-history.txt    # Test data for quick verification
└── README.md                 # This document

Scripts overview

context_gatekeeper.py
  1. Reads the history file (ROLE: message per line) and slices the text into sentences.
  2. Picks up pending tasks by keyword (todo, task, follow-up, next step, etc.) and keeps up to the last four turns.
  3. Outputs current-summary.md containing: timestamp, "Compact summary", "Pendencies and next steps" and "Last turns" sections.
  4. You can tweak output length via --max-summary-sents, --max-pendings, and --max-recent-turns.
auto_monitor.py
  1. Runs in a loop and watches context/history.txt for modification time changes.
  2. When new content appears, it executes context_gatekeeper.py and logs the event to /tmp/context-gatekeeper-monitor.log.
  3. Ensures the summary is fresh before each answer, supporting 24/7 operation.
ensure_context_monitor.sh
  • Checks for an existing auto_monitor.py process (pgrep -f auto_monitor.py). If none exists, it launches the monitor with nohup and saves...

Contenu extrait

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**:
   ```bash
   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 resu...
README
# Context Gatekeeper — Full documentation

## Purpose
**Context Gatekeeper** keeps OpenClaw sessions token-efficient by compressing the active conversation. It summarizes the tail of the thread, spots open tasks, and keeps a short log of the latest turns so you only send what matters to the model.

## Repository layout
```
skills/context-gatekeeper/
├── SKILL.md                  # Meta description (triggers and usage)
├── README.md                 # This reference for ClawHub and contributors
├── scripts/
│   ├── context_gatekeeper.py  # Builds the compact summary, highlights, and recent-turn log
│   ├── auto_monitor.py        # Watches history.txt and regenerates the summary automatically
│   └── ensure_context_monitor.sh  # Starts (or restarts) the monitor safely
├── context/
│   ├── history.txt           # Rolling log (ROLE: message)
│   ├── current-summary.md    # Briefing used before every reply
│   └── sample-history.txt    # Test data for quick verification
└── README.md                 # This document
```

## Scripts overview

### `context_gatekeeper.py`
1. Reads the history file (ROLE: message per line) and slices the text into sentences.
2. Picks up pending tasks by keyword (todo, task, follow-up, next step, etc.) and keeps up to the last four turns.
3. Outputs `current-summary.md` containing: timestamp, "Compact summary", "Pendencies and next steps" and "Last turns" sections.
4. You can tweak output length via `--max-summary-sents`, `--max-pendings`, and `--max-recent-turns`.

### `auto_monitor.py`
1. Runs in a loop and watches `context/history.txt` for modification time changes.
2. When new content appears, it executes `context_gatekeeper.py` and logs the event to `/tmp/context-gatekeeper-monitor.log`.
3. Ensures the summary is fresh before each answer, supporting 24/7 operation.

### `ensure_context_monitor.sh`
- Checks for an existing `auto_monitor.py` process (`pgrep -f auto_monitor.py`). If none exists, it launches the monitor with `nohup` and saves...

Skills associés

OpenClaw

humanpages

human-pages-ai

Search and hire real humans for tasks — photography, delivery, research, and more

OpenClaw

openclaw-skills

zseven-w

Reusable skill templates for OpenClaw AI agents. Templates for API integration, data processing, web scraping, CLI tools, and file processing.

OpenClaw

0xarchive

0xfantommenace

Query historical crypto market data from 0xArchive across Hyperliquid, Lighter.xyz, and HIP-3. Covers orderbooks, trades, candles, funding rates, open interest, liquidations, and data quality. Use when the user...

OpenClaw

1sec-security

cutmob

Install, configure, and manage 1-SEC — an open-source, all-in-one cybersecurity platform (16 modules, single binary) on Linux servers and VPS instances. Use when the user asks to secure a server, install securi...