AgentSkillsCN

inbox-zero

利用 Himalaya CLI 进行 AI 邮件分类与收件箱管理。当用户需要对收件箱进行分类、核查邮件优先级、生成每日邮件摘要、起草回复、跟踪后续跟进,或推荐取消订阅时,可调用此功能。例如,“对我的收件箱进行分类”“哪些邮件需要重点关注”“为……起草回复”“邮件摘要”“后续跟进提醒”或“清理我的订阅列表”等请求均可触发该功能。

SKILL.md
--- frontmatter
name: inbox-zero
description: "AI email triage and inbox management using himalaya CLI. Use when asked to triage inbox, check email priorities, generate a daily email digest, draft replies, track follow-ups, or recommend unsubscribes. Triggers on requests like 'triage my inbox,' 'what emails need attention,' 'draft a reply to,' 'email digest,' 'follow up reminders,' or 'clean up my subscriptions.'"

InboxZero

Intelligent email triage and management layer on top of himalaya CLI.

Prerequisites

  • himalaya CLI installed and configured with at least one IMAP/SMTP account
  • Verify: himalaya envelope list returns results

Commands

1. Triage Inbox

Scan and categorize all unread emails by urgency and type.

bash
himalaya envelope list --output json

For each email, read the content:

bash
himalaya message read <id>

Categorize every email into exactly one bucket:

  • 🔴 Urgent — Time-sensitive, requires action within hours (deadlines, outages, boss/client escalations)
  • 🟡 Needs Reply — Expects a response but not time-critical (questions, requests, invitations)
  • 🔵 Actionable — Requires action but no reply (tasks, approvals, review requests)
  • FYI — Informational only (updates, CC'd threads, status reports)
  • 🗑️ Noise — Promotional, marketing, automated notifications with no value

See references/category-rules.md for detailed classification heuristics.

Output as a sorted list, urgent first. Include sender, subject, and a one-line summary for each.

2. Daily Digest

Generate a concise morning briefing. Run triage first, then format as:

markdown
# 📬 Daily Email Digest — {date}

## 🔴 Urgent ({count})
- [Sender] Subject — one-line summary

## 🟡 Needs Reply ({count})
- [Sender] Subject — one-line summary

## 🔵 Action Items ({count})
- [Sender] Subject — one-line summary

## ⚪ FYI ({count})
- [Sender] Subject — one-line summary

## 🗑️ Noise ({count} skipped)

## 📊 Stats
- Total unread: X | Urgent: X | Needs reply: X

Output inline or write to inbox-digest-{date}.md if user requests file output.

3. Draft Replies

Auto-draft responses for routine emails. See references/reply-templates.md for templates.

Draft types:

  • Meeting confirmation — Accept/decline with brief note
  • Acknowledgment — "Got it, thanks" variations
  • Simple question — Direct answer if context is clear
  • Scheduling — Propose times or confirm availability
  • Delegation — Forward suggestion with context

Workflow:

  1. Read the email: himalaya message read <id>
  2. Generate draft using appropriate template and context
  3. Present draft to user for approval
  4. On approval, send: echo '<mml>' | himalaya template send

Never send without explicit user approval.

4. Follow-up Tracking

Identify emails needing follow-up and track response status.

Check sent folder for emails awaiting replies:

bash
himalaya envelope list --folder Sent --output json

Flag criteria:

  • Sent email asked a question or made a request
  • No reply received within expected timeframe (default: 48h)
  • Thread has gone silent after user's last message

Output overdue follow-ups with:

  • Original send date
  • Recipient
  • Subject
  • Days waiting
  • Suggested nudge action

5. Unsubscribe Recommendations

Identify newsletters and promotions the user rarely engages with.

Signals for recommending unsubscribe:

  • Sender appears 5+ times in last 30 days
  • User has never replied to or opened these
  • Contains "unsubscribe" link in body
  • From a known newsletter/marketing domain pattern

Present as a list with sender, frequency, and recommendation (unsubscribe / keep / reduce frequency).

Key Principles

  • Read-only by default. Never move, delete, or send without explicit approval.
  • himalaya is the engine. Always use himalaya CLI for email operations — never access IMAP directly.
  • Batch efficiently. Use --output json for structured parsing. Read full messages only when classification requires it.
  • Respect privacy. Email content stays in the conversation context. Never log or persist email bodies unless explicitly requested.
  • Be conservative with urgency. When uncertain, categorize lower rather than higher urgency.