mcpField
T
topic-monitor

topic-monitor

github.com/sundial-org生产力670597 次安装34 周前更新
代码仓库

关于 topic-monitor

Topic Monitor 是用于持续追踪指定主题并筛选通知的监控技能,适合关注新闻、产品动态或研究进展的用户。它按计划搜索内容,以 AI 评估重要性,并提供即时提醒、摘要和周报。

主要功能

  1. 01自定义主题、查询词和频率
  2. 02定时搜索与重要性评分
  3. 03按优先级发送提醒或汇总
  4. 04生成带上下文的结果摘要
  5. 05结合对话记录个性化结果

适用场景

  1. 01追踪产品发布或竞争对手动态
  2. 02监控安全漏洞和行业新闻
  3. 03汇总低优先级研究发现
  4. 04依据过往兴趣筛选主题提醒

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/sundial-org/awesome-openclaw-skills --skill topic-monitor

安装后在 Claude Code 中输入/topic-monitor确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

config.example.json
README.md
skill.json
scripts/
config.py
digest.py
importance_scorer.py
manage_topics.py
monitor.py
setup_cron.py
setup.py

详细介绍

主题监控

监控重要事项。发生时及时通知。

主题监控会持续监控你关注的主题,并仅在真正重要时智能提醒你,让你的助手从被动响应转变为主动行动。

核心功能

  1. 主题配置 - 使用自定义参数定义主题
  2. 定时监控 - 按可配置的间隔自动搜索
  3. AI 重要性评分 - 智能筛选:立即提醒、摘要汇总或忽略
  4. 情境摘要 - 不只是链接,还提供有背景信息的实用摘要
  5. 每周摘要 - 将低优先级的发现汇总为易读的报告
  6. 记忆集成 - 参考你过去的对话和兴趣

首次运行

首次使用主题监控时,请运行交互式设置向导:

python3 scripts/setup.py

向导将引导你完成以下设置:

  1. 主题 - 你想监控哪些主题?
  2. 搜索查询 - 如何搜索每个主题?
  3. 关键词 - 哪些词表示内容相关?
  4. 频率 - 多久检查一次(每小时/每天/每周)?
  5. 重要性阈值 - 何时发送提醒(低/中/高)?
  6. 每周摘要 - 将非紧急发现汇总成摘要

向导会根据你的偏好创建 config.json。你可以随时编辑它,也可以使用 manage_topics.py 添加或移除主题。

会话示例:

🔍 Topic Monitor - Setup Wizard

What topics do you want to monitor?
  > AI Model Releases
  > Security Vulnerabilities
  > 

--- Topic 1/2: AI Model Releases ---
  Search query for 'AI Model Releases' [AI Model Releases news updates]: new AI model release announcement
  Keywords to watch for in 'AI Model Releases'?
  > GPT, Claude, Llama, release

--- Topic 2/2: Security Vulnerabilities ---
  Search query for 'Security Vulnerabilities' [Security Vulnerabilities news updates]: CVE critical vulnerability patch
  Keywords to watch for in 'Security Vulnerabilities'?
  > CVE, vulnerability, critical, patch

How often should I check for updates?
  1. hourly
  2. daily *
  3. weekly

✅ Setup Complete!

快速开始

已经知道怎么操作?下面是手动设置的方法:

# Initialize config from template
cp config.example.json config.json

# Add a topic
python3 scripts/manage_topics.py add "Product Updates" \
  --keywords "release,update,patch" \
  --frequency daily \
  --importance medium

# Test monitoring (dry run)
python3 scripts/monitor.py --dry-run

# Set up cron for automatic monitoring
python3 scripts/setup_cron.py

主题配置

每个主题包含:

  • name - 显示名称(例如,“AI 模型发布”)
  • query - 搜索查询(例如,“新 AI 模型发布公告”)
  • keywords - 相关性筛选词(["GPT", "Claude", "Llama", "release"])
  • frequency - hourly、daily、weekly
  • importance_threshold - high(立即提醒)、medium(重要时提醒)、low(仅加入摘要)
  • channels - 发送提醒的渠道(["telegram", "discord"])
  • context - 你关注此主题的原因(用于 AI 情境摘要)
