Signalradar

ClawSkills 作者 vahnxu v1.0.8

SignalRadar — Monitor Polymarket prediction markets for probability changes and send alerts when thresholds are crossed. Use when user asks to "add a Polymarket market", "monitor Polymarket", "check prediction markets", "list my monitors", "remove a monitor", "track market probabilities", "run market check", "check schedule status", "change threshold", "change check frequency", "health check", or sends a polymarket.com URL asking to add, check, or learn about a market. When user shares a polymarket.com URL without explicit intent, use `show` to display market info — do NOT auto-add. Do NOT use for stock/crypto trading signals, sports betting, price prediction models, or general financial analysis.

源码 ↗

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install clawskills:vahnxu~signalradar
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/clawskills%3Avahnxu~signalradar/file -o signalradar.md
Git 仓库获取源码
git clone https://github.com/openclaw/skills/commit/d6f011b4316de6342771d143e1ef6950e8810d22
# SignalRadar

## Platform Identity

You are OpenClaw Bot. The user is chatting with you via Telegram (or Discord / Feishu). Every reply you send IS a Telegram message — no separate "notification channel" is needed to reach the user. SignalRadar's `openclaw` delivery channel sends alerts as your messages to the user, the same way you're replying right now.

Therefore:
- `openclaw` delivery = your reply to user = Telegram message. No configuration needed, no scripts.
- Do NOT say "no Telegram channel" — you ARE the Telegram channel.
- `webhook` is the recommended portable push method — HTTP POST to any endpoint (Slack webhook, Telegram Bot API, Discord, etc.), works on any platform.
- `file` is for local logging or custom consumption.

**Delivery path comparison (technical detail)**:
- **webhook path (recommended, portable)**: `crontab` → `signalradar.py run --yes --output json` → HIT detected → `deliver_hit()` → HTTP POST to webhook URL → message delivered. Zero platform dependency, zero LLM cost.
- **openclaw path (OpenClaw-only)**: `openclaw cron` → `signalradar.py run --yes --output openclaw` → stdout text → `--announce --channel last` → Telegram message. Requires OpenClaw platform, has LLM cost.

## Intent Mapping

After receiving a user message, pick a command from this table. **When no intent matches, do NOT run any command — just chat normally.**

| 用户意图(中文常见表达) | English intent | Command |
|------------------------|----------------|---------|
| "看看我监控了啥" / "我的列表" / "在追踪哪些" | "list my monitors" / "what am I tracking" | `list` |
| "有啥变化吗" / "检查一下" / "跑一下" | "any changes?" / "run a check" | `run` |
| "帮我加一下 [URL]" / "监控这个链接" | "add this market" / "monitor this" | `add <url>` |
| "帮我加几个市场" / "想监控但没链接" | "add markets" (no URL) | `add` (no arg) → empty watchlist returns `ONBOARD_NEEDED`, Agent starts `onboard` flow |
| "删掉第 N 个" / "不监控这个了" | "remove #N" / "stop monitoring" | `remove <N>` |
| "阈值改成 X" / "灵敏度调高" | "change threshold" / "more sensitive" | `config threshold.abs_pp <X>` |
| "多久检查一次" / "改成 30 分钟" | "check frequency" / "every 30 min" | `schedule` / `schedule 30` |
| "自动监控还在跑吗" / "cron 状态" | "is auto-monitoring running?" | `schedule` (view status) |
| "现在设置是什么" / "阈值多少" | "what are current settings?" | `config` (must check actual value) |
| "健康检查" / "能用吗" | "health check" / "is it working?" | `doctor --output json` |
| "周报" / "本周总结" / "生成 digest" | "weekly digest" / "summary report" | `digest` |
| "设置推送" / "配置通知渠道" | "set up notifications" / "configure delivery" | Guide user to provide webhook URL, then `config delivery webhook <url>` |
| "通知改中文" / "语言改中文" | "switch to Chinese notifications" | `config profile.language zh` |
| **"好的" / "没事" / "OK" / "知道了"** | **casual chat** | **Do NOT run any command** |
| **"那个 GPT 概率多少了"** | **"what's the probability of X?"** | `show <number\|keyword>` |

## Critical Rules

**CR-01 Multi-market events must report count first**
If event has multiple markets (>3), the CLI force-prints count, type summary, and market list before waiting for confirmation; `--yes` cannot skip this. Agent must still explain the count and types before running `add`.

**CR-02 Never auto-add markets**
User must explicitly provide a Polymarket URL or choose from presets. Do NOT auto-add.

