AgentSkillsCN

email

**通用触发器**:当用户想要读取/发送电子邮件时使用。 常见模式: - “检查我的邮件/收件箱”,“显示未读” - “发送邮件给 [收件人]” - “检查邮箱”,“发送邮件” 📥 **阅读**: - “检查收件箱”,“显示未读邮件”,“我的邮箱里有什么” - “读取来自 [发件人] 的邮件”,“查找关于 [主题] 的邮件” - “检查收件箱”,“未读”,“邮箱里有什么” 📤 **发送**: - “发送邮件到 [地址]”,“撰写邮件” - “回复邮件”,“转发邮件” - “发送邮件”,“回复邮件”,“写邮件” 📋 **账户**: - “列出邮件账户”,“切换到工作邮箱” - “邮件账户列表”,“使用工作邮箱” ❌ **不应激活**: - “什么是 SMTP 协议”(一般问题) - “电子邮件正则表达式验证”(编程) - “安装 Himalaya”(设置) 触发器:邮件,邮箱,收件箱,发送,检查,读取,显示,列表,获取, 撰写,回复,转发,未读,获取,查看,显示, 发送,检查,读取,显示,获取,邮件,邮箱

SKILL.md
--- frontmatter
name: email
description: |
  **UNIVERSAL TRIGGER**: Use when user wants to READ/SEND email.

  Common patterns:
  - "check my email/inbox", "show unread"
  - "send email to [recipient]"
  - "проверить почту", "отправить письмо"

  📥 **Reading**:
  - "check inbox", "show unread emails", "what's in my mail"
  - "read email from [sender]", "find emails about [topic]"
  - "проверить входящие", "непрочитанные", "что в почте"

  📤 **Sending**:
  - "send email to [address]", "compose email"
  - "reply to email", "forward email"
  - "отправить письмо", "ответить на письмо", "написать письмо"

  📋 **Accounts**:
  - "list email accounts", "switch to work email"
  - "список почтовых аккаунтов", "использовать рабочую почту"

  ❌ **Should NOT activate**:
  - "what is SMTP protocol" (general question)
  - "email regex validation" (programming)
  - "install himalaya" (setup)

  TRIGGERS: email, mail, inbox, send, check, read, show, list, get,
  compose, reply, forward, unread, fetch, view, display,
  отправить, проверить, прочитать, показать, получить, письмо, почта
allowed-tools: Bash

Email Skill

CLI-based email management using Himalaya.

Prerequisites

Himalaya must be installed and configured by the user. Check availability:

bash
himalaya account list

If this fails, inform the user they need to install and configure himalaya first.

Reading Emails

List messages

bash
# Last 20 messages from INBOX
himalaya envelope list -f INBOX -s 20

# Unread only
himalaya envelope list "not flag seen"

# From specific sender
himalaya envelope list "from boss@company.com"

# By subject
himalaya envelope list "subject meeting"

# By date
himalaya envelope list "after 2025-01-20"

# Combined filters
himalaya envelope list "from support@example.com and after 2025-01-01"

# Different account
himalaya envelope list -a "work@company.com" -s 10

Read a message

bash
# Read by ID (from envelope list)
himalaya message read <id>

# Preview without marking as read
himalaya message read -p <id>

List folders

bash
himalaya folder list

Sending Emails

IMPORTANT: Before sending, ASK the user:

  1. From: which account to send from (use himalaya account list to show options)
  2. To: recipient email address
  3. Subject: email subject
  4. Body: where to get the text (type now / from file / describe what to write)

Send new email

bash
# From is REQUIRED - use email from account list
himalaya template send <<'EOF'
From: sender@example.com
To: recipient@example.com
Subject: Email subject

Body text here.
Unicode supported.
EOF

With CC/BCC

bash
himalaya template send <<'EOF'
From: me@example.com
To: main@example.com
Cc: copy@example.com
Bcc: hidden@example.com
Subject: Important message

Message body.
EOF

From specific account

bash
# Use -a flag AND matching From header
himalaya template send -a "work@company.com" <<'EOF'
From: work@company.com
To: client@example.com
Subject: Project update

Status report.
EOF

Account Management

bash
# List configured accounts
himalaya account list

# Use specific account (add -a flag to any command)
himalaya envelope list -a "personal@gmail.com" -s 10
himalaya template send -a "work@company.com" <<'EOF'
...
EOF

Query Syntax Reference

Operators

  • not <condition> - negation
  • <cond> and <cond> - both conditions
  • <cond> or <cond> - either condition

Conditions

  • date <yyyy-mm-dd> - exact date
  • before <yyyy-mm-dd> - before date
  • after <yyyy-mm-dd> - after date
  • from <pattern> - sender contains
  • to <pattern> - recipient contains
  • subject <pattern> - subject contains
  • body <pattern> - body contains
  • flag <flag> - has flag (seen, answered, flagged, deleted, draft)

Examples

bash
# Unread from last week
himalaya envelope list "not flag seen and after 2025-01-18"

# From boss OR urgent in subject
himalaya envelope list "from boss@company.com or subject urgent"

Error Handling

If himalaya returns an error, show it to the user. Common errors:

  • himalaya: command not found — himalaya not installed
  • no account found — no configured accounts
  • connection refused — IMAP/SMTP server unreachable
  • authentication failed — wrong password/credentials