morning-email-rollup
Daily morning rollup of important emails and calendar events at 8am with AI-generated summaries
What this skill does
# Morning Email Rollup Automatically generates a daily summary of important emails and delivers it to Telegram at 8am Denver time. ## Setup **Required:** Set your Gmail account email: ```bash export GOG_ACCOUNT="[email protected]" ``` Or edit the script directly to set the default. ## What It Does - Runs every day at 8:00 AM (configurable timezone) - **Shows today's calendar events** from Google Calendar - Searches for emails marked as **important** or **starred** from the last 24 hours - Uses AI (Gemini CLI) to generate natural language summaries of each email - Shows up to 20 most important emails with: - ๐ด Unread indicator (red) - ๐ข Read indicator (green) - Sender name/email - Subject line - **AI-generated 1-sentence summary** (natural language, not scraped content) - Delivers formatted summary to Telegram ## Usage ### Manual Run ```bash # Default (10 emails) bash skills/morning-email-rollup/rollup.sh # Custom number of emails MAX_EMAILS=20 bash skills/morning-email-rollup/rollup.sh MAX_EMAILS=5 bash skills/morning-email-rollup/rollup.sh ``` ### View Log ```bash cat $HOME/clawd/morning-email-rollup-log.md ``` ## How It Works 1. **Checks calendar** - Lists today's events from Google Calendar via `gog` 2. **Searches Gmail** - Query: `is:important OR is:starred newer_than:1d` 3. **Fetches details** - Gets sender, subject, date, and body for each email 4. **AI Summarization** - Uses Gemini CLI to generate natural language summaries 5. **Formats output** - Creates readable summary with read/unread markers 6. **Sends to Telegram** - Delivers via Clawdbot's messaging system ## Calendar Integration The script automatically includes today's calendar events from your Google Calendar using the same `gog` CLI that queries Gmail. **Graceful Fallback:** - If `gog` is not installed โ Calendar section is silently skipped (no errors) - If no events today โ Calendar section is silently skipped - If events exist โ Shows formatted list with 12-hour times and titles **Requirements:** - `gog` must be installed and authenticated - Uses the same Google account configured for Gmail (set via `GOG_ACCOUNT` environment variable) ## Email Criteria Emails are included if they match **any** of: - Marked as **Important** by Gmail (lightning bolt icon) - Manually **Starred** by you - Received in the **last 24 hours** ## AI Summarization Each email is summarized using the Gemini CLI (`gemini`): - Extracts the email body (cleans HTML/CSS) - Sends to `gemini --model gemini-2.0-flash` with a prompt to summarize in 1 sentence - The summary is medium-to-long length natural language (not scraped content) - Falls back to cleaned body text if Gemini is unavailable **Important:** The email body is passed as part of the prompt (not via stdin) because the gemini CLI doesn't handle piped input with prompts correctly. **Example output:** ``` ๐ด **William Ryan: Invitation to team meeting** The email invites you to a team meeting tomorrow at 2pm to discuss the Q1 roadmap and assign tasks for the upcoming sprint. ``` ## Read/Unread Indicators - ๐ด Red dot = Unread email - ๐ข Green dot = Read email All emails show one of these markers for visual consistency. ## Formatting Notes **Subject and Summary Cleanup:** - Extra quotes are automatically stripped from subject lines (e.g., `""Agent Skills""` โ `Agent Skills`) - Summaries from Gemini are also cleaned of leading/trailing quotes - This ensures clean, readable output in Telegram/other channels ## Cron Schedule Set up a daily cron job at your preferred time: ```bash cron add --name "Morning Email Rollup" \ --schedule "0 8 * * *" \ --tz "America/Denver" \ --session isolated \ --message "[email protected] bash /path/to/skills/morning-email-rollup/rollup.sh" ``` Adjust the time (8:00 AM) and timezone to your preference. ## Customization ### Change Number of Emails By default, the rollup shows **10 emails**. To change this: **Temporary (one-time):** ```bash MAX_EMAILS=20 bash skills/morning-email-rollup/rollup.sh ``` **Permanent:** Edit `skills/morning-email-rollup/rollup.sh`: ```bash MAX_EMAILS="${MAX_EMAILS:-20}" # Change 10 to your preferred number ``` ### Change Search Criteria Edit `skills/morning-email-rollup/rollup.sh`: ```bash # Current: important or starred from last 24h IMPORTANT_EMAILS=$(gog gmail search 'is:important OR is:starred newer_than:1d' --max 20 ...) # Examples of other searches: # Unread important emails only IMPORTANT_EMAILS=$(gog gmail search 'is:important is:unread newer_than:1d' --max 20 ...) # Specific senders IMPORTANT_EMAILS=$(gog gmail search 'from:[email protected] OR from:[email protected] newer_than:1d' --max 20 ...) # By label/category IMPORTANT_EMAILS=$(gog gmail search 'label:work is:important newer_than:1d' --max 20 ...) ``` ### Change Time Update the cron schedule: ```bash # List cron jobs to get the ID cron list # Update schedule (example: 7am instead of 8am) cron update <job-id> --schedule "0 7 * * *" --tz "America/Denver" ``` ### Change Summary Style Edit the prompt in the `summarize_email()` function in `rollup.sh`: ```bash # Current: medium-to-long 1 sentence "Summarize this email in exactly 1 sentence of natural language. Make it medium to long length. Don't use quotes:" # Shorter summaries "Summarize in 1 short sentence:" # More detail "Summarize in 2-3 sentences with key details:" ``` ### Change AI Model Edit the gemini command in `summarize_email()`: ```bash # Current: gemini-2.0-flash (fast) gemini --model gemini-2.0-flash "Summarize..." # Use a different model gemini --model gemini-pro "Summarize..." ``` ## Troubleshooting ### Not receiving rollups ```bash # Check if cron job is enabled cron list # Check last run status cron runs <job-id> # Test manually bash skills/morning-email-rollup/rollup.sh ``` ### Missing emails - Gmail's importance markers may filter out expected emails - Check if emails are actually marked important/starred in Gmail - Try running manual search: `gog gmail search 'is:important newer_than:1d'` ### Summaries not appearing - Check if `gemini` CLI is installed: `which gemini` - Test manually: `echo "test" | gemini "Summarize this:"` - Verify Gemini is authenticated (it should prompt on first run) ### Wrong timezone - Cron uses `America/Denver` (MST/MDT) - Update with: `cron update <job-id> --tz "Your/Timezone"` ## Log History All rollup runs are logged to: ``` $HOME/clawd/morning-email-rollup-log.md ``` Format: ```markdown - [2026-01-15 08:00:00] ๐ Starting morning email rollup - [2026-01-15 08:00:02] โ Rollup complete: 15 emails ```
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit โ setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard โ shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.