$npx -y skills add AgriciDaniel/claude-email --skill email-checkIntelligent inbox triage that connects to Gmail or Outlook, scores emails by importance (0-100) using sender recognition, urgency keywords, thread depth, time sensitivity, and business relevance, categorizes into Urgent/Important/Routine/Archive, and generates reply suggestions f
| 1 | # Email Check Sub-Skill |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | This sub-skill handles intelligent inbox triage by connecting to Gmail or Outlook via MCP, analyzing unread emails, scoring them by importance, categorizing them, and generating reply suggestions for high-priority items. |
| 6 | |
| 7 | ## Workflow |
| 8 | |
| 9 | ### 1. Detect Available Email Provider |
| 10 | |
| 11 | Check which MCP tools are available: |
| 12 | - **Gmail**: `search_gmail_messages`, `get_gmail_messages_content_batch`, `get_gmail_thread_content`, `list_gmail_labels` |
| 13 | - **Outlook**: `list-mail-messages`, `list-mail-folder-messages`, `get-mail-message` |
| 14 | |
| 15 | Prefer Gmail if both are available (better batch operations). |
| 16 | |
| 17 | ### 2. Fetch Unread Emails |
| 18 | |
| 19 | **For Gmail:** |
| 20 | ``` |
| 21 | search_gmail_messages(query="is:unread", max_results=50) |
| 22 | ``` |
| 23 | |
| 24 | **For Outlook:** |
| 25 | ``` |
| 26 | list-mail-messages (defaults to recent messages, filter for unread) |
| 27 | ``` |
| 28 | |
| 29 | ### 3. Batch Fetch Email Content |
| 30 | |
| 31 | **For Gmail:** |
| 32 | ``` |
| 33 | get_gmail_messages_content_batch(message_ids=[...]) # Up to 25 at a time |
| 34 | ``` |
| 35 | |
| 36 | If more than 25 unread, prioritize most recent first. |
| 37 | |
| 38 | **For Outlook:** |
| 39 | ``` |
| 40 | get-mail-message for each message (sequential) |
| 41 | ``` |
| 42 | |
| 43 | Limit to 25 emails maximum to avoid overwhelming analysis. |
| 44 | |
| 45 | ### 4. Score Each Email (0-100) |
| 46 | |
| 47 | Apply the following scoring algorithm: |
| 48 | |
| 49 | #### Base Score: 50 |
| 50 | |
| 51 | #### Sender Recognition (+20 to -20) |
| 52 | - **+20**: VIP/known contact (domain matches user's company, appears in sent folder frequently) |
| 53 | - **+10**: Recognized sender (has prior thread history) |
| 54 | - **0**: Unknown sender with legitimate domain |
| 55 | - **-15**: Newsletter/automated sender (bulk email headers, unsubscribe links) |
| 56 | - **-20**: Notification sender (no-reply@, noreply@, automated@) |
| 57 | |
| 58 | #### Direct Address (+15 to -10) |
| 59 | - **+15**: Primary recipient (To: field) |
| 60 | - **0**: CC'd (CC: field) |
| 61 | - **-10**: BCC'd or mass email (many recipients) |
| 62 | |
| 63 | #### Thread Depth (+10) |
| 64 | - **+10**: Reply in active thread (Re: subject, multiple messages in thread) |
| 65 | - **0**: New email (no thread history) |
| 66 | |
| 67 | #### Urgency Keywords (+15) |
| 68 | Check subject and first 200 characters for: |
| 69 | - urgent, ASAP, deadline, action required, immediate, time-sensitive, expiring, expires, due |
| 70 | - **+15** if any urgency keyword found |
| 71 | |
| 72 | #### Calendar/Meeting (+20) |
| 73 | - **+20**: Calendar invite, meeting request, event notification |
| 74 | - Detect via attachments (ics file) or subject patterns (Invitation:, Meeting:) |
| 75 | |
| 76 | #### Deadline Detection (+25) |
| 77 | Parse email body for dates/deadlines: |
| 78 | - **+25**: Deadline within 48 hours |
| 79 | - **+10**: Deadline within 7 days |
| 80 | - **0**: No deadline or deadline > 7 days |
| 81 | |
| 82 | #### Business Relevance (+15 to -10) |
| 83 | If `email-profile.md` exists in parent directory: |
| 84 | - **+15**: Mentions user's key topics, clients, projects |
| 85 | - **+5**: Industry-relevant keywords |
| 86 | - **-10**: Off-topic or personal (if business inbox) |
| 87 | |
| 88 | #### Final Score Calculation |
| 89 | Sum all adjustments to base score of 50. |
| 90 | Clamp to 0-100 range. |
| 91 | |
| 92 | ### 5. Categorize Emails |
| 93 | |
| 94 | Based on final score: |
| 95 | |
| 96 | | Score Range | Category | Action | |
| 97 | |-------------|----------|--------| |
| 98 | | 85-100 | **Urgent** | Immediate attention, generate reply suggestions | |
| 99 | | 65-84 | **Important** | Review soon, may need action | |
| 100 | | 40-64 | **Routine** | Normal priority, review when available | |
| 101 | | 20-39 | **Low Priority** | Skim or defer | |
| 102 | | 0-19 | **Archive** | Likely noise or automated | |
| 103 | |
| 104 | ### 6. Generate Reply Suggestions |
| 105 | |
| 106 | For emails scored 85+ (Urgent category): |
| 107 | |
| 108 | 1. **Read full thread context** using `get_gmail_thread_content` or equivalent |
| 109 | 2. **Check for email-profile.md** in parent directory for user's: |
| 110 | - Brand voice (professional, casual, direct, warm) |
| 111 | - Common sign-off |
| 112 | - Industry/role context |
| 113 | 3. **Draft two reply options:** |
| 114 | - **Brief**: 1-2 sentences, direct answer |
| 115 | - **Detailed**: 1 paragraph with context |
| 116 | |
| 117 | **Do NOT draft replies if:** |
| 118 | - Email requires research beyond available context |
| 119 | - Email needs user decision (approve/decline, choose option) |
| 120 | - Email is FYI/informational only |
| 121 | - Email is calendar invite (suggest accept/decline/tentative instead) |
| 122 | |
| 123 | In these cases, output: **"This email requires your personal attention: [reason]"** |
| 124 | |
| 125 | ### 7. Output Format |
| 126 | |
| 127 | ```markdown |
| 128 | ## Inbox Summary |
| 129 | |
| 130 | **X unread emails** | Y Urgent | Z Important | W Routine | V Low Priority |
| 131 | |
| 132 | ### Urgent (Action Required) |
| 133 | |
| 134 | | # | From | Subject | Score | Suggested Action | |
| 135 | |---|------|---------|-------|------------------| |
| 136 | | 1 | sender@domain.com | Subject line | 95 | [Reply/Review/Respond] | |
| 137 | | 2 | ... | ... | 88 | ... | |
| 138 | |
| 139 | --- |
| 140 | |
| 141 | ### Important |
| 142 | |
| 143 | | # | Fro |