Agentbay Monitor Skills logo

Agentbay Monitor Skills

Organization
agentbay-ai
agentbay-monitor-skills

舆情监控技能,最终产出舆情报告。当用户问「某事件/话题舆情如何」「舆论怎么样」「做舆情分析」「运行舆情分析」或按关键词/平台爬取并生成舆情报告时,使用本技能。约定:凡舆情相关意图即执行全流程(爬取→情感分析→生成报告)。爬取由本技能完成;情感分析由主 Agent 按提示词自主判断;报告由 generate_report 生成。

Overview

Publisheragentbay-ai
Repositoryagentbay-skills
Skill nameagentbay-monitor-skills
Stars
50
Forks
5
Bundled files
15
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 15 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by agentbay-ai on GitHub. Read the source before you install it.

Installation

Install the Agentbay Monitor Skills AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/agentbay-ai/agentbay-skills/tree/main/agentbay-monitor-skills
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/agentbay-ai/agentbay-skills.git /tmp/agentbay-skills
mkdir -p .claude/skills
cp -r /tmp/agentbay-skills/agentbay-monitor-skills .claude/skills/agentbay-monitor-skills
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Agentbay Monitor Skills in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Agentbay Monitor Skills on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Agentbay Monitor Skills is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

AgentBay 舆情监控 Skill

⚠️ 舆情分析 = 全流程(必读)

用户说「运行舆情分析」「做舆情分析」「舆情分析 主题是 XXX」时,必须执行完整三步,不能只跑爬取就结束。

步骤动作说明
1. 爬取crawl.py 或 crawl_for_sentiment(...)得到 raw_output_path(爬取结果 JSON)
2. 情感分析读 scripts/sentiment/sentiment_instruction.md → 对爬取 JSON 逐条判定 → 写情感结果小 JSON → 运行 write_processed.py得到 processed JSON(如 output/processed.json)
3. 生成报告report.py --input <processed 路径> 或 generate_report(...)得到 Markdown/JSON(及可选 PDF)

禁止行为:只运行 crawl.py 后就说「爬取完成,情感分析由主 Agent 完成」并结束。这是错误用法——主 Agent 就是你自己,你必须继续完成步骤 2 和 3,直到产出最终报告文件。

何时使用

用户出现以下任一意图时,必须使用本技能并执行全流程(爬取→情感分析→生成报告):

  • 问「某事件/话题舆情如何」「XX 舆论怎么样」「想了解 XX 的舆情」
  • 「运行舆情分析」「做舆情分析」「舆情分析 主题是 XXX」
  • 舆情监控、情感分析、舆情报告、按关键词/平台爬取并生成报告(中英文场景均可)

意图为舆情相关即默认使用本技能,不可仅用联网搜索代替。

重要约定:凡提到「舆情分析」(或「运行舆情分析」「做舆情分析」等等价表述),即视为执行全流程——爬取 → 情感分析 → 生成报告。必须按该完整流程执行,不可只做爬取;最终产出须包含 Markdown/JSON(及可选 PDF)报告。

前置条件

工作目录为技能目录(本 SKILL 所在目录);已安装依赖;已配置 AGENTBAY_API_KEY。

依赖

bash
pip install wuying-agentbay-sdk pandas numpy pyyaml markdown

可选(PDF 报告):brew install cairo pango gdk-pixbuf 后 pip install weasyprint。不装则仅无 PDF,.md/.json 正常。

API Key

仅需配置 AGENTBAY_API_KEY。环境变量:export AGENTBAY_API_KEY=你的key(Windows PowerShell:$env:AGENTBAY_API_KEY="你的key")。或直接写文件:mkdir -p ~/.config/agentbay && echo -n '你的key' > ~/.config/agentbay/api_key。获取:https://agentbay.console.aliyun.com/service-management 。未配置时运行脚本会报错。其余参数由主 Agent 传参/命令行传入。

整体流程

舆情分析 = 全流程:爬取 → 情感分析 → 生成报告(见上文「⚠️ 舆情分析 = 全流程」)。用户要求「舆情分析」时,三步都必须执行,不能只做第 1 步。

  1. 爬取:crawl.py 或 crawl_for_sentiment(...) → 得到 raw_output_path(爬取结果 JSON)。
  2. 情感分析:主 Agent 读提示词 scripts/sentiment/sentiment_instruction.md,对爬取 JSON 逐条判定情感,产出情感结果小 JSON;再运行 write_processed.py 合并得到 processed JSON(如 output/processed.json)。提示词可定制。
  3. 生成报告:report.py --input <processed 路径> 或 generate_report(processed_results, ...) → Markdown/JSON(及可选 PDF)。

运行方式

步骤 0:登录(仅非搜索引擎) xhs/weibo/douyin/zhihu 须先登录;百度、Bing 不需要。python scripts/login.py --platform xhs [--context-name sentiment-analysis] → 浏览器中登录后终端按 Enter,状态持久化。非搜索引擎爬取时 --context-name 须与登录一致。

步骤 1:爬取

bash
python scripts/crawl.py --keywords "关键词1,关键词2" [--platform baidu] [--max-results N] [--output-dir output]