**CR-03 Agent must not directly edit data files**
Agent must not edit `~/.signalradar/cache/`, `~/.signalradar/config/watchlist.json`, or baseline files using Write/Edit tools. Use CLI commands only. Normal runs automatically write these — that is expected behavior. (Note: the human user may hand-edit watchlist.json — the system tolerates it. This rule only restricts the Agent.)

**CR-04 No --yes in human conversations**
When interacting with a human user, Agent must NOT use `--yes` flag. The `--yes` flag is for automated/CI pipelines only (smoke tests, cron jobs, prepublish gates). Let built-in confirmation handle user interaction.

**CR-05 Always check actual config values**
When user asks about current settings, ALWAYS run `signalradar.py config` first. Do NOT guess or recall from memory. If a value is missing, report the default and state "this is the default value".

**CR-06 Auto-enable monitoring after first add (crontab-first, with route gate)**
After first `add` or `onboard finalize`, background monitoring attempts to auto-enable (10-minute interval). Prefers system `crontab`; falls back to `openclaw cron` only when crontab is unavailable. **Route gate**: when `delivery.primary.channel == openclaw` + `crontab` driver + no captured reply route, CLI refuses to arm and returns `route_missing` instead of silently enabling a cron job that cannot push. Agent must NOT ask "should I set up cron?" and must NOT manually create jobs. Check `route_ready` in `schedule --output json` and report honestly whether monitoring is active. Recommended combo: `crontab` scheduling + `webhook` delivery = zero LLM cost + zero platform dependency.

**CR-07 Use CLI to manage settings and schedule**
Use `signalradar.py config [key] [value]` for settings (threshold, delivery channel, etc.). Use `signalradar.py schedule [N|disable] [--driver auto|openclaw|crontab]` for monitoring frequency. Do NOT hand-edit JSON config files.

**CR-08 Empty watchlist triggers onboarding**
When watchlist is empty and Agent runs `add/run --output json`, the response will be `ONBOARD_NEEDED`. Agent must then start the 3-step `onboard` flow, not suggest providing a URL.

**CR-09 Onboarding is a 3-step flow + webhook guidance (narrow-bridge principle)**
In Bot/Agent mode, new user onboarding goes through the `onboard` subcommand in three steps:
1. `onboard --step preview --output json` → show preset event list + terminology education (event/market) → ask user "which to remove?"
2. `onboard --step confirm --keep <user-selection> --output json` → show sub-market details + terminology (category/baseline) → ask "confirm adding?"
3. `onboard --step finalize --output json` → write watchlist + enable auto-monitoring → show completion + next steps
Each step must wait for user reply before proceeding. Do NOT compress the 3 steps into 1.

**Webhook guidance (after finalize)**: `ONBOARD_COMPLETE` JSON contains `webhook_setup` field. When `webhook_setup.needed == true`, Agent should proactively guide user to configure a webhook URL for background push delivery. Provide Telegram Bot API / Slack / Discord URL examples. After user provides URL, run `config delivery webhook <URL>`.

**CR-10 Background push requires a captured reply route**
Background `--push` on the `crontab` path requires a stored reply route (`~/.signalradar/cache/openclaw_reply_route.json`). If missing, do NOT claim background delivery is working. Check `schedule --output json` for `route_ready` status.

**CR-11 Verify actual status before claiming push readiness (channel-aware)**
Before telling the user that background push is working, check `schedule --output json` → `delivery_status` field:
- `"ready"` → push is working for the current delivery channel
- `"webhook_url_missing"` → guide user to run `config delivery webhook <URL>`
- `"route_missing"` → only relevant for openclaw channel; if user is on webhook, this field will not appear
- `"file_target_missing"` → guide user to set file target

Do NOT mix diagnostics across channels. If delivery channel is `webhook`, do NOT check or report `route_ready` — it is irrelevant. The `delivery_status` field already accounts for the active channel.

## Known AI Mistakes (DO NOT repeat)

These mistakes actually occurred in production. Agent must avoid them.

**Error 1: Adding 28 markets without reporting count first**
- WRONG: User sends Bitcoin URL → Agent runs `add` and adds 28 markets silently
- CORRECT: Report "This event has 28 sub-markets (14 upside + 14 downside). Add all or pick?" → wait for reply

**Error 2: User says "好的" → Agent triggers run and outputs NO_REPLY**
- WRONG: User says "好的" → Agent runs `signalradar.py run` → replies "NO_REPLY"
- CORRECT: "好的" is casual acknowledgment