🦀 ClawHub
Event-Watcher
by @solitaire2015
Event watcher skill for OpenClaw. Use when you need to subscribe to event sources (Redis Streams + webhook JSONL) and wake an agent only when matching events arrive. Covers filtering, dedupe, retry, and session routing via sessions_send/agent_gate.
TERMINAL
clawhub install event-watcher📖 About This Skill
name: event-watcher description: Event watcher skill for OpenClaw. Use when you need to subscribe to event sources (Redis Streams + webhook JSONL) and wake an agent only when matching events arrive. Covers filtering, dedupe, retry, and session routing via sessions_send/agent_gate. metadata: {"openclaw":{"requires":{"python":["redis","pyyaml"]}}}
Event Watcher
Overview
Lightweight event watcher that listens to Redis Streams (and webhook JSONL) and wakes an OpenClaw session only on matching events. No events → no agent wake → no token spend.Core Capabilities
1. Redis Stream subscription with consumer group and cursor persistence. 2. Webhook JSONL ingestion viawebhook_bridge.py.
3. Filtering via JSON rules (supports AND/OR + regex).
4. Deduplication with TTL (configurable).
5. Retry on failed delivery.
6. Session routing via sessions_send or agent_gate.
7. Structured logging + counters for received/matched/delivered/failed.Recommended Usage (Agent Guidance)
Channel permissionsopenclaw.json (channels allowlist / groupPolicy). If the bot can’t post, nothing will deliver.Session routing (default behavior)
session_key in config.reply_channel: slack
- reply_to: channel:CXXXX or reply_to: user:UXXXX
Correct reply_to formats
channel:C0ABC12345user:U0ABC12345Prompt safety
wake.add_source_preamble: false only if the source is fully trusted.Prompt writing
sessions_send, do not write “post to #channel” inside the prompt. Delivery target is already set by reply_channel/reply_to.Guide: /path/to/guide.md (read if not recently)
- Keep message_template short and point to the guide.Runtime
nohup/tmux). No pm2/systemd required.{baseDir}/config/ within the skill folder) to avoid path drift.Workflow (MVP)
1. Read watcher config (YAML) fromreferences/CONFIG.md.
2. Run the watcher (see examples).
3. On event:
- Normalize → filter → dedupe
- Deliver to target session (default: sessions_send)
- Record ack or retryScripts
scripts/watcher.py — multi-source watcher (redis_stream, webhook)scripts/webhook_bridge.py — append webhook payloads to JSONLscripts/requirements.txt — Python deps (redis, pyyaml)References
references/CONFIG.md for full configuration spec, examples, and routing rules.