trend-alert

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

trend-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
trend-monitor
or
trend-report
.
用户表达以下任一需求时触发:
  • 异动告警 / 突发热点推送 / 突破告警(breakout alert)
  • 监控 XX 话题 / 订阅热点 / 盯盘 / 关注列表
  • 推送到飞书 / 钉钉 / Telegram / Slack / Bark / 邮件 / ntfy / 企业微信 / webhook
  • “ping me when X spikes(X 出现峰值时通知我)” / “alert me if X breaks out(如果 X 突破就提醒我)” / “通知我 X 暴涨”
对于常规的“显示趋势”或回顾请求,不要激活——这些请求应使用
trend-monitor
或
trend-report
。

Workflow

工作流

  1. 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.
  2. 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.
  3. Filter to real spikes. Keep only topics whose response indicates a genuine spike (e.g.
    is_spike=true
    ,
    viral_score
    above threshold, or explicit
    spike_detected
    ). Discard noise. If nothing spikes, tell the user "无异动" and stop — do NOT push an empty alert.
  4. Discover configured channels.
    mcp__trendradar__get_notification_channels()
    Use the returned
    channels[]
    to know which
    id
    s have
    configured: true
    . If the user named a channel that is not configured, surface the missing env var keys (see Edge cases) and skip that channel.
  5. 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.unsupported
    /
    guide.prompt
    fields to format the message body. Then:
    mcp__trendradar__send_notification(
      channel="<id>",
      title="【异动】<topic>",
      content="<formatted body>"
    )
  6. Enrich with cause. For the body's "可能原因" line, call
    mcp__trendradar__find_related_news(topic=...)
    once per spike and use the top-1 headline. Skip if no related news returned — do not fabricate.
  1. 解析关注列表。 从用户消息中获取话题。如果用户引用了已存储的列表(“我的关注列表”),请在共享记忆中查找;否则只询问一次,以获取明确的话题。规范化为去重后的字符串列表。
  2. 按话题检测异常。 对关注列表中的每个话题调用:
    mcp__trendradar__analyze_topic_trend(
      topic="<topic>",
      analysis_type="viral",
      spike_threshold=3.0,
      time_window=24
    )
    尽可能并行执行这些调用。
  3. 筛选真实峰值。 仅保留响应表明出现真实峰值的话题(例如
    is_spike=true
    、
    viral_score
    高于阈值或明确返回
    spike_detected
    )。丢弃噪声。如果没有峰值,则告知用户“无异动”并停止——不要推送空告警。
  4. 发现已配置的渠道。
    mcp__trendradar__get_notification_channels()
    使用返回的
    channels[]
    了解哪些
    id
    的
    configured: true
    。如果用户指定的渠道未配置,请显示缺失的环境变量键(参见边界情况),并跳过该渠道。
  5. 按渠道获取格式规则、格式化并发送。 对于每个目标渠道
    <id>
    :
    mcp__trendradar__get_channel_format_guide(channel="<id>")
    使用
    guide.supported
    /
    guide.unsupported
    /
    guide.prompt
    字段来格式化消息正文。然后:
    mcp__trendradar__send_notification(
      channel="<id>",
      title="【异动】<topic>",
      content="<formatted body>"
    )
  6. 补充原因。 对于正文中的“可能原因”一行,每个峰值调用一次
    mcp__trendradar__find_related_news(topic=...)
    ,并使用排名第一的标题。如果没有返回相关新闻,则跳过——不要编造。

Per-channel format cheatsheet

各渠道格式速查表

ChannelidBoldHeadingsColorLinkQuote
>
Divider
---
Notes
飞书
feishu
**b**
no
<font color='red|orange|grey|green|blue'>...</font>
[t](u)
noyes~29KB; cards
钉钉
dingtalk
**b**
### / ####
only
no
[t](u)
yesyes~20KB; lists ok
企业微信
wework
**b**
nono
[t](u)
first line onlyno4KB; no lists/strike
Telegram
telegram
**b**
→
<b>
no (
#
stripped)
no (
<font>
stripped)
[t](u)
→
<a>
yes→
<blockquote>
stripped4096 chars; HTML
Slack
slack
**b**
→
*b*
no (
#
stripped)
no
[t](u)
→
<u|t>
yesunstable4KB; mrkdwn
Bark
bark
**b**
nono
[t](u)
nono3.6KB; iOS push, very short
ntfy
ntfy
**b**
/
*i*
client-dependentno
[t](u)
yesclient-dependent3.8KB; lists ok
Email
email
**b**
/
*i*
/
~~s~~
# / ## / ###
no
[t](u)
—yesno hard limit; full HTML
Generic Webhook
generic_webhook
standard mddepends on receiverdependsstandard mddependsdepends~4KB; honors custom template
Authoritative source: always re-read
get_channel_format_guide(channel=...)
before formatting — this table is a quick reference, not a replacement.
渠道id粗体标题颜色链接引用
>
分隔线
---
备注
飞书
feishu
**b**
否
<font color='red|orange|grey|green|blue'>...</font>
[t](u)
否是~29KB;支持卡片
钉钉
dingtalk
**b**
仅限
### / ####
否
[t](u)
是是~20KB;支持列表
企业微信
wework
**b**
否否
[t](u)
仅第一行否4KB;不支持列表/删除线
Telegram
telegram
**b**
→
<b>
否(移除
#
)
否(移除
<font>
)
[t](u)
→
<a>
是→
<blockquote>
移除4096 字符;HTML
Slack
slack
**b**
→
*b*
否(移除
#
)
否
[t](u)
→
<u|t>
是不稳定4KB;mrkdwn
Bark
bark
**b**
否否
[t](u)
否否3.6KB;iOS 推送,内容应非常简短
ntfy
ntfy
**b**
/
*i*
取决于客户端否
[t](u)
是取决于客户端3.8KB;支持列表
Email
email
**b**
/
*i*
/
~~s~~
# / ## / ###
否
[t](u)
—是无硬性限制;完整 HTML
通用 Webhook
generic_webhook
标准 Markdown取决于接收端取决于接收端标准 Markdown取决于接收端取决于接收端~4KB;支持自定义模板
权威来源:格式化前始终重新读取
get_channel_format_guide(channel=...)
——此表只是快速参考,不能替代该指南。

