100 个 Agent Skills 盘点(九):通信与通知集成

写在前面
这是「100 个 Agent Skills 盘点」系列的第九篇。这一篇聚焦 Agent 的”表达能力”——通信与通知。
一个再聪明的 Agent,如果不能把结果告诉用户,那它的价值就大打折扣。通信 Skills 让 Agent 能通过 Slack、邮件、Telegram 等渠道,把信息”推”到用户面前。
1. Slack MCP Server 💬
类别: 团队通信 协议: MCP
Slack 是最流行的团队协作工具。Agent 通过 Slack MCP 可以发送消息、创建频道、管理工作流。
能力说明:
- 发送消息和附件
- 创建和管理频道
- 消息搜索
- 反应表情(Reaction)
- 工作流触发
Agent 使用场景:
// Agent 发送每日报告到 Slackasync function sendDailyReport(data) { // 发送富文本消息 await slack.postMessage({ channel: '#engineering', blocks: [ { type: 'header', text: { type: 'plain_text', text: '📊 每日运营报告' } }, { type: 'section', fields: [ { type: 'mrkdwn', text: `*活跃用户:*\n${data.activeUsers}` }, { type: 'mrkdwn', text: `*新增注册:*\n${data.newUsers}` }, { type: 'mrkdwn', text: `*收入:*\n¥${data.revenue}` }, { type: 'mrkdwn', text: `*转化率:*\n${data.conversionRate}%` } ] }, { type: 'actions', elements: [ { type: 'button', text: { type: 'plain_text', text: '查看详情' }, url: 'https://dashboard.example.com' } ] } ] });}// Agent 监控告警推送到 Slackasync function sendAlert(alert) { const color = alert.severity === 'critical' ? '#FF0000' : alert.severity === 'warning' ? '#FFA500' : '#36A64F';
await slack.postMessage({ channel: '#alerts', attachments: [{ color: color, title: `🚨 ${alert.title}`, text: alert.message, fields: [ { title: '服务', value: alert.service, short: true }, { title: '环境', value: alert.environment, short: true }, { title: '时间', value: new Date().toLocaleString(), short: true } ] }] });}典型指令:
每天早上 9 点把昨日的运营数据发到 Slack #analytics 频道,包含活跃用户、收入、转化率三个关键指标。2. Discord MCP Server 🎮
类别: 社区通信 协议: MCP
Discord 不只是游戏社区,很多技术团队和开源项目也用它。Agent 可以在 Discord 中发送消息、管理频道、创建嵌入消息。
能力说明:
- 发送消息和嵌入(Embed)
- 频道管理
- 角色管理
- 斜杠命令
- Webhook 集成
Agent 使用场景:
// Agent 在 Discord 发布版本更新通知async function announceRelease(version, changelog) { await discord.sendEmbed({ channel: '#announcements', embed: { title: `🎉 v${version} 发布!`, description: changelog.summary, color: 0x5865F2, fields: [ { name: '✨ 新功能', value: changelog.features.map(f => `• ${f}`).join('\n') }, { name: '🐛 Bug 修复', value: changelog.fixes.map(f => `• ${f}`).join('\n') } ], footer: { text: '查看完整更新日志' }, timestamp: new Date().toISOString() } });}典型指令:
每当 GitHub Release 发布新版本时,自动在 Discord #releases 频道发送更新通知,包含版本号、新功能列表和下载链接。3. 邮件发送 📧
类别: 电子邮件 适用工具: Nodemailer / SendGrid / Resend
邮件仍然是正式商务通信的主要渠道。Agent 可以发送报告、通知、营销邮件。
能力说明:
- HTML 邮件发送
- 附件支持
- 模板引擎
- 批量发送
- 发送追踪
Agent 使用场景:
// Agent 发送周报邮件const nodemailer = require('nodemailer');
async function sendWeeklyReport(recipients, reportData) { const transporter = nodemailer.createTransport({ host: 'smtp.example.com', port: 587, auth: { user: process.env.EMAIL_USER, pass: process.env.EMAIL_PASS } });
const html = ` <div style="font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto;"> <h1 style="color: #2563eb;">📊 周报 - ${reportData.week}</h1>
<div style="background: #f3f4f6; padding: 20px; border-radius: 8px; margin: 20px 0;"> <h2>关键指标</h2> <table style="width: 100%;"> <tr> <td><strong>活跃用户</strong></td> <td style="text-align: right; color: #10b981;">${reportData.users} ↑</td> </tr> <tr> <td><strong>收入</strong></td> <td style="text-align: right;">¥${reportData.revenue}</td> </tr> </table> </div>
<h2>本周亮点</h2> <ul> ${reportData.highlights.map(h => `<li>${h}</li>`).join('')} </ul>
<p style="color: #6b7280; font-size: 12px;"> 此邮件由 AI Agent 自动生成 </p> </div> `;
await transporter.sendMail({ from: '"AI Agent" <agent@example.com>', to: recipients.join(', '), subject: `📊 周报 - ${reportData.week}`, html: html });}典型指令:
每周五下午 5 点自动发送周报邮件给团队,包含本周的开发进度、Bug 修复情况和下周计划。4. Telegram Bot 📱
类别: 即时通信 适用工具: Telegram Bot API / node-telegram-bot-api
Telegram Bot 是个人通知的绝佳渠道——免费、可靠、支持富文本和内联按钮。
能力说明:
- 发送文本/图片/文件消息
- 内联按钮和回调
- 群组管理
- Webhook 和轮询
Agent 使用场景:
// Agent 通过 Telegram 发送服务器告警const TelegramBot = require('node-telegram-bot-api');const bot = new TelegramBot(process.env.TELEGRAM_TOKEN);
async function sendServerAlert(chatId, alert) { const emoji = { critical: '🔴', warning: '🟡', info: '🟢' }[alert.severity] || '⚪';
const message = `${emoji} *服务器告警*
*服务:* ${alert.service}*状态:* ${alert.status}*详情:* ${alert.message}*时间:* ${new Date().toLocaleString()}
${alert.severity === 'critical' ? '⚠️ 需要立即处理!' : ''} `;
await bot.sendMessage(chatId, message, { parse_mode: 'Markdown' });}
// Agent 定时发送健康报告async function sendHealthReport(chatId) { const status = await checkAllServices();
let message = '🏥 *系统健康报告*\n\n'; for (const [service, healthy] of Object.entries(status)) { message += `${healthy ? '✅' : '❌'} ${service}\n`; }
await bot.sendMessage(chatId, message, { parse_mode: 'Markdown' });}典型指令:
配置 Telegram Bot,当服务器 CPU 使用率超过 90%或磁盘空间不足 10% 时,自动发送告警消息。5. Webhook 集成 🔗
类别: 事件驱动 适用工具: HTTP 请求
Webhook 是最通用的事件通知方式。Agent 可以通过 Webhook 与任何支持 HTTP 的系统集成。
能力说明:
- 发送 HTTP POST 请求
- 自定义 payload 格式
- 签名验证
- 重试机制
Agent 使用场景:
// Agent 通过 Webhook 触发自动化流程async function triggerWebhook(event, data) { const webhooks = await getWebhooksForEvent(event);
for (const webhook of webhooks) { const payload = { event: event, timestamp: new Date().toISOString(), data: data };
// 生成签名 const signature = crypto .createHmac('sha256', webhook.secret) .update(JSON.stringify(payload)) .digest('hex');
try { const response = await fetch(webhook.url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Webhook-Signature': signature }, body: JSON.stringify(payload) });
if (!response.ok) { console.error(`Webhook failed: ${webhook.url} - ${response.status}`); await retryWebhook(webhook, payload, 3); // 重试 3 次 } } catch (error) { console.error(`Webhook error: ${webhook.url}`, error); } }}
// 使用示例await triggerWebhook('deployment.completed', { service: 'myapp', version: 'v2.1.0', environment: 'production'});典型指令:
配置 Webhook,当代码部署到生产环境时,自动通知 Jira 更新任务状态、通知 Slack 频道、触发监控系统更新。6. 企业微信 / 钉钉通知 🏢
类别: 企业通信 适用工具: 企业微信 API / 钉钉 API
在中国的企业环境中,企业微信和钉钉是主流的团队通信工具。Agent 可以通过它们发送工作通知。
能力说明:
- 文本/Markdown 消息发送
- 群机器人 Webhook
- 应用消息推送
- @指定人员
Agent 使用场景:
// Agent 通过钉钉机器人发送告警async function sendDingTalkAlert(webhook, alert) { const message = { msgtype: 'markdown', markdown: { title: `服务器告警 - ${alert.service}`, text: `## 🔴 服务器告警\n\n` + `**服务:** ${alert.service}\n\n` + `**状态:** ${alert.status}\n\n` + `**详情:** ${alert.message}\n\n` + `**时间:** ${new Date().toLocaleString()}\n\n` + `[查看详情](https://monitor.example.com)` }, at: { atMobiles: alert.notifyUsers || [], isAtAll: alert.severity === 'critical' } };
await fetch(webhook, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(message) });}
// Agent 通过企业微信发送日报async function sendWeChatWorkReport(webhook, report) { await fetch(webhook, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ msgtype: 'template_card', template_card: { card_type: 'text_notice', source: { desc: 'AI Agent 自动生成' }, main_title: { title: '📊 每日运营报告' }, horizontal_content_list: [ { keyname: '活跃用户', value: report.users }, { keyname: '收入', value: `¥${report.revenue}` }, { keyname: '转化率', value: `${report.conversion}%` } ] } }) });}典型指令:
配置钉钉群机器人,当 CI/CD Pipeline 失败时,自动在群里发送告警 @相关开发人员。7. 短信通知 📲
类别: 移动通知 适用工具: Twilio / 阿里云短信 / 腾讯云短信
短信是最可靠的紧急通知方式——不依赖互联网连接,几乎 100% 送达。
能力说明:
- 单条短信发送
- 批量发送
- 模板短信
- 发送状态追踪
Agent 使用场景:
# Agent 发送紧急告警短信from twilio.rest import Client
def send_emergency_sms(phone_numbers, alert): client = Client(TWILIO_SID, TWILIO_TOKEN)
message = f"【紧急告警】{alert['service']} 服务异常:{alert['message']}。请立即处理。详情:{alert['dashboard_url']}"
for phone in phone_numbers: client.messages.create( body=message, from_='+1234567890', to=phone )
print(f"✅ 已发送告警短信给 {len(phone_numbers)} 人")典型指令:
当生产环境出现 P0 级别故障时,自动发送短信给值班人员,同时发送 Slack 消息和邮件。8. Linear MCP Server 📋
类别: 项目管理 协议: MCP
Linear 是最受开发者欢迎的项目管理工具,以极致的速度和简洁的 UI 著称。Agent 通过 Linear MCP 可以直接创建和管理 Issue、同步项目状态,实现开发工作流的全自动化。
能力说明:
- Issue 创建与更新
- 项目和迭代管理
- 状态同步与流转
- 团队协作与评论
- 优先级和标签管理
Agent 使用场景:
// Agent 自动从错误监控创建 Issueasync function createIssueFromError(error) { // 1. 分析错误信息,生成 Issue 描述 const description = await agent.analyze({ prompt: `分析以下错误并生成 Linear Issue 描述: 错误类型:${error.type} 错误信息:${error.message} 堆栈:${error.stack} 影响用户数:${error.affectedUsers}`, format: 'structured' });
// 2. 创建 Linear Issue const issue = await linear.createIssue({ teamId: 'TEAM_ID', title: `[${error.severity}] ${error.type}: ${error.message.slice(0, 80)}`, description: description.markdown, priority: mapSeverityToPriority(error.severity), // P0→Urgent, P1→High... assigneeId: await findOnCallEngineer(), labels: ['auto-created', error.service], projectId: getProjectForService(error.service) });
// 3. 关联到 Sentry 错误链接 await linear.updateIssue(issue.id, { description: `${description.markdown}\n\n---\n🔗 [Sentry 详情](${error.sentryUrl})` });
console.log(`✅ Issue 创建成功: ${issue.identifier}`); return issue;}
// Agent 更新任务状态async function syncTaskStatus(prEvent) { // 从 PR 标题提取 Issue 编号(如 ENG-123) const issueMatch = prEvent.title.match(/([A-Z]+-\d+)/); if (!issueMatch) return;
const issue = await linear.getIssueByIdentifier(issueMatch[1]);
// PR 合并 → 自动将 Issue 标记为 Done if (prEvent.action === 'merged') { await linear.updateIssue(issue.id, { stateId: 'DONE_STATE_ID' }); await linear.createComment(issue.id, { body: `✅ 已通过 PR [#${prEvent.number}](${prEvent.url}) 完成` }); }}典型指令:
当 Sentry 捕获到 P0 级别的新错误时,自动在 Linear 的「后端」项目中创建一个 Urgent Issue,分配给当前值班工程师,并附上错误详情和堆栈信息。PR 合并后自动更新 Issue 状态为 Done。9. 消息队列集成 📨
类别: 异步通信 适用工具: RabbitMQ / Kafka / Redis Pub/Sub
消息队列让 Agent 能处理高并发的异步任务,解耦生产者和消费者。
能力说明:
- 消息发布和订阅
- 队列管理
- 死信队列处理
- 消息确认
Agent 使用场景:
// Agent 使用 RabbitMQ 处理异步任务const amqp = require('amqplib');
async function setupTaskQueue() { const connection = await amqp.connect('amqp://localhost'); const channel = await connection.createChannel();
// 声明队列 await channel.assertQueue('task_queue', { durable: true }); await channel.assertQueue('result_queue', { durable: true });
// 消费任务 channel.consume('task_queue', async (msg) => { const task = JSON.parse(msg.content.toString()); console.log(`Processing task: ${task.type}`);
try { const result = await processTask(task);
// 发送结果 channel.sendToQueue('result_queue', Buffer.from(JSON.stringify({ taskId: task.id, result: result, status: 'completed' })) );
channel.ack(msg); } catch (error) { // 失败重试 channel.nack(msg, false, true); } });}典型指令:
设计一个基于消息队列的异步任务处理系统,支持任务分发、结果收集、失败重试和死信队列。10. Obsidian MCP Server 📝
类别: 知识管理 协议: MCP
Obsidian 是最流行的知识管理工具之一,基于本地 Markdown 文件,支持双向链接和知识图谱。Agent 通过 Obsidian MCP 可以读写笔记、搜索内容、管理标签,帮助用户自动整理和构建知识体系。
能力说明:
- 笔记读写与创建
- 全文搜索与检索
- 标签管理与分类
- 双向链接分析
- 知识图谱生成
Agent 使用场景:
// Agent 自动整理会议笔记async function organizeMeetingNote(meetingData) { // 1. 创建结构化的会议笔记 const noteContent = `---date: ${meetingData.date}type: meetingattendees: [${meetingData.attendees.join(', ')}]tags: [会议, ${meetingData.project}]---
# ${meetingData.title}
## 参会人员${meetingData.attendees.map(a => `- [[${a}]]`).join('\n')}
## 议程与讨论${meetingData.agenda.map(item => `### ${item.topic}\n${item.discussion}`).join('\n\n')}
## 行动项${meetingData.actionItems.map(item => `- [ ] ${item.task} —— @${item.assignee}(截止:${item.deadline})`).join('\n')}
## 相关笔记${meetingData.relatedNotes.map(note => `- [[${note}]]`).join('\n')}`;
// 2. 写入 Obsidian Vault await obsidian.createNote({ path: `会议记录/${meetingData.date}-${meetingData.title}.md`, content: noteContent });
// 3. 更新参会人员的笔记,添加反向链接 for (const attendee of meetingData.attendees) { await obsidian.appendToNote({ path: `人员/${attendee}.md`, content: `\n- 参加会议 [[${meetingData.title}]](${meetingData.date})` }); }
console.log(`✅ 会议笔记已创建并建立双向链接`);}
// Agent 生成知识图谱分析async function generateKnowledgeGraph(tag) { // 1. 搜索所有相关笔记 const notes = await obsidian.search({ query: `tag:${tag}`, limit: 100 });
// 2. 分析双向链接关系 const graph = { nodes: [], edges: [] }; for (const note of notes) { graph.nodes.push({ id: note.path, title: note.title, tags: note.tags });
// 提取笔记中的链接 const links = await obsidian.getLinks(note.path); for (const link of links) { graph.edges.push({ source: note.path, target: link }); } }
// 3. 生成图谱报告 const report = `# 知识图谱分析:#${tag}
## 概览- 笔记总数:${graph.nodes.length}- 链接总数:${graph.edges.length}
## 核心节点(被引用最多)${getTopNodes(graph, 10).map(n => `- [[${n.title}]](被引用 ${n.count} 次)`).join('\n')}
## 知识集群${identifyClusters(graph).map(c => `### ${c.name}\n${c.notes.map(n => `- [[${n}]]`).join('\n')}`).join('\n')}`;
await obsidian.createNote({ path: `知识图谱/${tag}-分析报告.md`, content: report });
return graph;}典型指令:
帮我整理本周的会议记录,自动创建结构化笔记,并在每个参会人员的笔记中添加反向链接。
分析 #[项目名] 标签下的所有笔记,生成知识图谱报告,找出核心概念和知识盲区。本篇小结
| # | Skill | 类别 | 难度 | 价值 |
|---|---|---|---|---|
| 1 | Slack MCP | 团队通信 | ⭐⭐ | ⭐⭐⭐⭐⭐ |
| 2 | Discord MCP | 社区通信 | ⭐⭐ | ⭐⭐⭐⭐ |
| 3 | 邮件发送 | 电子邮件 | ⭐⭐ | ⭐⭐⭐⭐⭐ |
| 4 | Telegram Bot | 即时通信 | ⭐⭐ | ⭐⭐⭐⭐ |
| 5 | Webhook | 事件驱动 | ⭐⭐ | ⭐⭐⭐⭐⭐ |
| 6 | 企业微信/钉钉 | 企业通信 | ⭐⭐ | ⭐⭐⭐⭐ |
| 7 | 短信通知 | 移动通知 | ⭐⭐ | ⭐⭐⭐ |
| 8 | Linear MCP | 项目管理 | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| 9 | 消息队列 | 异步通信 | ⭐⭐⭐ | ⭐⭐⭐⭐ |
| 10 | Obsidian MCP | 知识管理 | ⭐⭐⭐ | ⭐⭐⭐⭐ |
核心观点: 通信 Skills 是 Agent 的”声音”。一个能通过 Slack、邮件、Telegram 等渠道主动通知用户的 Agent,才能真正成为”7×24 小时的助手”,而不只是”被动回答问题的机器”。
系列导航
- 👈 上一篇: 第八篇:文档与文件处理
- 👉 下一篇: 第十篇:创意与可视化
支持与分享
如果这篇文章对你有帮助,欢迎分享给更多人或赞助支持!