email-triage

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Email Triage (Scheduled Digest)

邮件分类(定时摘要)

Automated email triage running every 6h via launchd. Fetches recent emails, triages with Haiku, sends significant findings to Telegram.
通过launchd每6小时运行一次的自动化邮件分类功能。获取近期邮件,使用Haiku进行分类,将重要结果发送到Telegram。

Mandatory Preflight

强制前置检查

Step 1: Check Digest Script Exists

步骤1:检查摘要脚本是否存在

bash
ls -la "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/digest.ts" 2>/dev/null || echo "SCRIPT_NOT_FOUND"
bash
ls -la "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/digest.ts" 2>/dev/null || echo "SCRIPT_NOT_FOUND"

Step 2: Verify Environment

步骤2:验证环境变量

bash
echo "GMAIL_OP_UUID: ${GMAIL_OP_UUID:-NOT_SET}"
echo "TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN:+SET}"
echo "TELEGRAM_CHAT_ID: ${TELEGRAM_CHAT_ID:-NOT_SET}"
echo "HAIKU_MODEL: ${HAIKU_MODEL:-NOT_SET}"
All must be SET. If any are NOT_SET, run the setup command first.
bash
echo "GMAIL_OP_UUID: ${GMAIL_OP_UUID:-NOT_SET}"
echo "TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN:+SET}"
echo "TELEGRAM_CHAT_ID: ${TELEGRAM_CHAT_ID:-NOT_SET}"
echo "HAIKU_MODEL: ${HAIKU_MODEL:-NOT_SET}"
所有变量都必须已配置。如果有任何变量显示NOT_SET,请先运行设置命令。

Step 3: Verify Gmail CLI Binary

步骤3:验证Gmail CLI二进制文件

bash
ls -la "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/gmail-cli/gmail" 2>/dev/null || echo "BINARY_NOT_FOUND"
If BINARY_NOT_FOUND: Build it:
bash
cd "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/gmail-cli" && bun install && bun run build
bash
ls -la "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/gmail-cli/gmail" 2>/dev/null || echo "BINARY_NOT_FOUND"
如果提示BINARY_NOT_FOUND:请构建该二进制文件:
bash
cd "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/gmail-cli" && bun install && bun run build

Three-Category Triage System

三类分类体系

CategoryExamples
SYSTEM & SECURITYExchange alerts, 2FA codes, password resets, new device logins
WORKDeadlines, invoices, contracts, GitHub PRs, professional requests
PERSONAL & FAMILYFriends/family messages, appointments, vehicle service, health
Urgency levels within each: CRITICAL > HIGH > MEDIUM > LOW.
类别示例
系统与安全Exchange告警、2FA验证码、密码重置、新设备登录
工作截止日期、发票、合同、GitHub PR、职业相关请求
个人与家庭亲友消息、预约、车辆保养、健康相关
每个类别内的紧急程度:CRITICAL > HIGH > MEDIUM > LOW。

Running Manually

手动运行

bash
cd ~/own/amonic && bun run "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/digest.ts"
bash
cd ~/own/amonic && bun run "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/digest.ts"

References

参考文档

  • triage-prompts.md — System prompt + podcast prompt
  • category-config.md — Category schema, urgency, emoji maps
  • triage-prompts.md — 系统提示词 + 播客提示词
  • category-config.md — 类别 schema、紧急程度、emoji映射表

Post-Change Checklist

变更后检查清单

  • YAML frontmatter valid (no colons in description)
  • Trigger keywords current
  • Path patterns use $HOME not hardcoded paths
  • YAML 前言有效(描述中没有冒号)
  • 触发关键词为最新版本
  • 路径模式使用$HOME而非硬编码路径