config.json 示例
{
  "topics": [
    {
      "id": "ai-models",
      "name": "AI Model Releases",
      "query": "new AI model release GPT Claude Llama",
      "keywords": ["GPT", "Claude", "Llama", "release", "announcement"],
      "frequency": "daily",
      "importance_threshold": "high",
      "channels": ["telegram"],
      "context": "Following AI developments for work",
      "alert_on": ["model_release", "major_update"]
    },
    {
      "id": "tech-news",
      "name": "Tech Industry News",
      "query": "technology startup funding acquisition",
      "keywords": ["startup", "funding", "Series A", "acquisition"],
      "frequency": "daily",
      "importance_threshold": "medium",
      "channels": ["telegram"],
      "context": "Staying informed on tech trends",
      "alert_on": ["major_funding", "acquisition"]
    },
    {
      "id": "security-alerts",
      "name": "Security Vulnerabilities",
      "query": "CVE critical vulnerability security patch",
      "keywords": ["CVE", "vulnerability", "security", "patch", "critical"],
      "frequency": "hourly",
      "importance_threshold": "high",
      "channels": ["telegram", "email"],
      "context": "DevOps security monitoring",
      "alert_on": ["critical_cve", "zero_day"]
    }
  ],
  "settings": {
    "digest_day": "sunday",
    "digest_time": "18:00",
    "max_alerts_per_day": 5,
    "deduplication_window_hours": 72,
    "learning_enabled": true
  }
}

脚本

manage_topics.py

管理研究主题:

# Add topic
python3 scripts/manage_topics.py add "Topic Name" \
  --query "search query" \
  --keywords "word1,word2" \
  --frequency daily \
  --importance medium \
  --channels telegram

# List topics
python3 scripts/manage_topics.py list

# Edit topic
python3 scripts/manage_topics.py edit eth-price --frequency hourly

# Remove topic
python3 scripts/manage_topics.py remove eth-price

# Test topic (preview results without saving)
python3 scripts/manage_topics.py test eth-price
monitor.py

主监控脚本(通过 cron 运行):

# Normal run (alerts + saves state)
python3 scripts/monitor.py

# Dry run (no alerts, shows what would happen)
python3 scripts/monitor.py --dry-run

# Force check specific topic
python3 scripts/monitor.py --topic eth-price

# Verbose logging
python3 scripts/monitor.py --verbose

工作原理:

  1. 读取到期的主题(根据频率判断)
  2. 使用 web-search-plus 或内置的 web_search 进行搜索
  3. 使用 AI 重要性评分器为每条结果评分
  4. 高重要性 → 立即提醒
  5. 中重要性 → 保存以供摘要汇总
  6. 低重要性 → 忽略
  7. 更新状态,避免重复提醒
digest.py

生成每周摘要:

# Generate digest for current week
python3 scripts/digest.py

# Generate and send
python3 scripts/digest.py --send

# Preview without sending
python3 scripts/digest.py --preview

输出格式:

# Weekly Research Digest - [Date Range]

## 🔥 Highlights

- **AI Models**: Claude 4.5 released with improved reasoning
- **Security**: Critical CVE patched in popular framework

## 📊 By Topic

### AI Model Releases
- [3 findings this week]

### Security Vulnerabilities
- [1 finding this week]

## 💡 Recommendations

Based on your interests, you might want to monitor:
- "Kubernetes security" (mentioned 3x this week)
setup_cron.py

配置自动监控:

# Interactive setup
python3 scripts/setup_cron.py

# Auto-setup with defaults
python3 scripts/setup_cron.py --auto

# Remove cron jobs
python3 scripts/setup_cron.py --remove

创建 cron 条目:

