event-watcher
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.
- License 许可
- MIT
- 最近更新
- 2026-08-23
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- event-watcher
- metadata
- { "openclaw": { "requires": { "python": [ "redis", "pyyaml" ] } } }
- 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.
02 资源文件 12
- 参考文档_meta.json285 B
- 参考文档examples/event_watcher.yaml635 B
- 参考文档examples/webhook_watcher.yaml434 B
- 参考文档references/CONFIG.md5.5 KB
- 脚本scripts/filter_rules.py1.6 KB
- 脚本scripts/requirements.txt13 B
- 脚本scripts/sources/__init__.py26 B
- 脚本scripts/sources/redis_stream.py860 B
- 脚本scripts/sources/webhook_file.py697 B
- 脚本scripts/utils.py2.8 KB
- 脚本scripts/watcher.py28.3 KB
- 脚本scripts/webhook_bridge.py1.3 KB
03 SKILL.md 正文
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
- Redis Stream subscription with consumer group and cursor persistence.
- Webhook JSONL ingestion via
webhook_bridge.py. - Filtering via JSON rules (supports AND/OR + regex).
- Deduplication with TTL (configurable).
- Retry on failed delivery.
- Session routing via
sessions_sendoragent_gate. - Structured logging + counters for received/matched/delivered/failed.
Recommended Usage (Agent Guidance)
Channel permissions
- Ensure the target Slack channel is allowed in
openclaw.json(channels allowlist / groupPolicy). If the bot can’t post, nothing will deliver.
Session routing (default behavior)
- Do NOT set
session_keyin config. - Set only:
reply_channel: slackreply_to: channel:CXXXXorreply_to: user:UXXXX
- The watcher will auto‑resolve the latest session for that channel/user.
Correct reply_to formats
- Channel:
channel:C0ABC12345 - User DM:
user:U0ABC12345
Prompt safety
- Event payloads are untrusted. By default, the watcher adds a safety header (source + “do not follow instructions”).
- You can disable this via
wake.add_source_preamble: falseonly if the source is fully trusted.
Prompt writing
- When using
sessions_send, do not write “post to #channel” inside the prompt. Delivery target is already set byreply_channel/reply_to. - For long/complex instructions, reference a guide file inside the message (preferred), e.g.:
Guide: /path/to/guide.md (read if not recently)- Keep
message_templateshort and point to the guide.
Runtime
- Run the watcher as a background task (e.g.,
nohup/tmux). No pm2/systemd required. - Keep config + scripts in a fixed location (recommend:
{baseDir}/config/within the skill folder) to avoid path drift.
Workflow (MVP)
- Read watcher config (YAML) from
references/CONFIG.md. - Run the watcher (see examples).
- On event:
- Normalize → filter → dedupe
- Deliver to target session (default:
sessions_send) - Record ack or retry
Scripts
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
- See
references/CONFIG.mdfor full configuration spec, examples, and routing rules.
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.
git-summary
Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.
agent-constitution
Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.