Gog email triage

From evolution-foundation/evo-nexus · View interactive version

Gog email triage is an AI agent skill from the GitHub repository evolution-foundation/evo-nexus. Triage and prioritize inbox emails. Summarize unread messages, classify by urgency and category, propose actions (reply, archive, schedule, create task). Use when user wants to review inbox, process unread emails, or needs help prioritizing messages. Outputs structured summary with top priorities an

How to use this skill

Skill file

Email Triage & Prioritization

Efficiently review and prioritize your inbox by classifying emails and suggesting actions.

When to Use

Use this skill when:

Important: This skill is READ-ONLY. It analyzes and proposes actions but NEVER sends, archives, or modifies emails.

Dynamic Context

The following live data is available:

Unread emails:

!`gog gmail search "is:unread" --max 25 --json 2>/dev/null || echo "GOG_NOT_CONFIGURED"`

Inputs You Need

Before triaging:

  1. User preferences (ask if not known):
  1. Context clues (extract from conversation):

Workflow

Step 1: Fetch Unread Emails

If dynamic context shows GOG_NOT_CONFIGURED:

If email list is empty:

Step 2: Analyze Each Email

For each email, determine:

Urgency Level:

Category:

Suggested Action:

Step 3: Generate Triage Summary

Output in this format:

# Email Triage Summary

📧 **Total Unread**: [N] messages
⚠️  **Urgent**: [N] | 🔴 **High**: [N] | 🟡 **Medium**: [N] | 🟢 **Low**: [N]

## Top 3 Priorities

1. **[Subject]** from [Sender]
   - Urgency: [urgent/high/medium/low]
   - Reason: [1-line rationale]
   - Suggested action: [action]

2. [...]

3. [...]

## All Messages

| ID (last 6) | From | Subject (truncated) | Urgency | Category | Action | Rationale |
|-------------|------|---------------------|---------|----------|--------|-----------|
| abc123 | sender@example.com | Meeting tomorrow? | high | meeting | reply | Needs response by EOD |
| def456 | newsletter@... | Weekly update | low | newsletter | archive | FYI only |
| [...] | [...] | [...] | [...] | [...] | [...] | [...] |

## Suggested Next Actions

- [ ] **Reply to [N] urgent/high priority emails** (IDs: abc123, def456)
- [ ] **Create tasks for [N] action items** (IDs: ghi789)
- [ ] **Schedule meeting for [topic]** (ID: jkl012)
- [ ] **Archive [N] newsletters and FYI messages**
- [ ] **Block [N] spam senders**

---

**Next Steps**:
- To draft a reply: "Draft a reply to [email ID or subject]"
- To create task: "Create a task for [email ID or subject]"
- To schedule meeting: "Schedule meeting about [topic]"
- To see email content: "Show me email [ID]"

Step 4: Save HTML Artifact

Read the template at .claude/templates/html/custom/email-triage.html, fill all {{PLACEHOLDER}} values with the data from Step 3 (email counts, priority groups, suggested actions), and save the completed HTML to workspace/daily-logs/[C] YYYY-MM-DD-email-triage.html.

Create the workspace/daily-logs/ directory if it does not exist.

Step 5: Offer Follow-Up

After presenting the triage:

Do NOT proceed to take actions without user confirmation.

Output Format (Strict)

The triage summary MUST include:

  1. Header stats: Total count + urgency breakdown
  2. Top 3 priorities: Most urgent/important emails with rationale
  3. Complete table: All emails with classifications
  4. Suggested next actions: Checklist of proposed actions grouped by type
  5. Next steps prompt: Clear options for follow-up

Table columns (in order):

  1. ID (last 6 chars) - for reference
  2. From - sender email or name
  3. Subject (truncated to ~40 chars)
  4. Urgency - urgent/high/medium/low
  5. Category - action-required/fyi/meeting/social/newsletter/spam
  6. Action - reply/archive/create-task/etc
  7. Rationale - 1-line explanation

Examples

Example 1: Morning Inbox Review

User: "Review my inbox"

Assistant:

Let me triage your unread emails.

[Fetches emails...]

# Email Triage Summary

📧 **Total Unread**: 12 messages
⚠️  **Urgent**: 1 | 🔴 **High**: 3 | 🟡 **Medium**: 5 | 🟢 **Low**: 3

## Top 3 Priorities