# Topic Monitor - Hourly topics
0 * * * * cd /path/to/skills/topic-monitor && python3 scripts/monitor.py --frequency hourly

# Topic Monitor - Daily topics  
0 9 * * * cd /path/to/skills/topic-monitor && python3 scripts/monitor.py --frequency daily

# Topic Monitor - Weekly digest
0 18 * * 0 cd /path/to/skills/topic-monitor && python3 scripts/digest.py --send

AI 重要性评分

评分器使用多个信号来确定提醒优先级:

评分信号

高优先级(立即提醒):

  • 重大突发新闻(通过时效性和关键词密度检测)
  • 价格变动 >10%(针对财经主题)
  • 符合你确切关键词的产品发布
  • 你使用的工具中存在安全漏洞
  • 针对你提出的具体问题的直接回答

中优先级(适合加入摘要):

  • 相关但不紧急的新闻
  • 受监控产品的小幅更新
  • 你关注的主题中的有趣进展
  • 教程/指南发布
  • 互动度高的社区讨论

低优先级(忽略):

  • 重复新闻(已提醒过)
  • 仅有间接关联的内容
  • 低质量来源
  • 过时信息
  • 垃圾信息/宣传内容
学习模式

启用后(learning_enabled: true),系统将:

  1. 跟踪你与哪些提醒进行互动
  2. 根据你的行为调整评分权重
  3. 建议优化主题
  4. 自动调整重要性阈值

学习数据存储在 .learning_data.json 中(安全保护隐私,绝不共享)。

记忆集成

Topic Monitor 会连接到你的对话历史:

提醒示例:

🔔 Dirac Live Update

3.8 版已发布,包含你上周询问的房间校正改进。

上下文: 你提到过工作室的低音响应不理想。此更新包含新的低频优化功能。

[链接] | [完整详情]

工作原理:

  1. 读取 references/memory_hints.md(创建此文件)
  2. 扫描近期对话日志(如果可用)
  3. 将发现与过往上下文进行匹配
  4. 生成个性化摘要
memory_hints.md(可选)

帮助 AI 串联信息:

# Memory Hints for Topic Monitor

## AI Models
- Using Claude for coding assistance
- Interested in reasoning improvements
- Comparing models for different use cases

## Security
- Running production Kubernetes clusters
- Need to patch critical CVEs quickly
- Interested in zero-day disclosures

## Tech News
- Following startup ecosystem
- Interested in developer tools space
- Tracking potential acquisition targets

提醒渠道

Telegram

需要 OpenClaw 消息工具:

{
  "channels": ["telegram"],
  "telegram_config": {
    "chat_id": "@your_username",
    "silent": false,
    "effects": {
      "high_importance": "🔥",
      "medium_importance": "📌"
    }
  }
}
Discord

基于 Webhook:

{
  "channels": ["discord"],
  "discord_config": {
    "webhook_url": "https://discord.com/api/webhooks/...",
    "username": "Research Bot",
    "avatar_url": "https://..."
  }
}
电子邮件

SMTP 或 API:

{
  "channels": ["email"],
  "email_config": {
    "to": "[email protected]",
    "from": "[email protected]",
    "smtp_server": "smtp.gmail.com",
    "smtp_port": 587
  }
}

高级功能

提醒条件

微调提醒触发条件:

{
  "alert_on": [
    "price_change_10pct",
    "keyword_exact_match",
    "source_tier_1",
    "high_engagement"
  ],
  "ignore_sources": [
    "spam-site.com",
    "clickbait-news.io"
  ],
  "boost_sources": [
    "github.com",
    "arxiv.org",
    "official-site.com"
  ]
}
正则表达式模式

匹配特定模式:

{
  "patterns": [
    "version \\d+\\.\\d+\\.\\d+",
    "\\$\\d{1,3}(,\\d{3})*",
    "CVE-\\d{4}-\\d+"
  ]
}
速率限制

避免提醒疲劳:

