AgentSkillsCN

unified-messages

跨平台消息聚合器。当用户未指定平台(telegram/imessage)时,作为默认使用。提供跨两个平台的统一收件箱、搜索和分类。触发条件:“检查消息”(无平台)、“收件箱”、“谁给我发消息”、“我所有消息”、“分类”。不适用于特定平台的请求——使用tg-ingest进行“telegram X”或imsg-ingest进行“imessage X”。

SKILL.md
--- frontmatter
name: unified-messages
description: >
  Cross-platform messaging aggregator. Use as DEFAULT when user does NOT
  specify a platform (telegram/imessage). Provides unified inbox, search,
  and triage across both platforms. Triggers: "check messages" (no platform),
  "inbox", "who messaged me", "all my messages", "triage". NOT for platform-
  specific requests - use tg-ingest for "telegram X" or imsg-ingest for
  "imessage X".

Unified Messages

Cross-platform aggregator for Telegram + iMessage. Use when no platform specified.

If user says "telegram" → use tg-ingest skill If user says "imessage" → use imsg-ingest skill If user says "messages" (no platform) → use this skill

Quick Start

bash
# Sync both platforms
python -m unified.cli sync

# List pending threads
python -m unified.cli list

# Check status
python -m unified.cli status --detailed

Thread ID Format

All threads use canonical IDs:

  • Telegram DM: tg:dm:username (e.g., tg:dm:vibhu)
  • Telegram Group: tg:group:slug (e.g., tg:group:crypto_trenches)
  • iMessage DM: imsg:dm:+14155551234 or imsg:dm:email@example.com
  • iMessage Group: imsg:group:chat123456

MCP Tools

ToolPurpose
unified_searchSearch people/threads across platforms
unified_inboxList threads needing attention
unified_get_personFull context for a person (threads, messages, notes)
unified_get_threadMessages and state for specific thread
unified_save_draftSave draft reply
unified_set_statusSet pending/done/archived
unified_snoozeSnooze until datetime
unified_add_noteAdd note to thread
unified_syncSync both platforms

Workflows

Daily Triage

  1. unified_sync - Pull latest
  2. unified_inbox - See what needs attention
  3. Review each thread, then set_status("done") or save_draft()

Find a Person

  1. unified_search("vibhu") - Returns person with all thread IDs
  2. unified_get_person("vibhu") - Full context with recent messages

Reply Workflow

  1. unified_get_thread("tg:dm:username") - Read conversation
  2. unified_save_draft("tg:dm:username", "Draft...") - Save draft
  3. Send manually in Telegram/iMessage
  4. unified_set_status("tg:dm:username", "done") - Mark complete

Project Structure

code
unified-messages/
├── unified/
│   ├── cli.py          # CLI (sync, status, list, generate, render)
│   ├── aggregator.py   # Cross-platform search, inbox, sync
│   ├── router.py       # Routes to correct platform
│   ├── contacts.py     # Person-centric contact resolution
│   └── triage.py       # Triage context generation
├── mcp_server.py       # MCP server (9 tools)
└── data/contacts.json  # Person registry

Platform Dependencies

Imports from sibling repos:

  • tg-ingest/ - Telegram (Telethon)
  • imsg-ingest/ - iMessage (SQLite chat.db)

See references/cli-commands.md for full CLI docs. See references/data-locations.md for data paths.