1. **Budget approval needed** from sarah@company.com
   - Urgency: urgent
   - Reason: Blocks Q2 planning, needs approval by noon today
   - Suggested action: reply

2. **Client demo tomorrow** from client@acme.com
   - Urgency: high
   - Reason: Meeting in < 24h, needs confirmation of attendees
   - Suggested action: reply

3. **Code review request** from dev@company.com
   - Urgency: high
   - Reason: Blocking deployment, requested 2 days ago
   - Suggested action: create-task

## All Messages

| ID | From | Subject | Urgency | Category | Action | Rationale |
|----|------|---------|---------|----------|--------|-----------|
| 7a3f2e | sarah@company.com | Budget approval needed | urgent | action-required | reply | Blocks Q2 planning |
| 9b4c1d | client@acme.com | Client demo tomorrow | high | meeting | reply | Needs confirmation |
| 2e8f6a | dev@company.com | Code review request | high | action-required | create-task | Review needed |
| [...] | [...] | [...] | [...] | [...] | [...] | [...] |

## Suggested Next Actions

- [ ] **Reply to 4 urgent/high emails** (IDs: 7a3f2e, 9b4c1d, 5d7e3c, 8f1a9b)
- [ ] **Create task for code review** (ID: 2e8f6a)
- [ ] **Archive 3 newsletters** (IDs: 4c9e2f, 6a3d8b, 1f7c5e)

---

**Next Steps**: Which email would you like to tackle first? I can draft replies for the top priorities or create tasks for follow-up items.

Example 2: Filtered Triage

User: "Show me only urgent and high priority emails"

Assistant:

Let me filter for urgent and high priority emails only.

[Fetches and filters...]

# Email Triage Summary (Urgent + High Only)

📧 **Total Unread**: 12 messages (showing 4 urgent/high)
⚠️  **Urgent**: 1 | 🔴 **High**: 3

## Top Priorities

1. **Budget approval needed** from sarah@company.com
   - Urgency: urgent
   - Action: reply
   [...]

[Table with only urgent/high priority emails]

The remaining 8 emails are medium/low priority. Want to see those too?

Failure Modes / Troubleshooting

GOG Not Configured

Symptom: Dynamic context shows GOG_NOT_CONFIGURED

Resolution:

  1. Inform user: "GOG CLI is not configured. Let me help you set it up."
  2. Point to: skills/gog/_shared/references/gog-interface.md
  3. Suggest: "Run gog auth login to authenticate"
  4. Do not proceed with triage until configured

No Unread Emails

Symptom: Email list is empty []

Resolution:

  1. Celebrate: "Inbox Zero! No unread emails."
  2. Ask: "Want to review recent emails instead?"
  3. If yes, fetch last 25 emails without unread filter

Invalid JSON from GOG

Symptom: jq parse error or non-JSON output

Resolution:

  1. Try without --json flag
  2. Parse human-readable output (less reliable)
  3. Or inform user: "GOG output format unexpected. Please check GOG version."

Too Many Emails (> 25)

Symptom: User has 100+ unread emails

Resolution:

  1. Inform: "You have [N] unread emails. Showing top 25."
  2. Suggest: "Want to filter by sender, date, or keyword?"
  3. Or: "Let's focus on urgent/high priority only"
  4. Consider batching: "Let's triage in batches of 25"

Classification Uncertainty

Symptom: Can't determine urgency or category from email metadata

Resolution:

  1. Fetch full email with gog email get --id <id>
  2. Read first ~200 chars of body for context
  3. If still uncertain, default to "medium" urgency and "action-required" category
  4. Note in rationale: "Needs review to determine priority"

Safety Rules

  1. Never send, archive, or delete emails - This skill is READ-ONLY
  2. Never modify email labels or folders - Only analyze and propose
  3. Always propose, never execute - Present options, user decides
  4. Privacy-aware output - Truncate email subjects in output if they appear sensitive
  5. No automation without consent - Even for "obvious" spam, ask before suggesting block/delete

Safe Test

To safely test this skill using only user@example.com:

Read-only test (always safe):

gog gmail search "is:unread (to:user@example.com OR from:user@example.com)" --max 10 --json

In Claude Code:

  1. Load the gog-email-triage skill
  2. Say: "Triage my inbox"
  3. Skill will fetch unread emails
  4. Verify output includes:
  1. Confirm NO emails are sent, archived, or modified

See skills/gog/_shared/references/testing.md for complete test plan.

Notes

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.