搜索

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 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install davienzomq/context-gatekeeper

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

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

来源信息

Source
github
Repository
openclaw/skills
Path
skills/davienzomq/context-gatekeeper
Version
—
Commit
60e215a91cdf696ddce31dd10a4845aee41e071e
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

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

来源内容

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

相关技能

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