trend-alert
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesetrend-alert
trend-alert
Anomaly detection on a watchlist of topics, with channel-correct push delivery via the trendradar MCP. Each spike is verified, formatted per channel, and rate-limited before being sent.
使用 trendradar MCP 对话题关注列表进行异常检测,并通过对应渠道投递。每次热度峰值都会先经验证、按渠道格式化,并经过频率限制后再发送。
When to activate
激活条件
Trigger when the user expresses any of:
- 异动告警 / 突发热点推送 / breakout alert
- 监控 XX 话题 / 订阅热点 / 盯盘 / 关注列表
- 推送到飞书 / 钉钉 / Telegram / Slack / Bark / 邮件 / ntfy / 企业微信 / webhook
- "ping me when X spikes" / "alert me if X breaks out" / "通知我 X 暴涨"
Do NOT activate for routine "show me trends" or recap requests — those belong to or .
trend-monitortrend-report用户表达以下任一需求时触发:
- 异动告警 / 突发热点推送 / 突破告警(breakout alert)
- 监控 XX 话题 / 订阅热点 / 盯盘 / 关注列表
- 推送到飞书 / 钉钉 / Telegram / Slack / Bark / 邮件 / ntfy / 企业微信 / webhook
- “ping me when X spikes(X 出现峰值时通知我)” / “alert me if X breaks out(如果 X 突破就提醒我)” / “通知我 X 暴涨”
对于常规的“显示趋势”或回顾请求,不要激活——这些请求应使用 或 。
trend-monitortrend-reportWorkflow
工作流
-
Resolve watchlist. Take topics from the user message. If they reference a stored list ("我的关注列表"), look in shared memory; otherwise ask once for the explicit topics. Normalize to a deduped list of strings.
-
Detect anomalies per topic. For each topic in the watchlist call:
mcp__trendradar__analyze_topic_trend( topic="<topic>", analysis_type="viral", spike_threshold=3.0, time_window=24 )Run these calls in parallel where possible. -
Filter to real spikes. Keep only topics whose response indicates a genuine spike (e.g.,
is_spike=trueabove threshold, or explicitviral_score). Discard noise. If nothing spikes, tell the user "无异动" and stop — do NOT push an empty alert.spike_detected -
Discover configured channels.
mcp__trendradar__get_notification_channels()Use the returnedto know whichchannels[]s haveid. If the user named a channel that is not configured, surface the missing env var keys (see Edge cases) and skip that channel.configured: true -
Per channel: fetch format rules, format, send. For each target channel:
<id>mcp__trendradar__get_channel_format_guide(channel="<id>")Use the/guide.supported/guide.unsupportedfields to format the message body. Then:guide.promptmcp__trendradar__send_notification( channel="<id>", title="【异动】<topic>", content="<formatted body>" ) -
Enrich with cause. For the body's "可能原因" line, callonce per spike and use the top-1 headline. Skip if no related news returned — do not fabricate.
mcp__trendradar__find_related_news(topic=...)
-
解析关注列表。 从用户消息中获取话题。如果用户引用了已存储的列表(“我的关注列表”),请在共享记忆中查找;否则只询问一次,以获取明确的话题。规范化为去重后的字符串列表。
-
按话题检测异常。 对关注列表中的每个话题调用:
mcp__trendradar__analyze_topic_trend( topic="<topic>", analysis_type="viral", spike_threshold=3.0, time_window=24 )尽可能并行执行这些调用。 -
筛选真实峰值。 仅保留响应表明出现真实峰值的话题(例如、
is_spike=true高于阈值或明确返回viral_score)。丢弃噪声。如果没有峰值,则告知用户“无异动”并停止——不要推送空告警。spike_detected -
发现已配置的渠道。
mcp__trendradar__get_notification_channels()使用返回的了解哪些channels[]的id。如果用户指定的渠道未配置,请显示缺失的环境变量键(参见边界情况),并跳过该渠道。configured: true -
按渠道获取格式规则、格式化并发送。 对于每个目标渠道:
<id>mcp__trendradar__get_channel_format_guide(channel="<id>")使用/guide.supported/guide.unsupported字段来格式化消息正文。然后:guide.promptmcp__trendradar__send_notification( channel="<id>", title="【异动】<topic>", content="<formatted body>" ) -
补充原因。 对于正文中的“可能原因”一行,每个峰值调用一次,并使用排名第一的标题。如果没有返回相关新闻,则跳过——不要编造。
mcp__trendradar__find_related_news(topic=...)
Per-channel format cheatsheet
各渠道格式速查表
| Channel | id | Bold | Headings | Color | Link | Quote | Divider | Notes |
|---|---|---|---|---|---|---|---|---|
| 飞书 | | | no | | | no | yes | ~29KB; cards |
| 钉钉 | | | | no | | yes | yes | ~20KB; lists ok |
| 企业微信 | | | no | no | | first line only | no | 4KB; no lists/strike |
| Telegram | | | no ( | no ( | | yes→ | stripped | 4096 chars; HTML |
| Slack | | | no ( | no | | yes | unstable | 4KB; mrkdwn |
| Bark | | | no | no | | no | no | 3.6KB; iOS push, very short |
| ntfy | | | client-dependent | no | | yes | client-dependent | 3.8KB; lists ok |
| | | no | | — | yes | no hard limit; full HTML | |
| Generic Webhook | | standard md | depends on receiver | depends | standard md | depends | depends | ~4KB; honors custom template |
Authoritative source: always re-read before formatting — this table is a quick reference, not a replacement.
get_channel_format_guide(channel=...)| 渠道 | id | 粗体 | 标题 | 颜色 | 链接 | 引用 | 分隔线 | 备注 |
|---|---|---|---|---|---|---|---|---|
| 飞书 | | | 否 | | | 否 | 是 | ~29KB;支持卡片 |
| 钉钉 | | | 仅限 | 否 | | 是 | 是 | ~20KB;支持列表 |
| 企业微信 | | | 否 | 否 | | 仅第一行 | 否 | 4KB;不支持列表/删除线 |
| Telegram | | | 否(移除 | 否(移除 | | 是→ | 移除 | 4096 字符;HTML |
| Slack | | | 否(移除 | 否 | | 是 | 不稳定 | 4KB;mrkdwn |
| Bark | | | 否 | 否 | | 否 | 否 | 3.6KB;iOS 推送,内容应非常简短 |
| ntfy | | | 取决于客户端 | 否 | | 是 | 取决于客户端 | 3.8KB;支持列表 |
| | | 否 | | — | 是 | 无硬性限制;完整 HTML | |
| 通用 Webhook | | 标准 Markdown | 取决于接收端 | 取决于接收端 | 标准 Markdown | 取决于接收端 | 取决于接收端 | ~4KB;支持自定义模板 |
权威来源:格式化前始终重新读取 ——此表只是快速参考,不能替代该指南。
get_channel_format_guide(channel=...)Message templates
消息模板
Common shape for every channel:
- Title:
【异动】<topic> - Body lines:
- 当前位次 / 热度值
- 24h 热度变化(百分比)
- Spike 倍数(vs baseline)
- 可能原因(来自 的 top-1 头条 + 链接)
find_related_news
- Footer: 时间戳(YYYY-MM-DD HH:mm 本地时区)+ 数据来源
trendradar
所有渠道的通用结构:
- 标题:
【异动】<topic> - 正文行:
- 当前位次 / 热度值
- 24h 热度变化(百分比)
- 峰值倍数(相对基线)
- 可能原因(来自 的排名第一的头条 + 链接)
find_related_news
- 页脚: 时间戳(YYYY-MM-DD HH:mm 本地时区)+ 数据来源
trendradar
飞书 example
飞书示例
**【异动】GPT-5**
<font color='red'>**热度暴涨 4.2×**</font>(基线 1.1k → 当前 4.6k)
当前位次:**#3**(↑ 12 位)
24h 变化:<font color='red'>+312%</font>
**可能原因**
[OpenAI 开放 GPT-5 公测,附带新工具调用 API](https://example.com/news/123)
---
<font color='grey'>2026-04-29 15:42 · 来源 trendradar</font>**【异动】GPT-5**
<font color='red'>**热度暴涨 4.2×**</font>(基线 1.1k → 当前 4.6k)
当前位次:**#3**(↑ 12 位)
24h 变化:<font color='red'>+312%</font>
**可能原因**
[OpenAI 开放 GPT-5 公测,附带新工具调用 API](https://example.com/news/123)
---
<font color='grey'>2026-04-29 15:42 · 来源 trendradar</font>Telegram example
Telegram 示例
**【异动】GPT-5**
**热度暴涨 4.2×** (基线 `1.1k` → 当前 `4.6k`)
当前位次:**#3** (↑ 12)
24h 变化:**+312%**
> 可能原因:[OpenAI 开放 GPT-5 公测](https://example.com/news/123)
*2026-04-29 15:42 · trendradar***【异动】GPT-5**
**热度暴涨 4.2×** (基线 `1.1k` → 当前 `4.6k`)
当前位次:**#3** (↑ 12)
24h 变化:**+312%**
> 可能原因:[OpenAI 开放 GPT-5 公测](https://example.com/news/123)
*2026-04-29 15:42 · trendradar*Bark example
Bark 示例
**GPT-5 热度暴涨 4.2×**
当前 #3(↑12 位),+312% / 24h
[查看新闻](https://example.com/news/123)For 钉钉 use + + . For 企业微信 keep it terse with bold-only, no divider. For Slack use and (the MCP converts from / automatically). For Email you may use full heading hierarchy. For Webhook default to standard markdown unless the receiver has a custom template.
### 【异动】<topic>> 引用---*bold*<url|text>**[t](u)# / ##**GPT-5 热度暴涨 4.2×**
当前 #3(↑12 位),+312% / 24h
[查看新闻](https://example.com/news/123)对于钉钉,使用 + + 。对于企业微信,保持内容简洁,只使用粗体,不使用分隔线。对于 Slack,使用 和 (MCP 会自动从 / 转换)。对于 Email,可以使用完整的 标题层级。对于 Webhook,默认使用标准 Markdown,除非接收端有自定义模板。
### 【异动】<topic>> 引用---*bold*<url|text>**[t](u)# / ##Rate limiting (safe defaults)
频率限制(安全默认值)
Maintain an in-session map of :
(topic, channel) → last_sent_ts- De-dupe: do not push the same more than once per 60 minutes unless the user explicitly overrides ("force", "立刻推送").
(topic, channel) - Aggregation: if multiple spikes for the same channel fire within a 10-minute window, combine them into a single multi-topic message with as the title and one section per topic in the body.
【异动 ×N】<topic1>, <topic2>, ... - Channel-specific caution: Bark and 企业微信 enforce strict server-side rate limits — never exceed 1 push per 30 seconds per channel; back off and aggregate if more spikes queue up.
- Persist the map in shared memory if the user wants alerts across sessions; otherwise reset per session.
在会话内维护 映射:
(topic, channel) → last_sent_ts- 去重: 除非用户明确覆盖设置(“force”、“立刻推送”),否则不要在 60 分钟内多次推送相同的 。
(topic, channel) - 聚合: 如果同一渠道在 10 分钟窗口内出现多个峰值触发,将其合并为一条多话题消息,标题为 ,正文为每个话题设置一个章节。
【异动 ×N】<topic1>, <topic2>, ... - 渠道特定注意事项: Bark 和企业微信有严格的服务端频率限制——每个渠道绝不能超过 30 秒一次推送;如果有更多峰值排队,应退避等待并聚合。
- 如果用户希望跨会话接收告警,则将映射持久化在共享内存中;否则每个会话重置。
Edge cases
边界情况
- Channel not configured. When shows
get_notification_channelsfor a target channel, tell the user which env var keys to set (consult theconfigured: falsefield and the channel's docs — typical keys:source,FEISHU_WEBHOOK_URL,DINGTALK_WEBHOOK_URL,WEWORK_WEBHOOK_URL+TELEGRAM_BOT_TOKEN,TELEGRAM_CHAT_ID,SLACK_WEBHOOK_URL,BARK_DEVICE_KEY,NTFY_TOPIC,EMAIL_SMTP_*). Skip the unconfigured channel and continue with the rest.GENERIC_WEBHOOK_URL - failure. Retry once after a 2s delay. If the second attempt also fails, report the failure (channel + error message) to the user and continue with remaining channels — do not abort the whole batch.
send_notification - Empty watchlist. Ask the user for topics; do not invent any.
- No spikes. Report "无异动" with the watchlist that was checked. Do not push.
- Length overflow. Truncate body to channel max minus 200 bytes; append and a link to the full topic page if available.
…(已截断) - Title chars: strip control chars and newlines from before interpolating into the title.
<topic>
- 渠道未配置。 当 显示目标渠道的
get_notification_channels时,告诉用户需要设置哪些环境变量键(查阅configured: false字段和渠道文档——常见键包括:source、FEISHU_WEBHOOK_URL、DINGTALK_WEBHOOK_URL、WEWORK_WEBHOOK_URL+TELEGRAM_BOT_TOKEN、TELEGRAM_CHAT_ID、SLACK_WEBHOOK_URL、BARK_DEVICE_KEY、NTFY_TOPIC、EMAIL_SMTP_*)。跳过未配置的渠道,并继续处理其余渠道。GENERIC_WEBHOOK_URL - 失败。 延迟 2 秒后重试 一次。如果第二次尝试也失败,向用户报告失败(渠道 + 错误消息),并继续处理其余渠道——不要中止整个批次。
send_notification - 关注列表为空。 向用户询问话题;不要自行编造。
- 无峰值。 报告“无异动”以及已检查的关注列表。不要推送。
- 长度溢出。 将正文截断至渠道上限减去 200 字节;追加 ,并在可用时附上完整话题页面的链接。
…(已截断) - 标题字符: 在将 插入标题前,删除控制字符和换行符。
<topic>
Don'ts
禁止事项
- Don't push without a confirmed spike from . Heuristic guesses are not allowed.
analyze_topic_trend - Don't include speculative predictions ("将上涨", "可能爆款") in alerts — alerts state observed facts only.
- Don't dump raw JSON or tool output into the message body.
- Don't push to channels the user did not ask for, even if configured.
- Don't reuse stale results across different spikes.
find_related_news - Don't bypass the 60-minute de-dupe window unless the user explicitly forces it.
- 不要在未经 确认峰值的情况下推送。不允许基于启发式猜测。
analyze_topic_trend - 告警中不要包含推测性预测(“将上涨”、“可能爆款”)——告警只陈述观察到的事实。
- 不要将原始 JSON 或工具输出直接转储到消息正文中。
- 即使渠道已配置,也不要推送到用户未请求的渠道。
- 不要在不同峰值之间复用过期的 结果。
find_related_news - 除非用户明确强制推送,否则不要绕过 60 分钟去重窗口。
See also
参见
- — full MCP tool reference (analyze_topic_trend, send_notification, channel guides).
../docs/mcp-tools.md - — for routine watchlist scans without push.
../trend-monitor/SKILL.md - — when an alert needs a follow-up causal investigation.
../trend-deep-dive/SKILL.md
- — 完整 MCP 工具参考(analyze_topic_trend、send_notification、渠道指南)。
../docs/mcp-tools.md - — 用于仅扫描关注列表、不进行推送的常规监控。
../trend-monitor/SKILL.md - — 当告警需要后续因果调查时使用。
../trend-deep-dive/SKILL.md