| name | daily-email-report |
| description | Generate a readable daily email report. Use when the user asks for a "daily email report", "summarize my inbox", "what came in today", "morning email digest", or similar. Runs the gmail-summarizer pipeline (which also creates Google Tasks), then reads the JSON summaries log it produces and writes a human-friendly daily_summary_report/report_<date>.md.
|
| allowed-tools | ["Bash","Read","Write","Glob"] |
Daily Email Report
Turn the gmail-summarizer's machine output into a report a human actually wants
to read over coffee. This skill is a thin orchestration layer on top of an
existing tool — it runs summarize_emails.py, then reformats the JSON log
that script writes. It does not re-summarize emails or call any LLM API; the
local model work already happened inside the script.
What the underlying script does (don't fight it)
email-summarizer/summarize_emails.py <hours> fetches recent unread Primary
emails, triages each with a local model, extracts action items, creates one
Google Task per action item, and writes everything that survived the
exclusion filters to summaries_log/summaries_<date>.json.
Task creation is that script's own separate workflow. Let it run normally —
do not suppress task creation unless the user explicitly asks for a
report-only / no-tasks run (in which case append --dry-run; the script still
writes the summaries log in dry-run mode).
Steps
1. Pick the look-back window
Default to 24 hours. If the user named a window ("last 3 days", "since
yesterday", "12 hours"), convert it to whole hours and use that.
2. Run the pipeline
From the gmail-summarizer/ root (uv auto-syncs the venv):
uv run python email-summarizer/summarize_emails.py <hours>
Add --dry-run only if the user asked not to create tasks.
Let it finish. It may take a while (one or two local-model calls per email) and
will print progress per message — that's expected, not an error. If it exits
non-zero, surface the error (common causes: Ollama not running, TASKLIST_ID
unset, OAuth token expired) and stop; there's no report to write.
3. Locate the summaries log
The script prints its exact output path on the last lines, e.g.:
Summaries log: .../gmail-summarizer/summaries_log/summaries_2026-05-26.json
Read that path (don't guess the date — the script's date is authoritative).
If you must find it yourself, glob summaries_log/summaries_*.json and take the
newest. Read the JSON. Its shape:
{
"date": "2026-05-26",
"email_count": 7,
"actionable_count": 3,
"emails": [
{
"message_id": "...", "thread_id": "...",
"from": "Sarah <sarah@acme.com>", "subject": "Q3 budget review",
"received": "Mon, 26 May 2026 09:14:00 -0700",
"link": "https://mail.google.com/mail/u/0/#inbox/...",
"actionable": true,
"summary": "Two-sentence summary of the email.",
"action_items": ["Reply to Sarah about Q3 budget by Friday"],
"logged_at": "2026-05-26T17:45:00"
}
]
}
If emails is empty, tell the user there was nothing to report for that window
and stop — don't write an empty report file.
4. Write the report
Create daily_summary_report/report_<date>.md using the same <date> as
the log file. Group the emails:
- Needs your attention — every email with
action_items. Lead with the
subject, then sender + Gmail link, the summary, then each action item as a
markdown checkbox - [ ].
- FYI — no action needed — emails where
actionable is false (and any
actionable: true with an empty action_items list). One compact line each:
subject, sender, link.
Use this structure (adapt counts/content; keep it skimmable):
# Daily Email Report — {date}
_{email_count} emails reviewed · {actionable_count} need action · look-back {hours}h_
## ⚡ Needs your attention
### {subject}
**From:** {from} · [Open in Gmail]({link})
{summary}
- [ ] {action item}
- [ ] {action item}
---
## 📭 FYI — no action needed
- **{subject}** — {from} · [open]({link})
Writing guidance: keep your own prose minimal — the summaries are already
written. Don't invent details that aren't in the JSON. Don't restate every
field; a reader wants subjects, the gist, and what to do next. If there are no
"needs attention" items, say so plainly and keep the FYI list.
5. Report back
Tell the user the report path and give a one-line headline (e.g. "7 emails, 3
need action — top item: reply to Sarah on Q3 budget by Friday"). Offer to print
the full report inline.
Notes
- Re-running on the same day is safe: the script merges into the same
summaries_<date>.json (dedupe by message id, latest run wins), so a later
report reflects the whole day.
- Both
summaries_log/ and daily_summary_report/ are gitignored — they hold
real inbox content. Never commit them or paste their contents anywhere external.