home / skills / terrylica / cc-skills / email-triage

This skill generates a scheduled email digest by triaging recent messages into three categories, notifying via Telegram and delivering a podcast voice brief.

npx playbooks add skill terrylica/cc-skills --skill email-triage

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.4 KB
---
name: email-triage
description: Scheduled email digest via Agent SDK Haiku. Triages emails into 3 categories, sends Telegram notification + podcast voice. TRIGGERS - email digest, triage emails, digest, run digest, email summary, voice briefing.
allowed-tools: Read, Bash, Grep, Glob
---

# Email Triage (Scheduled Digest)

Automated email triage running every 6h via launchd. Fetches recent emails, triages with Haiku, sends significant findings to Telegram.

## Mandatory Preflight

### Step 1: Check Digest Script Exists

```bash
ls -la "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/digest.ts" 2>/dev/null || echo "SCRIPT_NOT_FOUND"
```

### Step 2: Verify Environment

```bash
echo "GMAIL_OP_UUID: ${GMAIL_OP_UUID:-NOT_SET}"
echo "TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN:+SET}"
echo "TELEGRAM_CHAT_ID: ${TELEGRAM_CHAT_ID:-NOT_SET}"
echo "HAIKU_MODEL: ${HAIKU_MODEL:-NOT_SET}"
```

**All must be SET.** If any are NOT_SET, run the setup command first.

### Step 3: Verify Gmail CLI Binary

```bash
ls -la "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/gmail-cli/gmail" 2>/dev/null || echo "BINARY_NOT_FOUND"
```

**If BINARY_NOT_FOUND**: Build it:

```bash
cd "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/gmail-cli" && bun install && bun run build
```

## Three-Category Triage System

| Category          | Examples                                                          |
| ----------------- | ----------------------------------------------------------------- |
| SYSTEM & SECURITY | Exchange alerts, 2FA codes, password resets, new device logins    |
| WORK              | Deadlines, invoices, contracts, GitHub PRs, professional requests |
| PERSONAL & FAMILY | Friends/family messages, appointments, vehicle service, health    |

Urgency levels within each: CRITICAL > HIGH > MEDIUM > LOW.

## Running Manually

```bash
cd ~/own/amonic && bun run "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/digest.ts"
```

## References

- [triage-prompts.md](./references/triage-prompts.md) — System prompt + podcast prompt
- [category-config.md](./references/category-config.md) — Category schema, urgency, emoji maps

## Post-Change Checklist

- [ ] YAML frontmatter valid (no colons in description)
- [ ] Trigger keywords current
- [ ] Path patterns use $HOME not hardcoded paths

Overview

This skill automates scheduled email triage and delivers a concise digest every 6 hours. It classifies messages into three categories (System & Security, Work, Personal & Family), ranks urgency, and pushes key items to Telegram plus an optional podcast-style voice briefing. The goal is to reduce inbox noise and surface only actionable alerts.

How this skill works

The skill fetches recent emails using a local Gmail CLI, runs triage prompts through the Haiku Agent SDK to assign category and urgency, then composes a short digest. Significant items are sent as Telegram messages and rendered as a short podcast voice briefing. A launchd schedule runs the digest every 6 hours, and manual invocation is supported via a CLI script.

When to use it

  • Automate regular inbox monitoring for busy professionals
  • Catch security and system alerts promptly (2FA, password resets, device logins)
  • Keep track of work-related items like deadlines, invoices, and PRs
  • Remain aware of personal and family messages without inbox context switching
  • Generate a quick audio briefing for commuting or hands-free review

Best practices

  • Complete mandatory preflight checks: digest script, env vars, and Gmail CLI binary must be present
  • Store credentials in environment variables (GMAIL_OP_UUID, TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID, HAIKU_MODEL) and confirm they are SET before running
  • Use $HOME-based path patterns to keep scripts portable across machines
  • Tune category and urgency prompts in the referenced configuration to match your workflow
  • Run the manual digest command for testing before enabling launchd schedule

Example use cases

  • Daily operations team: surface critical system alerts and PRs to on-call staff via Telegram
  • Freelancer: triage invoices and contracts into a focused work digest
  • Parent: receive appointment and family updates summarized as low-noise notifications
  • Security-conscious user: get immediate alerts for password resets and new device logins with high urgency flags
  • Commuter: listen to a short podcast-style voice briefing of important emails

FAQ

What must I verify before enabling scheduled runs?

Ensure the digest.ts script exists, required environment variables are SET (GMAIL_OP_UUID, TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID, HAIKU_MODEL), and the Gmail CLI binary is built and executable.

How do I run the digest manually?

Run the digest script from your workspace: cd ~/own/amonic && bun run "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/digest.ts".

Can I change the triage categories or urgency mapping?

Yes. Update the category schema and urgency/emoji maps in the category-config reference and adjust prompts in the triage-prompts reference to fit your preferences.