Message templates

消息模板

Common shape for every channel:
  • Title:
    【异动】<topic>
  • Body lines:
    • 当前位次 / 热度值
    • 24h 热度变化(百分比)
    • Spike 倍数(vs baseline)
    • 可能原因(来自
      find_related_news
      的 top-1 头条 + 链接)
  • 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
### 【异动】<topic>
+
> 引用
+
---
. For 企业微信 keep it terse with bold-only, no divider. For Slack use
*bold*
and
<url|text>
(the MCP converts from
**
/
[t](u)
automatically). For Email you may use full
# / ##
heading hierarchy. For Webhook default to standard markdown unless the receiver has a custom template.
**GPT-5 热度暴涨 4.2×**

当前 #3(↑12 位),+312% / 24h
[查看新闻](https://example.com/news/123)
对于钉钉,使用
### 【异动】<topic>
+
> 引用
+
---
。对于企业微信,保持内容简洁,只使用粗体,不使用分隔线。对于 Slack,使用
*bold*
和
<url|text>
(MCP 会自动从
**
/
[t](u)
转换)。对于 Email,可以使用完整的
# / ##
标题层级。对于 Webhook,默认使用标准 Markdown,除非接收端有自定义模板。

Rate limiting (safe defaults)

频率限制(安全默认值)

Maintain an in-session map of
(topic, channel) → last_sent_ts
:
  • De-dupe: do not push the same
    (topic, channel)
    more than once per 60 minutes unless the user explicitly overrides ("force", "立刻推送").
  • Aggregation: if multiple spikes for the same channel fire within a 10-minute window, combine them into a single multi-topic message with
    【异动 ×N】<topic1>, <topic2>, ...
    as the title and one section per topic in the body.
  • 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
    get_notification_channels
    shows
    configured: false
    for a target channel, tell the user which env var keys to set (consult the
    source
    field and the channel's docs — typical keys:
    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
    ). Skip the unconfigured channel and continue with the rest.
  • send_notification
    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.
  • 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
    <topic>
    before interpolating into the title.
  • 渠道未配置。 当
    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
    )。跳过未配置的渠道,并继续处理其余渠道。
  • send_notification
    失败。
    延迟 2 秒后重试 一次。如果第二次尝试也失败,向用户报告失败(渠道 + 错误消息),并继续处理其余渠道——不要中止整个批次。
  • 关注列表为空。 向用户询问话题;不要自行编造。
  • 无峰值。 报告“无异动”以及已检查的关注列表。不要推送。
  • 长度溢出。 将正文截断至渠道上限减去 200 字节;追加
    …(已截断)
    ,并在可用时附上完整话题页面的链接。
  • 标题字符: 在将
    <topic>
    插入标题前,删除控制字符和换行符。

Don'ts

禁止事项

  • Don't push without a confirmed spike from
    analyze_topic_trend
    . Heuristic guesses are not allowed.
  • 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
    find_related_news
    results across different spikes.
  • 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

参见

  • ../docs/mcp-tools.md
    — full MCP tool reference (analyze_topic_trend, send_notification, channel guides).
  • ../trend-monitor/SKILL.md
    — for routine watchlist scans without push.
  • ../trend-deep-dive/SKILL.md
    — when an alert needs a follow-up causal investigation.
  • ../docs/mcp-tools.md
    — 完整 MCP 工具参考(analyze_topic_trend、send_notification、渠道指南)。
  • ../trend-monitor/SKILL.md
    — 用于仅扫描关注列表、不进行推送的常规监控。
  • ../trend-deep-dive/SKILL.md
    — 当告警需要后续因果调查时使用。