Mediator Skill
Emotional firewall for difficult relationships. Intercepts messages from configured contacts, strips out emotional content, presents just the facts, and helps draft measured responses.
Quick Start
CODEBLOCK0
Configuration
Config lives at ~/.clawdbot/mediator.yaml:
CODEBLOCK1
Modes
- - intercept: Archive/hide original, only show summary. User never sees raw emotional content.
- assist: Show original but also provide summary and response suggestions.
Summarize Options
- - facts-only: Extract only actionable items, requests, deadlines. No emotion.
- neutral: Rewrite the message in neutral tone, preserving all content.
- full: Show everything but flag emotional/manipulative language.
Respond Options
- - draft: Generate suggested response, wait for approval before sending.
- auto: Automatically respond (use with extreme caution).
How It Works
Email Flow
- 1. Gmail Pub/Sub notification arrives (real-time)
- Check if sender matches any configured contact
- If match:
- Fetch full email content
- Process through LLM to extract facts/strip emotion
- Archive original (apply "Mediator/Raw" label, mark read)
- Send summary to configured notify channel
- If response needed, draft one
iMessage Flow
- 1.
imsg watch monitors for new messages - Check if sender matches configured contact
- If match:
- Process message content
- Send summary to notify channel
- Draft response if requested
Scripts
- -
mediator.sh - Main CLI wrapper - INLINECODE3 - Email processing logic
- INLINECODE4 - iMessage processing logic
- INLINECODE5 - LLM-based content analysis and summarization
Integration
Heartbeat Check
Add to HEARTBEAT.md:
CODEBLOCK2
Cron (for more frequent checking)
CODEBLOCK3
Safety Notes
- - Never auto-respond to legal, financial, or child-related messages
- Original messages are archived, not deleted (recoverable)
- All actions logged to INLINECODE7
- Review and adjust prompts if summaries miss important context
Example Output
Original email:
I can't BELIEVE you would do this to me AGAIN. After everything I've done for you!!! You NEVER think about anyone but yourself. I need you to pick up the kids at 3pm on Saturday and if you can't even do THAT then I don't know what to say anymore.
Mediator summary:
From: Ex Partner
Channel: Email
Action Required: Yes
Request: Pick up kids at 3pm Saturday
Suggested response:
"Confirmed. I'll pick up the kids at 3pm on Saturday."
See
references/prompts.md for the LLM prompts used in processing.
调解者技能
针对困难关系的情感防火墙。拦截来自已配置联系人的消息,剥离情感内容,仅呈现事实,并协助起草得体的回复。
快速开始
bash
初始化配置(若缺失则创建 mediator.yaml)
~/clawd/skills/mediator/scripts/mediator.sh init
添加需要调解的联系人
~/clawd/skills/mediator/scripts/mediator.sh add 前伴侣 \
--email ex@email.com \
--phone +15551234567 \
--channels email,imessage
处理传入消息(通常由 cron/心跳机制调用)
~/clawd/skills/mediator/scripts/mediator.sh check
列出已配置的联系人
~/clawd/skills/mediator/scripts/mediator.sh list
移除联系人
~/clawd/skills/mediator/scripts/mediator.sh remove 前伴侣
配置
配置文件位于 ~/.clawdbot/mediator.yaml:
yaml
mediator:
# 全局设置
archive_originals: true # 处理后将原始消息归档
notify_channel: telegram # 发送摘要的渠道(telegram|slack|imessage)
contacts:
- name: 前伴侣
email: ex@email.com
phone: +15551234567
channels: [email, imessage]
mode: intercept # intercept | assist
summarize: facts-only # facts-only | neutral | full
respond: draft # draft | auto(危险)
- name: 难缠客户
email: client@company.com
channels: [email]
mode: assist # 不隐藏原文,仅协助回复
summarize: neutral
respond: draft
模式
- - intercept:归档/隐藏原文,仅显示摘要。用户永远看不到原始情感内容。
- assist:显示原文,同时提供摘要和回复建议。
摘要选项
- - facts-only:仅提取可操作事项、请求、截止日期。不含情感。
- neutral:以中性语气重写消息,保留所有内容。
- full:显示全部内容,但标记情感化/操纵性语言。
回复选项
- - draft:生成建议回复,发送前等待批准。
- auto:自动回复(请极度谨慎使用)。
工作原理
邮件流程
- 1. 接收 Gmail Pub/Sub 通知(实时)
- 检查发件人是否匹配已配置的联系人
- 若匹配:
- 获取完整邮件内容
- 通过 LLM 处理以提取事实/剥离情感
- 归档原始邮件(应用调解者/原始标签,标记为已读)
- 将摘要发送至配置的通知渠道
- 如需回复,起草回复内容
iMessage 流程
- 1. imsg watch 监控新消息
- 检查发件人是否匹配已配置的联系人
- 若匹配:
- 处理消息内容
- 将摘要发送至通知渠道
- 按需起草回复
脚本
- - mediator.sh - 主 CLI 封装
- process-email.py - 邮件处理逻辑
- process-imessage.py - iMessage 处理逻辑
- summarize.py - 基于 LLM 的内容分析与摘要
集成
心跳检查
添加到 HEARTBEAT.md:
调解者检查
~/clawd/skills/mediator/scripts/mediator.sh check
Cron(用于更频繁的检查)
bash
工作时间内每5分钟检查一次
/5 9-18 * 1-5 ~/clawd/skills/mediator/scripts/mediator.sh check
安全提示
- - 切勿自动回复涉及法律、财务或子女相关的消息
- 原始消息会被归档而非删除(可恢复)
- 所有操作记录在 ~/.clawdbot/logs/mediator.log
- 若摘要遗漏重要上下文,请审查并调整提示词
示例输出
原始邮件:
我简直不敢相信你又要这样对我!!!我为你做了那么多,你却从来只考虑自己!周六下午3点你必须来接孩子,如果连这都做不到,那我真的无话可说了。
调解者摘要:
发件人: 前伴侣
渠道: 邮件
需要操作: 是
请求: 周六下午3点接孩子
建议回复:
确认。我会在周六下午3点来接孩子。
处理过程中使用的 LLM 提示词请参见 references/prompts.md。