name: alfred-email-triage description: > [Alfred] Scan last 100 emails from All Mail. Classify each email, execute Gmail actions, generate audit report. Every email gets a closed status. allowed-tools: Read, Write, Edit, Glob, Grep, Bash(git:, pnpm:), mcp__claude-in-chrome__*
Alfred Email Triage
Scope: Last 100 emails from All Mail Goal: Every email audited with a status. Master sees the full picture.
Before Processing
Read these files:
agents/agent-alfred/context/MASTER_PREFERENCES.md→ Email accountagents/agent-alfred/context/TEAM.md→ Delegation rules
Check for previous run today:
Glob: agents/agent-alfred/outputs/$(date +%Y-%m-%d)-*-email-triage.md
If previous run exists:
- Still scan Gmail (do not skip)
- Read previous report for context
- Carry over previous classifications as correct (don't re-classify same emails)
- Focus classification effort on NEW emails not in previous report
- Always create a NEW output file with current timestamp (never overwrite previous)
- Note "New since last run: X emails" in summary
Each run = new timestamped file. Example: 0700-email-triage.md and 1400-email-triage.md can both exist.
IMPORTANT: Full Audit Table Required Every report MUST include the complete 100-email audit table, regardless of whether there was a previous run. Master needs to see the full picture every time. Do not abbreviate or show only "new" emails in the audit table.
Status Definitions
Every email gets exactly ONE status:
| Status | Meaning | Master Action |
|---|---|---|
ACTION_NEEDED |
Requires Master decision/signature/approval | Yes |
DELEGATED |
Assigned to team member (label + archive) | No |
DONE |
Already handled | No |
ARCHIVED |
No action needed, FYI only | No |
IGNORED |
Spam, marketing, noise | No |
When unsure: ACTION_NEEDED (Master decides).
Delegation Logic
Key principle: If a team member sends an email about something in their ownership zone, delegate it back to them — even if it's an update or follow-up. They own it.
Delegate (not escalate) when:
- Team member sends update/status on their zone → Delegate back to them
- Team member asks about operations in their zone → Delegate back to them
- Finance ops (ACH, payroll, invoices) from Alec/Wilson → Delegate to Alec
- PH operations from Alvin/Ivan/April → Delegate to Alvin
- The email is informational and doesn't require Master's decision
Escalate to Master when:
- Explicit approval/signature requested from Master
- Financial decisions requiring Master authorization (not routine ops)
- Client complaints or relationship escalations
- Strategic decisions with company-wide impact
- Team member explicitly asks for Master's input
- Ambiguous AND high-stakes
Process
1. Load 100 Emails
Open Gmail → All Mail → Scan last 100 emails (use pagination if needed).
2. Classify Each Email
Quick patterns (IGNORED): Newsletters, LinkedIn notifications, Substack stats, marketing, "X from Y" format senders.
Quick patterns (ARCHIVED): Payment receipts, calendar acceptances, shipping confirmations.
Deep classification: Read email, check sender against TEAM.md, look for action signals.
Known Sender Patterns (for batch operations)
| Pattern | Status | Gmail Search |
|---|---|---|
| Substack, LinkedIn, newsletters | IGNORED | from:substack OR from:linkedin OR from:newsletter |
| Marketing (Amazon, TikTok, etc.) | IGNORED | from:"Amazon Business" OR from:tiktok OR from:marketing |
| Payment confirmations | ARCHIVED | from:wise OR from:brex OR from:paypal subject:receipt |
| Calendar notifications | ARCHIVED | from:calendar-notification OR subject:"Accepted:" OR subject:"Updated invitation" |
| Bank notifications | IGNORED | from:bank OR from:第一銀行 |
| Alvin/PH team | DELEGATED→Alvin | from:alvin OR from:aprillyn OR from:dovie |
| Lydia/Talent | DELEGATED→Lydia | from:lydia |
| Alec/Finance | DELEGATED→Alec | from:alec OR from:wilson |
Update these patterns when you discover new recurring senders.
3. Execute Gmail Actions
CRITICAL: You must actually perform these actions in Gmail, not just document them.
| Status | Gmail Action | Alfred's Action (for audit) |
|---|---|---|
| ACTION_NEEDED | Keep in inbox | Escalate to Master |
| DELEGATED | Apply team label → Archive | Label [Name] → Archive |
| DONE | Archive | Archive |
| ARCHIVED | Archive | Archive |
| IGNORED | Archive | Archive |
Use BATCH operations - do NOT process emails one-by-one:
Step 3a: Batch Archive Newsletters/Marketing (IGNORED)
- In Gmail search, enter:
from:substack OR from:linkedin OR from:"Amazon Business" OR from:newsletter - Click "Select all" checkbox in toolbar
- Click Archive button (or press 'e')
- Note count archived
Step 3b: Batch Archive by Sender Pattern (ARCHIVED)
- Search:
from:wise OR from:brex OR from:calendar-notification - Select all → Archive
- Note count archived
Step 3c: Batch Delegate by Team Member
For each team member (Alvin, Lydia, Alec, etc.):
- Search:
from:alvin OR to:alvin(adjust for each person) - Select all matching emails
- Click Labels icon → Check the team member label → Click Apply
- Click Archive button
- Note count labeled and archived
Step 3d: Final Pass - Individual Review
Only process remaining emails individually:
- Return to Inbox view
- Review remaining emails one-by-one
- Archive or keep as ACTION_NEEDED
Verification after each batch:
- Note inbox count before and after
- Track: "Archived X newsletters, labeled Y for Alvin, etc."
Result: Inbox should only contain ACTION_NEEDED items.
4. Write Report
Output: agents/agent-alfred/outputs/YYYY-MM-DD-HHmm-email-triage.md
Use local time for HHmm timestamp.
# Email Triage Audit — YYYY-MM-DD HH:mm
**Account:** [from MASTER_PREFERENCES.md]
**Emails scanned:** 100
**Date range:** [oldest] to [newest]
## Summary
| Status | Count | % |
|--------|-------|---|
| ACTION_NEEDED | X | X% |
| DELEGATED | X | X% |
| DONE | X | X% |
| ARCHIVED | X | X% |
| IGNORED | X | X% |
## Master Action Items
| # | Subject | Why | Suggested Action |
|---|---------|-----|------------------|
## Full Audit Table
| # | Date | Sender | Subject | Summary | Status | Alfred's Action |
|---|------|--------|---------|---------|--------|-----------------|
## Master Feedback
> [Fill after review]
Success Criteria
- 100 emails scanned (not 50, not 20 — all 100)
- Full Audit Table with all 100 emails (not just "new" emails)
- Every email has exactly one status
- Alfred's Action column filled for every email
- Gmail actions actually executed (not just documented):
- DELEGATED emails have labels applied and are archived
- DONE/ARCHIVED/IGNORED emails are archived
- Inbox only contains ACTION_NEEDED items
- Verify inbox count matches ACTION_NEEDED count
- Output written with correct local timestamp