← Back to list

get-email-summary
by DBS-Dev2000
Version-controlled repository for Claude Code and Claude Desktop agents and skills
⭐ 0🍴 0📅 Jan 24, 2026
SKILL.md
name: get-email-summary description: Fetches and categorizes emails from all accounts (M365 Prisma/DataBusiness/Personal + Gmail), identifying action items, system alerts, and financial notices. Triggers on "Get my email summary for today", "Populate the email sections", "Update emails in briefing entry [id]". Called by briefing-generator after get-calendar-events. Transitions Phase from 2-Calendar to 3-Teams.
Get Email Summary
Retrieves emails from multiple accounts, categorizes by priority, and updates briefing email sections.
Input Parameters
| Parameter | Required | Format | Description |
|---|---|---|---|
| entry_id | Yes | UUID | Notion page ID of briefing entry |
| date | Yes | YYYY-MM-DD | Briefing date |
| lookback_hours | No | Number | Hours to look back (default: 24, range: 12-72) |
Email Categories
1. Action Required (Priority 1)
- High importance emails
- Contains: "please review", "need your", "can you", "approval needed", "urgent", "asap"
- Questions in subject (contains "?")
- From internal team with action keywords
2. System Alerts (Priority 2)
- Contains: "failed", "error", "exception", "alert", "[CRITICAL]"
- From: "no-reply", "noreply", "notifications@", "alerts@", "azure", "github", "devops"
3. Financial Notices (Priority 3)
- Contains: "invoice", "receipt", "payment", "bill", "subscription", "renewal", "statement"
4. Low Priority (Priority 4)
- All Gmail emails default here unless matching higher categories
- Newsletters, promotions, social updates
Execution Workflow
Step 1: Calculate Time Range
const endTime = new Date(); // or end of briefing date if past
const startTime = new Date(endTime - lookback_hours * 60 * 60 * 1000);
Step 2: Fetch Emails
M365: m365:search_emails
{
"account_id": "prisma",
"unread_only": true,
"date_from": "2026-01-13T10:30:00Z",
"date_to": "2026-01-14T10:30:00Z",
"max_results": 50,
"include_body": false
}
Gmail: search_gmail_messages
{
"q": "is:unread after:2026/01/13"
}
Step 3: Categorize Each Email
Check subject/sender against category patterns. Assign highest matching priority.
Step 4: Format Output
Property format (pipe-separated):
John Smith - Project Update Needed | Sarah Chen - Q1 Review Request | DevOps - Build Failed
Content format:
### Prisma Work
**Action Required:**
- **John Smith** - Project Update Needed (⚠️ High Priority)
- **Sarah Chen** - Q1 Review Request
**System Alerts:**
- **Azure DevOps** - Build Failed: Main Branch
- **GitHub Actions** - Test suite failing on PR #847
Step 5: Update Notion
Tool: notion_update_page_properties
{
"page_id": "entry_id",
"command": "update_properties",
"properties": {
"Prisma Email": "John Smith - Update Needed | DevOps - Build Failed",
"DataBusiness Email": "No action items",
"Personal Email": "Bank - Statement Ready",
"Gmail Summary": "3 newsletters, 2 promotions",
"Unread Email Count": 23,
"High Priority Email Count": 5,
"Phase": "3-Teams"
}
}
Output Format
{
"success": true,
"entry_id": "...",
"date": "2026-01-14",
"total_unread": 23,
"high_priority_count": 5,
"categories": {
"action_required": 5,
"system_alerts": 3,
"financial": 2,
"low_priority": 13
},
"accounts_processed": ["prisma", "databusiness", "personal", "gmail"],
"errors": []
}
Error Handling
| Code | Description | Severity | Action |
|---|---|---|---|
| EMAIL001 | M365 account auth failed | Warning | Continue with available accounts |
| EMAIL002 | Gmail unavailable | Warning | Continue with M365 |
| NOTION001 | Entry not found | Critical | Fail with error |
Configuration
const CONFIG = {
m365_accounts: ["prisma", "databusiness", "personal"],
gmail_account: "primary",
lookback_hours_default: 24,
max_emails_per_category: 10,
categorization_rules: {
action_keywords: ["please review", "need your", "can you", "urgent", "asap", "approval"],
alert_keywords: ["failed", "error", "exception", "alert", "[CRITICAL]"],
financial_keywords: ["invoice", "receipt", "payment", "subscription", "renewal"]
}
};
⛔ MANDATORY: SAVE BEFORE COMPLETING
This skill is NOT complete until data is SAVED to Notion.
DO NOT return success until notion_update_page_properties succeeds.
Unsaved data WILL BE LOST on context compaction.
Integration
- Called by: briefing-generator orchestrator after get-calendar-events
- Followed by: get-teams-action-items (Phase 4)
- API calls: ~8 (list accounts, 3 M365, 1 Gmail profile, 1 Gmail search, 2 Notion)
- Expected time: 10-20 seconds
- ⛔ MUST SAVE: Email summaries to Notion BEFORE returning
Score
Total Score
45/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
○言語
プログラミング言語が設定されている
0/5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon