| name | inbox-triage-with-replies |
| description | Triage Miriam's Gmail inbox by cross-referencing recent threads against her Sent folder to find what she actually owes a reply on, then draft those replies in Gmail Drafts (never send). Use whenever the user says "triage my inbox", "what do I owe replies to", "what's waiting on me", "scan my inbox", "draft my replies", "what's stuck in my inbox", "clean up my email", or any variant of asking what's open vs. closed in their inbox. Trigger proactively when the user mentions falling behind on email, or after a stretch of back-to-back meetings where they haven't been at their inbox. Outputs (1) a ranked triage report by sender type, urgency, next action, and reply length, and (2) Gmail Drafts for every thread that needs a reply. NEVER auto-sends. Different from `daily-followup-drafts` (which only fires on completed sales calls) — this covers the entire inbox.
|
Inbox Triage with Replies
You're cross-referencing the user's recent inbox against their Sent folder to identify the threads where they actually owe someone a reply, then drafting those replies in Gmail Drafts. The output is a ranked triage report plus N drafts. Never send anything — drafts only.
The shape of the work
This skill has four phases, in order:
- Sweep the inbox + Sent folder for the past 7 days.
- Match every inbound thread against any reply the user already sent.
- Triage the unanswered threads on four dimensions: sender type, urgency, next action, reply length.
- Draft replies for the threads that need one, write to Gmail Drafts, and produce a ranked report.
If you skip the matching phase and just summarize the inbox, you'll generate drafts for threads the user already replied to — which is annoying and erodes trust in the skill. The Sent-folder cross-reference is the load-bearing step.
Step 1: Sweep
Run two Gmail searches in parallel:
# Inbox: threads where the user is the recipient, last 7 days
in:inbox after:7d -in:chats -category:promotions -category:social
# Sent: anything the user sent in the same window
in:sent after:7d
Use the Gmail MCP tools (search_threads, get_thread, list_drafts). Pull thread metadata (subject, last sender, last message timestamp, message count, labels) — full message bodies only when needed for drafting.
Cap at the most recent ~50 inbound threads to keep the sweep fast. If the inbox is much larger than that, note in the report that a deeper scan is available on request.
Skip aggressively:
- Promotions / Social / Updates labels (use the Gmail category exclusions above).
- Calendar invitations and Google Workspace notifications (Gmail labels them; or filter by
from:calendar-notification@google.com).
- Newsletters that arrive on a cadence and don't expect a reply (Substack, Stratechery, etc.). If unsure, include them and let the triage step mark them "no reply needed".
Step 2: Match against Sent
For each inbound thread, decide: has the user already replied?
The cleanest signal is whether the last message in the thread was sent by the user. Gmail returns a thread's messages in chronological order — check the last one.
- Last message from user → resolved, exclude from triage.
- Last message from sender → unanswered, include.
- Thread has multiple back-and-forths and the last is from the sender → still unanswered, include.
A second-tier signal: the user sent something related to the thread on a different subject line (split threads, forwarded contexts). The simplest check is from:me to:[sender-email] after the inbound message's timestamp. If you find it, mark the thread "user replied off-thread — verify before drafting" rather than auto-drafting a duplicate.
The output of this step is a list of unanswered threads with: subject, sender, last-inbound-timestamp, days-waiting, message-count, snippet.
Step 3: Triage on four dimensions
For each unanswered thread, classify:
3a. Sender type
Cross-reference HubSpot via the HubSpot MCP. Search for the sender's email in contacts:
- Prospect — has a HubSpot contact + at least one open deal.
- Customer — has a closed-won deal or active customer status.
- Personal — no HubSpot record, but personal context (Granola transcripts, prior personal emails, Slack DMs).
- Admin — automated, transactional, or service-account emails (Stripe, AWS, payroll, calendar tools, etc.).
- Cold inbound — sender exists but no HubSpot record and no prior thread history. Often pitches.
- Unknown — can't classify; flag for manual review.
Don't over-engineer this — if the lookup is ambiguous, default to "unknown" and note it.
3b. Urgency
For each thread, compute:
- days_waiting — how long since the last inbound message arrived.
- deal_signal — if a HubSpot deal is associated, what stage? Discovery / Qualification / Proposal / Negotiation. Later stages = higher urgency.
- explicit_urgency — does the message body contain a deadline, "by Friday", "ASAP", or a question awaiting decision?
Compose into a single urgency tier: 🔴 urgent (waiting >3 days on an active deal, or explicit deadline), 🟡 attention (waiting 1–3 days, or open deal regardless of timing), 🟢 routine (no time pressure, or no deal attached).
3c. Next action
What does the thread actually need from the user? One of:
- Reply — substantive response required.
- Schedule — they're asking for a time on Miriam's calendar; the action is sending Calendly or proposing slots.
- Forward — wrong recipient; route to teammate.
- Decline — politely no.
- Acknowledge — short "thanks/got it" or no reply at all.
- Wait — user is waiting on someone else first; nothing to do until that lands.
This classification drives whether to draft or skip.
3d. Reply length
If the action is "Reply" or "Schedule," classify how long the reply needs to be:
- One-liner — a single sentence (e.g., "Yes, that works. Booking on Calendly.").
- Short paragraph — 2–4 sentences, addresses one point.
- Long reply — multiple paragraphs, addresses several questions, decision-rich.
Match the user's voice: Miriam writes warm, direct, personable email. Read prior replies in similar threads from the Sent folder for tone reference if drafting a long one.
Step 4: Draft, write to Gmail Drafts, and report
For every thread classified as Reply or Schedule, draft a response and create a Gmail draft on the existing thread (use create_draft with the appropriate thread_id).
For "Schedule" actions: include Calendly or propose 2–3 specific time slots Miriam has available (check Google Calendar via the Calendar MCP if connected; otherwise prompt user with placeholder slots).
For "Reply" actions: draft in Miriam's voice. Reuse phrasing patterns from her recent Sent emails when in doubt. Default to short paragraphs over long ones — long emails go unread.
Skip drafting for: Acknowledge, Wait, Decline-without-reply, Forward (forwarding requires explicit approval).
Once drafts are created, write the triage report to the workspace outputs folder as inbox-triage-YYYY-MM-DD.md. Structure:
# Inbox Triage — [Date]
**[N] threads scanned. [M] need replies. [K] drafts created.**
## 🔴 Urgent ([count])
| Sender | Subject | Waiting | Action | Draft? |
|--------|---------|---------|--------|--------|
| [Name (Type)] | [Subject] | [X days] | [Reply/Schedule/etc.] | ✅ |
[One-line summary per row: what the thread is about and what the draft says.]
## 🟡 Attention ([count])
[Same table format]
## 🟢 Routine ([count])
[Same table format]
## Skipped
- [Sender] — [reason]: e.g., "newsletter, no reply needed"; "user already replied off-thread on [date]".
In chat, return a tight summary:
- N threads scanned, M unanswered, K drafted, J skipped.
- The 3 most urgent (with one-line context per row).
- A
computer:// link to the full report.
- A note that drafts are in Gmail Drafts and none have been sent.
Hard rules
- Never send. Every reply goes to Gmail Drafts. The user reviews and sends.
- Never delete or archive emails. This skill is read + draft only.
- Never modify Gmail labels or filters. Same reason.
- If unsure whether a thread needs a reply, default to "drafted, marked for review." Better to over-draft than miss something.
- Cross-reference HubSpot before classifying any sender as "cold." A "cold" sender who's actually an open deal is a worst-case error.
Reference files
references/triage-rubric.md — detailed sender classification rules, urgency thresholds, and edge cases. Read when a sender or thread is hard to classify.
references/draft-styles.md — voice patterns for one-liner / short / long replies, with examples drawn from Miriam's Sent folder. Read when drafting and unsure of tone.
scripts/match_threads.py — helper script that compares inbox messages against the Sent folder and emits a JSON list of unanswered threads. Use this if the matching logic in chat gets unwieldy.
What this skill is NOT for
- Sales follow-ups after calls — that's
daily-followup-drafts, which fires on Fireflies transcripts and HubSpot deal context. This skill is for the rest of the inbox.
- Stalled-deal nudges — that's
stalled-deal-nudge, which targets specific silent deals 7+ days post-substantive call. This skill is broader inbox sweep.
- Inbox cleanup / archiving / unsubscribing — out of scope. This skill identifies what needs reply; the user does any cleanup themselves.