agentleFS
CorentinLumineauCorentinLumineau/tidy/.claude/skills/gmail-classify/SKILL.md

gmail-classify

Skill2 starsChanged 3 months agoMITView on GitHub

AI-powered email classification using intelligent content analysis. Categorizes emails into Newsletter, Shopping, Work, Personal, Notifications, Receipts, and Promotions. Use for smart inbox organization beyond simple pattern matching.

  • Installs packages

1 other project uses a version of this.

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. CorentinLumineau/gmail-assistant★ 0100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository10 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Label creation fails: Check permissions

    line 178

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Gmail AI Classifier

Intelligent email classification using AI reasoning for smart inbox organization.

Overview

Unlike pattern-based filtering, AI classification analyzes email content, sender context, and user behavior to make intelligent categorization decisions.

Usage

Syntax: /gmail-classify [days]

Examples:

/gmail-classify           # Classify last 7 days
/gmail-classify 30        # Classify last 30 days
/gmail-classify --dry-run # Preview without applying

Classification Categories

CategoryIndicatorsLabel
NewsletterSubstack, Mailchimp, "unsubscribe" linkNewsletters
ShoppingOrder confirmation, shipping, trackingShopping
WorkCompany domain, professional toneWork
PersonalPersonal contacts, casual tonePersonal
NotificationsGitHub, Slack, calendar alertsNotifications
ReceiptsInvoice, payment, receipt keywordsFinance/Receipts
PromotionsDiscount, sale, marketing languagePromotions

Classification Workflow

Step 1: Fetch Emails

gog gmail search 'newer_than:${DAYS}d -label:classified' --json

Exclude already-classified emails to avoid re-processing.

Step 2: Analyze Each Email

For each email, analyze:

  1. Sender Analysis
    • Domain reputation (newsletter service? company?)
    • Sender name format (person vs system)
    • Reply-to address
  2. Subject Analysis
    • Keywords (order, invoice, newsletter, etc.)
    • Format (numbered list? FW:? RE:?)
    • Tone (formal, casual, marketing)
  3. Content Indicators
    • Unsubscribe link presence
    • Tracking numbers
    • Financial amounts
    • Personal greetings

Step 3: Classify with Confidence

Assign category with confidence level:

ConfidenceThresholdAction
High (90%+)Strong signalsAuto-apply label
Medium (70-89%)Mixed signalsApply with note
Low (<70%)UnclearSkip, flag for review

Step 4: Apply Labels

For high-confidence classifications:

# Ensure label exists
gog gmail labels list --json
gog gmail labels create "CategoryName"

# Apply label
gog gmail modify <message-id> --add-label <label-id>

Step 5: Report Results

## Classification Report

**Period**: Last 7 days
**Emails Analyzed**: 142
**Classifications Made**: 128
**Skipped (low confidence)**: 14

### Summary by Category

| Category | Count | % of Total |
|----------|-------|------------|
| Newsletters | 45 | 35% |
| Notifications | 32 | 25% |
| Shopping | 18 | 14% |
| Work | 15 | 12% |
| Personal | 12 | 9% |
| Receipts | 6 | 5% |

### High-Confidence Classifications (Auto-labeled)
- 98 emails across all categories

### Low-Confidence (Manual Review Needed)
1. "Meeting notes from John" - Work or Personal?
2. "Your weekly summary" - Newsletter or Notification?
...

### Suggested Filters

Based on this analysis, create permanent filters:
1. `/gmail-filter create @substack.com Newsletters --archive`
2. `/gmail-filter create @github.com Notifications`

Classification Signals

Newsletter Signals

  • Sender: newsletter@, digest@, weekly@
  • Domains: substack.com, mailchimp.com, beehiiv.com
  • Content: "unsubscribe", "view in browser"
  • Subject: "Weekly", "Digest", "Newsletter"

Shopping Signals

  • Subject: "order", "shipped", "delivered", "tracking"
  • Sender: orders@, shipping@, noreply@
  • Content: Order numbers, tracking links

Work Signals

  • Sender: Company domain match
  • Content: Project names, professional terminology
  • CC: Multiple company addresses

Personal Signals

  • Sender: In contacts, personal domain
  • Content: Casual language, personal topics
  • No marketing footers

Notification Signals

  • Sender: notifications@, alerts@, noreply@
  • Subject: [GitHub], [Slack], calendar patterns
  • Content: Action buttons, status updates

Receipt Signals

  • Subject: "receipt", "invoice", "payment"
  • Content: Dollar amounts, transaction IDs
  • Sender: billing@, receipts@

Dry Run Mode

Preview classifications without applying:

/gmail-classify --dry-run

Shows what would be classified without making changes.

Error Handling

  • No emails found: Suggest widening date range
  • Label creation fails: Check permissions
  • API rate limit: Pause and resume
  • Classification uncertain: Flag for user review

See Also

  • references/categories.md - Detailed category definitions
  • /gmail-analyze - Pattern analysis (faster, simpler)
  • /gmail-filter - Create permanent rules from classifications

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.