{
  "settings": {
    "max_alerts_per_day": 5,
    "max_alerts_per_topic_per_day": 2,
    "quiet_hours": {
      "start": "22:00",
      "end": "08:00"
    }
  }
}

状态管理

.research_state.json

跟踪:

  • 每个主题的上次检查时间
  • 已提醒的 URL(去重)
  • 重要性评分历史
  • 学习数据(如果已启用)

示例:

{
  "topics": {
    "eth-price": {
      "last_check": "2026-01-28T22:00:00Z",
      "last_alert": "2026-01-28T15:30:00Z",
      "alerted_urls": [
        "https://example.com/eth-news-1"
      ],
      "findings_count": 3,
      "alerts_today": 1
    }
  },
  "deduplication": {
    "url_hash_map": {
      "abc123": "2026-01-28T15:30:00Z"
    }
  }
}
.findings/ 目录

存储值得加入摘要的发现:

.findings/
├── 2026-01-22_eth-price.json
├── 2026-01-24_fm26-patches.json
└── 2026-01-27_ai-breakthroughs.json

最佳实践

  1. 从保守设置开始——初始时设置 importance_threshold: medium,再根据提醒质量进行调整
  2. 使用 context 字段——帮助 AI 生成更好的摘要
  3. 优化关键词——添加否定关键词来过滤噪声:"keywords": ["AI", "-clickbait", "-spam"]
  4. 启用学习——根据你的行为不断改进
  5. 每周查看摘要——不要忽略摘要,它能呈现规律
  6. 与 personal-analytics 结合使用——根据你的聊天模式获取主题推荐

与其他技能集成

web-search-plus

自动使用智能路由:

  • 产品/价格主题 → Serper
  • 研究主题 → Tavily
  • 公司/初创企业发现 → Exa
personal-analytics

根据对话模式推荐主题:

“你这个月问了 12 次 Rust。要我监控‘Rust 语言更新’吗?”

隐私与安全

  • 所有数据都存储在本地——除搜索 API 外,不使用外部服务
  • 状态文件已加入 gitignore——可在版本控制工作区中安全使用
  • 记忆提示为可选项——你可以控制共享哪些上下文
  • 学习数据保留在本地——绝不会发送到 API

故障排查

未发送任何提醒:

  • 检查 cron 是否正在运行:crontab -l
  • 验证渠道配置(Telegram 聊天 ID、Discord webhook)
  • 使用 --dry-run --verbose 运行以查看评分

提醒过多:

  • 提高 importance_threshold
  • 添加速率限制
  • 优化关键词(添加否定筛选词)
  • 启用学习模式

遗漏重要新闻:

  • 降低 importance_threshold
  • 提高检查频率
  • 扩大关键词范围
  • 检查 .research_state.json 是否存在去重问题

未生成摘要:

  • 确认 .findings/ 目录存在且包含内容
  • 检查摘要 cron 计划
  • 手动运行:python3 scripts/digest.py --preview

工作流示例

跟踪产品发布
python3 scripts/manage_topics.py add "iPhone 17 Release" \
  --query "iPhone 17 announcement release date" \
  --keywords "iPhone 17,Apple event,September" \
  --frequency daily \
  --importance high \
  --channels telegram \
  --context "Planning to upgrade from iPhone 13"
监控竞争对手
python3 scripts/manage_topics.py add "Competitor Analysis" \
  --query "CompetitorCo product launch funding" \
  --keywords "CompetitorCo,product,launch,Series,funding" \
  --frequency weekly \
  --importance medium \
  --channels discord,email
研究主题
python3 scripts/manage_topics.py add "Quantum Computing Papers" \
  --query "quantum computing arxiv" \
  --keywords "quantum,qubit,arxiv" \
  --frequency weekly \
  --importance low \
  --channels email

致谢

为 ClawHub 构建。使用 web-search-plus 技能实现智能搜索路由。

评论

支持 Markdown