Email check

From shenxingy/Clade · View interactive version

Email check is an AI agent skill from the GitHub repository shenxingy/Clade. Intelligent 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 for top priority item

How to use this skill

Skill file

Email Check Sub-Skill

Purpose

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.

Workflow

1. Detect Available Email Provider

Check which MCP tools are available:

Prefer Gmail if both are available (better batch operations).

2. Fetch Unread Emails

For Gmail:

search_gmail_messages(query="is:unread", max_results=50)

For Outlook:

list-mail-messages (defaults to recent messages, filter for unread)

3. Batch Fetch Email Content

For Gmail:

get_gmail_messages_content_batch(message_ids=[...])  # Up to 25 at a time

If more than 25 unread, prioritize most recent first.

For Outlook:

get-mail-message for each message (sequential)

Limit to 25 emails maximum to avoid overwhelming analysis.

4. Score Each Email (0-100)

Apply the following scoring algorithm:

Base Score: 50
Sender Recognition (+20 to -20)
Direct Address (+15 to -10)
Thread Depth (+10)
Urgency Keywords (+15)

Check subject and first 200 characters for:

Calendar/Meeting (+20)
Deadline Detection (+25)

Parse email body for dates/deadlines:

Business Relevance (+15 to -10)

If email-profile.md exists in parent directory:

Final Score Calculation

Sum all adjustments to base score of 50.

Clamp to 0-100 range.

5. Categorize Emails

Based on final score:

| Score Range | Category | Action |

|-------------|----------|--------|

| 85-100 | Urgent | Immediate attention, generate reply suggestions |

| 65-84 | Important | Review soon, may need action |

| 40-64 | Routine | Normal priority, review when available |

| 20-39 | Low Priority | Skim or defer |

| 0-19 | Archive | Likely noise or automated |

6. Generate Reply Suggestions

For emails scored 85+ (Urgent category):

  1. Read full thread context using get_gmail_thread_content or equivalent
  2. Check for email-profile.md in parent directory for user's:
  1. Draft two reply options:

Do NOT draft replies if:

In these cases, output: "This email requires your personal attention: [reason]"

7. Output Format

## Inbox Summary

**X unread emails** | Y Urgent | Z Important | W Routine | V Low Priority

### Urgent (Action Required)

| # | From | Subject | Score | Suggested Action |
|---|------|---------|-------|------------------|
| 1 | sender@domain.com | Subject line | 95 | [Reply/Review/Respond] |
| 2 | ... | ... | 88 | ... |

---

### Important

| # | From | Subject | Score | Category |
|---|------|---------|-------|----------|
| 3 | ... | ... | 78 | Meeting follow-up |
| 4 | ... | ... | 70 | Client inquiry |

---

### Routine & Low Priority

- **Routine (40-64)**: X emails - [grouped summary by sender/topic]
- **Low Priority (20-39)**: Y emails - newsletters, notifications
- **Archive (<20)**: Z emails - automated/noise

---

### Suggested Replies

#### 1. Re: [Subject] (to: sender@domain.com)

**Context:** [Why this email scored high, key points]

**Brief Option:**
> [1-2 sentence reply]
>
> [Sign-off]

**Detailed Option:**
> [Paragraph with more context/explanation]
>
> [Sign-off]

#### 2. Re: [Next urgent email]

[Repeat format]

---

### Emails Requiring Personal Attention

- **#X - [Subject]**: Needs decision on [topic]
- **#Y - [Subject]**: Requires research before responding

Scoring Signal Reference

| Signal | Score Impact | Detection |

|--------|-------------|-----------|

| Direct To: address | +15 | Check To: field |

| VIP/known sender | +20 | Domain match, sent folder history |

| Active thread | +10 | Thread ID, Re: in subject |

| Urgency keywords | +15 | Subject/body scan |

| Calendar invite | +20 | .ics attachment, invite headers |

| Deadline <48h | +25 | Date parsing in body |

| Deadline <7d | +10 | Date parsing in body |

| Business relevance | +15 | Match email-profile.md topics |

| CC'd (not primary) | -10 | CC: field |

| Newsletter | -20 | Unsubscribe link, bulk headers |

| Notification | -15 | no-reply@ sender |

| Unknown sender | -10 | No thread history |

Reply Suggestion Guidelines

Tone Adaptation

If email-profile.md exists, adapt replies to match:

Default to professional-friendly if no profile exists.

Reply Structure

Brief Option:

Detailed Option:

When NOT to Draft

Error Handling

No MCP Connection

If neither Gmail nor Outlook MCP is available:

Error: No email provider connected. Please ensure Gmail MCP or Outlook MCP is configured.

Empty Inbox

## Inbox Summary
**0 unread emails** - Your inbox is clear!

MCP Rate Limits

If batch fetch fails, fall back to individual message retrieval (slower but reliable).

Thread Context Unavailable

If get_gmail_thread_content fails, draft replies based on single message only (note: "Limited context - single message view").

Integration Points

email-profile.md (optional)

If exists in parent directory (../email-profile.md), use for:

Gmail-Specific Features

Outlook-Specific Features

Performance Optimization

Output Constraints

Quality Gates

Before outputting digest:

  1. Verify all urgency scores are justified with signal breakdown
  2. Ensure reply suggestions are actionable (not generic)
  3. Check that "personal attention" notes explain why
  4. Confirm categories align with score ranges
  5. Validate that batch operations completed successfully

Success Criteria

A successful email check session should:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.