Todoist Due-Today Email Drafts
Config — read before starting
Read ../config/user.json (resolves to ~/executive-assistant-skills/config/user.json).
Extract and use throughout:
primary_email, work_email — Gmail accounts
whatsapp — for notification delivery
workspace — absolute path to OpenClaw workspace
signature — email signature
Debug Logging (MANDATORY)
Read ../config/DEBUG_LOGGING.md for the full convention. Use python3 {user.workspace}/scripts/skill_log.py todoist-due-drafts <level> "<message>" ['<details>'] at every key step. Log BEFORE and AFTER every external call (todoist-cli, gog, mcporter). On any error, log the full command and stderr before continuing.
Steps
1. Get today's due tasks from Todoist
source {user.workspace}/.env
todoist-cli today --json
Also check overdue tasks:
todoist-cli list --filter "overdue" --json
2. Identify email/ping tasks
Filter for tasks whose content matches outreach intent:
- Keywords:
ping, email, follow up, follow-up, send, reach out, text, message, intro, connect, check in, nudge, reply, respond, draft
- Pattern: any task that implies sending a communication to a specific person
Skip tasks that are clearly NOT outreach (e.g. "review doc", "read report", "build proposal").
3. For each outreach task, draft the email
Read and follow ~/executive-assistant-skills/email-drafting/SKILL.md for all drafting rules.
For each task:
Identify the recipient: Extract person/company name from task content + description
Pull meeting context (if available): If the task description references a meeting name, date, or was created by the action-items cron (check for Granola citation links or meeting metadata in description), retrieve the transcript via Granola/Grain. If no meeting reference exists in the task, skip directly to step 3 — draft from email history and task content alone.
# Find the meeting in Granola
mcporter call granola list_meetings --args '{"time_range": "custom", "custom_start": "<meeting-date>", "custom_end": "<meeting-date+1>"}'
# Query for what was discussed with this person
mcporter call granola query_granola_meetings --args '{"query": "What did {user.name} discuss with <recipient> and what did he promise or commit to do?", "document_ids": ["<meeting_id>"]}'
Then cross-check with Grain for the full transcript:
mcporter call grain.list_attended_meetings --args '{}'
# Note: Grain's schema does not support `start_date`/`end_date` filters. Call with empty args and filter the results manually by `start_datetime` to match the meeting date range.
mcporter call grain.fetch_meeting_transcript --args '{"meeting_id": "<grain_meeting_id>"}'
When meeting context is available, the email draft must reflect what was actually said — not just the task title. Look for: specific commitments, timelines discussed, names/projects mentioned, tone of the conversation, and any docs/links promised.
Search email history: Find the latest thread with this person across both Gmail accounts to get context, their email address, and the right account to reply from. If no prior thread exists with this recipient, default to {user.work_email} for professional/business contacts or {user.primary_email} for personal contacts. When ambiguous, use {user.work_email}.
Determine email type: follow-up, ping/check-in, intro, send-doc, etc.
Draft the email: Create a Gmail draft on the correct account (the one with the existing thread). If it's a reply, use --thread-id to keep it in the same thread.
Use all context together: Combine the meeting transcript (what was actually discussed), task description, and email history to write a specific, contextual draft. Never write generic follow-ups — reference concrete topics from the conversation.
Draft rules
- Mirror the language of the existing thread (English or Spanish)
- Keep it short — these are follow-ups and pings, not essays
- Sign with
{user.signature}
- If the task says "ping" or "check in" — write a brief, friendly nudge
- If the task says "send [thing]" — draft the email with the attachment reference (or attach if path is known)
- If the task says "intro" — follow intro format from email-drafting skill
- If recipient email can't be found — report it, don't skip silently
4. Notify via WhatsApp
Send a single WhatsApp message to {user.whatsapp} with:
📬 *Due-today drafts*
<N> email drafts created from today's Todoist tasks:
1. **<recipient>** — <one-line intent> (draft in <account>)
2. ...
Review and send when ready.
If tasks exist but none are outreach-type, report:
📋 *Due-today tasks (no drafts needed)*
<list of today's tasks — quick reference>
If no tasks due today → NO_REPLY (skip notification entirely).
5. Infrastructure
python3 {user.workspace}/scripts/cron_canary.py ping todoist-due-drafts
Error handling
- If
todoist-cli fails: notify via WhatsApp "⚠️ Todoist due-drafts failed: ", ping canary, exit.
- If Granola/Grain lookup fails for a task: continue without meeting context — draft from email history + task content only.
- If Gmail draft creation fails for one task: continue with remaining tasks, report failures in the notification.
- If no
.env file or token expired: report "⚠️ Todoist token unavailable — check agent-secrets lease" and exit.
Rules
- Don't complete the tasks — just draft and notify. User decides when to send.
- Before drafting, check if user already replied:
gog --account <account> --no-input gmail search "to:<recipient> in:sent newer_than:14d" --json. If recent sent mail exists in the same thread, skip drafting and note "already replied" in the notification.
- Check for existing drafts before creating:
gog --account <account> --no-input gmail drafts --json. If a draft already exists for the same thread (matching thread ID or recipient + subject), skip and note "draft already exists."
- Overdue outreach tasks get a ⚠️ prefix in the notification.
Overview
Scans Todoist for due and overdue tasks that involve outreach (pinging, emailing, following up), auto-drafts contextual emails using meeting transcripts and email history, and notifies via WhatsApp.
Prerequisites
todoist-cli installed with valid API token in workspace .env
gog CLI configured with both Gmail accounts
mcporter with Granola and Grain MCP connections for meeting context lookup
- WhatsApp delivery endpoint configured in
user.json
- OpenClaw workspace with
skill_log.py and cron_canary.py scripts
Instructions
See the Steps section above (Steps 1 through 5) for the full execution workflow.
Output
- Gmail drafts created on the appropriate account for each outreach task
- A single WhatsApp notification summarizing all drafts created, or a task list if no drafts were needed
- NO_REPLY if no tasks are due today
Examples
# The skill runs todoist-cli to find due tasks, identifies outreach items,
# pulls meeting context from Granola/Grain, drafts emails via gog, and notifies.
# Example WhatsApp output:
# "2 email drafts created from today's Todoist tasks:
# 1. Sarah Chen — follow-up on advisory scope (draft in work account)
# 2. David Park — intro to Marcos (draft in personal account)"
Resources
Source: jeremylongshore/claude-code-plugins-plus-skills → skills/.curated/todoist-due-drafts/SKILL.md
Also appears in: jeremylongshore/claude-code-plugins-plus-skills/plugins/business-tools/executive-assistant-skills/skills/todoist-due-drafts/SKILL.md
1---
2name: todoist-due-drafts
3description: "Check Todoist for tasks due today (and overdue) that involve pinging, emailing, or following up with someone. Auto-draft the emails using meeting context and notify via WhatsApp. Use when running the daily due-drafts cron, or when user asks to process email tasks from Todoist."
4allowed-tools: "Read, Bash(gog:*), Bash(mcporter:*), Bash(todoist-cli:*), Bash(python3:*), Bash(source:*), Glob, Grep, Write"
5category: general-purpose
6source_repo: jeremylongshore/claude-code-plugins-plus-skills
7source_path: "skills/.curated/todoist-due-drafts/SKILL.md"
8source_url: https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/HEAD/skills/.curated/todoist-due-drafts/SKILL.md
9metadata:
10 source: https://skillmd.com/skills/thedixitjain/todoist-due-drafts
11---
12
13# Todoist Due-Today Email Drafts
14
15## Config — read before starting
16
17Read `../config/user.json` (resolves to `~/executive-assistant-skills/config/user.json`).
18Extract and use throughout:
19
20- `primary_email`, `work_email` — Gmail accounts
21- `whatsapp` — for notification delivery
22- `workspace` — absolute path to OpenClaw workspace
23- `signature` — email signature
24
25## Debug Logging (MANDATORY)
26
27Read `../config/DEBUG_LOGGING.md` for the full convention. Use `python3 {user.workspace}/scripts/skill_log.py todoist-due-drafts <level> "<message>" ['<details>']` at every key step. Log BEFORE and AFTER every external call (todoist-cli, gog, mcporter). On any error, log the full command and stderr before continuing.
28
29## Steps
30
31### 1. Get today's due tasks from Todoist
32
33```bash
34source {user.workspace}/.env
35todoist-cli today --json
36```
37
38Also check overdue tasks:
39
40```bash
41todoist-cli list --filter "overdue" --json
42```
43
44### 2. Identify email/ping tasks
45
46Filter for tasks whose content matches outreach intent:
47
48- Keywords: `ping`, `email`, `follow up`, `follow-up`, `send`, `reach out`, `text`, `message`, `intro`, `connect`, `check in`, `nudge`, `reply`, `respond`, `draft`
49- Pattern: any task that implies sending a communication to a specific person
50
51Skip tasks that are clearly NOT outreach (e.g. "review doc", "read report", "build proposal").
52
53### 3. For each outreach task, draft the email
54
55Read and follow `~/executive-assistant-skills/email-drafting/SKILL.md` for all drafting rules.
56
57For each task:
58
591. **Identify the recipient**: Extract person/company name from task content + description
602. **Pull meeting context (if available)**: If the task description references a meeting name, date, or was created by the action-items cron (check for Granola citation links or meeting metadata in description), retrieve the transcript via Granola/Grain. If no meeting reference exists in the task, skip directly to step 3 — draft from email history and task content alone.
61
62 ```bash
63 # Find the meeting in Granola
64 mcporter call granola list_meetings --args '{"time_range": "custom", "custom_start": "<meeting-date>", "custom_end": "<meeting-date+1>"}'
65 # Query for what was discussed with this person
66 mcporter call granola query_granola_meetings --args '{"query": "What did {user.name} discuss with <recipient> and what did he promise or commit to do?", "document_ids": ["<meeting_id>"]}'
67 ```
68
69 Then cross-check with Grain for the full transcript:
70
71 ```bash
72 mcporter call grain.list_attended_meetings --args '{}'
73 # Note: Grain's schema does not support `start_date`/`end_date` filters. Call with empty args and filter the results manually by `start_datetime` to match the meeting date range.
74 mcporter call grain.fetch_meeting_transcript --args '{"meeting_id": "<grain_meeting_id>"}'
75 ```
76
77 When meeting context is available, the email draft must reflect what was actually said — not just the task title. Look for: specific commitments, timelines discussed, names/projects mentioned, tone of the conversation, and any docs/links promised.
783. **Search email history**: Find the latest thread with this person across both Gmail accounts to get context, their email address, and the right account to reply from. If no prior thread exists with this recipient, default to `{user.work_email}` for professional/business contacts or `{user.primary_email}` for personal contacts. When ambiguous, use `{user.work_email}`.
794. **Determine email type**: follow-up, ping/check-in, intro, send-doc, etc.
805. **Draft the email**: Create a Gmail draft on the correct account (the one with the existing thread). If it's a reply, use `--thread-id` to keep it in the same thread.
816. **Use all context together**: Combine the meeting transcript (what was actually discussed), task description, and email history to write a specific, contextual draft. Never write generic follow-ups — reference concrete topics from the conversation.
82
83#### Draft rules
84
85- Mirror the language of the existing thread (English or Spanish)
86- Keep it short — these are follow-ups and pings, not essays
87- Sign with `{user.signature}`
88- If the task says "ping" or "check in" — write a brief, friendly nudge
89- If the task says "send [thing]" — draft the email with the attachment reference (or attach if path is known)
90- If the task says "intro" — follow intro format from email-drafting skill
91- If recipient email can't be found — report it, don't skip silently
92
93### 4. Notify via WhatsApp
94
95Send a single WhatsApp message to {user.whatsapp} with:
96
97```
98📬 *Due-today drafts*
99
100<N> email drafts created from today's Todoist tasks:
101
1021. **<recipient>** — <one-line intent> (draft in <account>)
1032. ...
104
105Review and send when ready.
106```
107
108If tasks exist but none are outreach-type, report:
109
110```
111📋 *Due-today tasks (no drafts needed)*
112
113<list of today's tasks — quick reference>
114```
115
116If no tasks due today → NO_REPLY (skip notification entirely).
117
118### 5. Infrastructure
119
120```bash
121python3 {user.workspace}/scripts/cron_canary.py ping todoist-due-drafts
122```
123
124## Error handling
125
126- If `todoist-cli` fails: notify via WhatsApp "⚠️ Todoist due-drafts failed: <error>", ping canary, exit.
127- If Granola/Grain lookup fails for a task: continue without meeting context — draft from email history + task content only.
128- If Gmail draft creation fails for one task: continue with remaining tasks, report failures in the notification.
129- If no `.env` file or token expired: report "⚠️ Todoist token unavailable — check agent-secrets lease" and exit.
130
131## Rules
132
133- Don't complete the tasks — just draft and notify. User decides when to send.
134- Before drafting, check if user already replied: `gog --account <account> --no-input gmail search "to:<recipient> in:sent newer_than:14d" --json`. If recent sent mail exists in the same thread, skip drafting and note "already replied" in the notification.
135- Check for existing drafts before creating: `gog --account <account> --no-input gmail drafts --json`. If a draft already exists for the same thread (matching thread ID or recipient + subject), skip and note "draft already exists."
136- Overdue outreach tasks get a ⚠️ prefix in the notification.
137
138## Overview
139
140Scans Todoist for due and overdue tasks that involve outreach (pinging, emailing, following up), auto-drafts contextual emails using meeting transcripts and email history, and notifies via WhatsApp.
141
142## Prerequisites
143
144- `todoist-cli` installed with valid API token in workspace `.env`
145- `gog` CLI configured with both Gmail accounts
146- `mcporter` with Granola and Grain MCP connections for meeting context lookup
147- WhatsApp delivery endpoint configured in `user.json`
148- OpenClaw workspace with `skill_log.py` and `cron_canary.py` scripts
149
150## Instructions
151
152See the Steps section above (Steps 1 through 5) for the full execution workflow.
153
154## Output
155
156- Gmail drafts created on the appropriate account for each outreach task
157- A single WhatsApp notification summarizing all drafts created, or a task list if no drafts were needed
158- NO_REPLY if no tasks are due today
159
160## Examples
161
162```bash
163# The skill runs todoist-cli to find due tasks, identifies outreach items,
164# pulls meeting context from Granola/Grain, drafts emails via gog, and notifies.
165# Example WhatsApp output:
166# "2 email drafts created from today's Todoist tasks:
167# 1. Sarah Chen — follow-up on advisory scope (draft in work account)
168# 2. David Park — intro to Marcos (draft in personal account)"
169```
170
171## Resources
172
173- [Todoist REST API](https://developer.todoist.com/rest/v2/)
174- [Gmail API](https://developers.google.com/gmail/api)
175- [Granola API](https://granola.ai/docs)
176- Grain API
177
178---
179
180**Source:** [`jeremylongshore/claude-code-plugins-plus-skills`](https://github.com/jeremylongshore/claude-code-plugins-plus-skills) → `skills/.curated/todoist-due-drafts/SKILL.md`
181
182**Also appears in:** `jeremylongshore/claude-code-plugins-plus-skills/plugins/business-tools/executive-assistant-skills/skills/todoist-due-drafts/SKILL.md`