Skills gmail-summarize
Fetch recent unread Gmail (yesterday + today) and send a digest to the user.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/2p1c/gmail-summarize" ~/.claude/skills/openclaw-skills-gmail-summarize && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/2p1c/gmail-summarize" ~/.openclaw/skills/openclaw-skills-gmail-summarize && rm -rf "$T"
manifest:
skills/2p1c/gmail-summarize/SKILL.mdsource content
Gmail Recent Digest
Requirements
- Python 3 must be available in the container environment (
command).python - IMAP credentials must be supplied via one of the following methods (env vars take precedence):
Option A — Environment variables (recommended)
| Variable | Description | Default |
|---|---|---|
| IMAP server hostname | |
| IMAP server port | |
| IMAP login username | (required) |
| IMAP login password / app-password | (required) |
| Max body characters per email | |
Option B — Config file
Set
EMAIL_CONFIG_PATH to point to a JSON file, or place the file at ~/.config/gmail-summarize/config.json.
The file must contain only the fields below (no other sensitive data should be stored in this file):
{ "email": { "imapHost": "imap.gmail.com", "imapPort": 993, "imapUsername": "your@gmail.com", "imapPassword": "your-app-password", "maxBodyChars": 2000 } }
Security notes
- Preferred: supply credentials via environment variables (
,IMAP_HOST
,IMAP_PORT
,IMAP_USERNAME
) so no file on disk is read at all.IMAP_PASSWORD - When a config file is used, it should contain only the
fields listed above. The script reads only those four fields and nothing else from the file.email - The only external connection made is to the IMAP server declared in
/IMAP_HOST
. No other endpoints are contacted.email.imapHost - Credentials are used solely to authenticate the IMAP session and are not logged or stored elsewhere by this skill.
When to use
- User asks "check my Gmail", "summarize my emails", "邮件摘要"
- Cron trigger message contains "gmail_digest"
Workflow
-
Run the fetch script via exec tool:
(replace {workspace} with your actual workspace root)python {workspace}/skills/gmail-summarize/scripts/fetch_unseen.py -
Parse the JSON array. Each item has: sender, subject, date, body
-
For each email compose one line:
[date] sender | subject — one-sentence body summary -
Send the full digest via MessageTool in this format:
📬 邮件摘要 (N封,覆盖 MM/DD–MM/DD)
• [日期] 发件人 | 主题 — 一句话摘要 • [日期] 发件人 | 主题 — 一句话摘要 ...
-
If result is empty, send: 📭 近两日暂无未读邮件
Output Rules
- Send the digest message ONLY. Do NOT add any extra comments, greetings, explanations, or follow-up questions before or after the digest.
- Do NOT say things like "主人,以下是您的邮件摘要" or "如需了解详情请告知" etc.
- The digest message itself is the complete and final response.
- The one-sentence body summary MUST be translated into Chinese. Sender names and subjects should keep their original text as-is.