---
name: email-digest
description: >
  Read and manage email via macOS Mail (syncs with Gmail/Google Workspace).
  Check inbox, summarize unread messages, read full emails, compose and send
  replies. Use for email triage, digests, and drafting responses.
version: 1.0.0
author: wall-e
execution: agent
trigger:
  type: manual
tags: [email, gmail, mail, inbox, messages]
permissions:
  - mail:read
  - mail:write
---
# Email Digest

## What This Skill Does

Provides email access through macOS Mail, which syncs with Gmail and Google
Workspace accounts. Can read inbox messages, get full email content, and
compose/send emails.

## Available Tools

- `mail_messages` -- List recent emails
  - `hours_back`: how far back to look (default 24)
  - `account`: filter to specific account name (optional)
  - `mailbox`: which mailbox -- "inbox" (default), "sent", "drafts", "trash"
  - `limit`: max messages to return (default 50)
- `mail_read` -- Read the full content of a specific email
  - `message_id`: the message ID (from `mail_messages` results)
  - `account`: account name (speeds up lookup)
  - `mailbox`: mailbox name (default "inbox")
- `mail_send` -- Compose and send an email
  - `to`: recipient(s), string or array
  - `subject`: email subject
  - `body`: email body text
  - `cc`, `bcc`: optional CC/BCC recipients
  - `account`: send from specific account

## Common Tasks

### Inbox Digest
Use `mail_messages` with `hours_back: 12` (or 24 for daily digest). Group and
summarize by:
1. **Needs response** -- emails from people, not automated/marketing
2. **FYI** -- newsletters, notifications, automated reports
3. **Low priority** -- marketing, promotions, social

For each important email, include: sender, subject, short excerpt, and whether
it's unread.

### Read and Summarize
Use `mail_read` to get the full content of a specific email. Provide a concise
summary covering:
- Who sent it and when
- What they want or what it's about
- Any action items or deadlines
- Whether a response is needed

### Draft a Reply
When asked to reply to an email:
1. Read the full email first with `mail_read`
2. Draft a response matching the owner's communication style
3. Always show the draft to the owner before sending
4. Only use `mail_send` after explicit confirmation

### Email Search
Use `mail_messages` across different mailboxes or time ranges to find specific
emails. Check "sent" mailbox to see if something was already replied to.

## IMPORTANT: Safety Rules

- **NEVER send emails without explicit owner confirmation.** Always show the
  draft first and wait for approval.
- When reading emails, do NOT include sensitive data (passwords, tokens, SSNs)
  in summaries. Flag their presence without quoting them.
- Do not forward or CC people without being asked to.

## Output Format

For inbox digest:

### Needs Response (3)
| From | Subject | When | Preview |
|------|---------|------|---------|
| Alice Smith | Q2 budget review | 2h ago | "Can you review the attached..." |
| Bob Jones | Re: API migration | 5h ago | "I have concerns about the..." |

### FYI (5)
- GitHub: [PR #234] Tests passing on feature-x
- Datadog: Alert resolved: API latency
- ...