参数:-k 必需;-p 默认 baidu(可选 xhs/weibo/douyin/zhihu/bing);--max-results、-o、--report-title、--context-name、--crawl-timeout。百度/Bing 仅抓资讯列表页(不点进链接),百度用资讯 URL(tn=news)。

爬取超时(必读):执行环境(如 run_terminal_cmd)的超时须 ≥ 10 分钟(600 秒或 600000 毫秒),否则会中断。约 1 条/分钟,10 条约 10 分钟;建议超时略大于估算(如 15 分钟)。脚本内 --crawl-timeout 不传时会自动按条数计算,一般无需手传。

步骤 2:情感分析 主 Agent 读 scripts/sentiment/sentiment_instruction.md,对爬取 JSON 逐条判定情感并按规定格式写 processed JSON(无需在技能中配置 LLM)。

步骤 3:生成报告

bash
python scripts/report.py --input <processed JSON 路径> [--output-dir output] [--title "报告标题"]

输出

爬取 → raw_output_path、crawl_results。情感分析 → processed JSON(含 sentiment_statistics、每条 sentiment,格式见提示词)。报告 → markdown_path、json_path、可选 pdf_path。

Agent 调用要点

舆情分析必跑全流程:用户说「舆情分析」「运行舆情分析」或类似意图时,必须完成「爬取 → 情感分析 → 合并(write_processed.py)→ 生成报告」,产出最终报告文件。不可只运行爬取后就说「情感分析由主 Agent 完成」并结束——主 Agent 即当前 Agent,必须由你继续完成情感分析与报告。

  • 登录:非搜索引擎前先 login.py --platform <平台>;百度/Bing 免登录。
  • 爬取:crawl.py 或 crawl_for_sentiment(...),默认平台 baidu;执行超时 ≥ 10 分钟(见上文「爬取超时」);非搜索引擎时 context_name 与登录一致。
  • 情感分析:读 scripts/sentiment/sentiment_instruction.md;对爬取 JSON(raw_output_path)逐条判定情感;写情感结果小 JSON(如 output/sentiment_only.json);运行 python scripts/sentiment/write_processed.py --raw <爬取JSON> --sentiment <情感结果JSON> --output output/processed.json。
  • 报告:report.py --input output/processed.json 或 generate_report(...)。
  • 失败:未配置 Key、未登录或执行失败 → success: False、error。

代码示例

python
import asyncio, sys, json
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent / "scripts"))
from crawl import crawl_for_sentiment, generate_report

async def main():
    result = await crawl_for_sentiment(platform="baidu", keywords=["产品名"], max_results_per_keyword=10, output_dir="output")
    if not result.get("success"): return
    raw_path = result.get("raw_output_path")
    # 主 Agent:读 sentiment_instruction.md → 对 raw_path 做情感分析 → 写 output/processed.json(或先用 write_processed.py 合并)
    processed_path = Path("output") / "processed.json"
    with open(processed_path, "r", encoding="utf-8") as f:
        report = generate_report(json.load(f), output_dir="output", title="舆情报告")
    print("报告:", report.get("markdown_path"))
asyncio.run(main())

常见问题

  • 只跑了爬取怎么办:若已运行 crawl.py 得到 raw_output_path,必须继续做情感分析(读 sentiment_instruction.md、写情感结果 JSON、运行 write_processed.py)再运行 report.py --input <processed路径>,直到产出报告。
  • processed JSON:title/content 常含未转义双引号,手写易导致 report.py JSON 解析失败。主 Agent 只产出「情感结果」小 JSON,再运行 python scripts/sentiment/write_processed.py --raw <爬取JSON> --sentiment <情感结果JSON> --output <processed路径>。详见 sentiment_instruction.md 第 4 节。
  • 登录失效:重跑 python scripts/login.py --platform <平台> [--context-name ...]。
  • 爬取超时:执行环境超时须 ≥ 10 分钟(见上文);需更长时显式传 --crawl-timeout(秒)。

文件结构

SKILL.md · scripts/:crawl.py(爬取/报告入口)、report.py、login.py、crawler/、sentiment/(sentiment_instruction.md、write_processed.py)、reporter/ · output/

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Agentbay Monitor Skills AI skill do?

舆情监控技能,最终产出舆情报告。当用户问「某事件/话题舆情如何」「舆论怎么样」「做舆情分析」「运行舆情分析」或按关键词/平台爬取并生成舆情报告时,使用本技能。约定:凡舆情相关意图即执行全流程(爬取→情感分析→生成报告)。爬取由本技能完成;情感分析由主 Agent 按提示词自主判断;报告由 generate_report 生成。

Why use Agentbay Monitor Skills on TypingMind?

Because you install it once and use it with any model. Agentbay Monitor Skills is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Agentbay Monitor Skills in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/agentbay-ai/agentbay-skills/tree/main/agentbay-monitor-skills. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Agentbay Monitor Skills?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Agentbay Monitor Skills?

As many as you like. As long as a model supports skills, you can use Agentbay Monitor Skills with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Agentbay Monitor Skills AI skill free?

It is published on GitHub by agentbay-ai. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