agentleFS
CorentinLumineauCorentinLumineau/tidy/.claude/skills/prj-gmail-cleanup/SKILL.md

prj-gmail-cleanup

Skill2 starsChanged 3 months agoMITView on GitHub

Gmail inbox optimization and label management with category awareness

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask user which category to focus on (or "all").

    line 37
  2. Distinctive:

    Keep all emails in inbox (don't archive unless asked)

    line 149
  3. Very specific:

    Always dry-run first with scripts: DRY_RUN=true ./scripts/script.sh

    line 150
  4. Very specific:

    Use category filter: CATEGORY=promotions DRY_RUN=true ./scripts/ai_categorize.sh

    line 151

≈ “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 Cleanup Workflow

Gmail inbox optimization and label management. Analyzes uncategorized emails, suggests new labels and filters, organizes inbox.

Prerequisites

gog CLI installed and authenticated with Gmail.

Workflow

1. Show Category Breakdown

Count emails per Gmail tab (Promotions, Social, Updates, Primary):

# Promotions
gog gmail search "in:promotions has:nouserlabels -in:spam -in:trash" --max=500 --plain

# Social
gog gmail search "in:social has:nouserlabels -in:spam -in:trash" --max=500 --plain

# Updates
gog gmail search "in:updates has:nouserlabels -in:spam -in:trash" --max=500 --plain

# Primary (truly uncategorized)
gog gmail search "has:nouserlabels -in:promotions -in:social -in:updates -in:forums -in:spam -in:trash" --max=500 --plain

Ask user which category to focus on (or "all").

2. Analyze Selected Category

# List labels and filters
gog gmail labels list
gog gmail settings filters list

# Get uncategorized emails (max 100)
gog gmail search "has:nouserlabels -in:spam -in:trash" --max=100 --plain

3. Identify Patterns

Analyze uncategorized emails for:

  • Sender domains (group by @domain.com)
  • Subject keywords
  • Frequency

Category-specific suggestions:

  • Promotions -> Services/Shopping, Finance/Subscriptions
  • Social -> Admin/Notifications
  • Updates -> Finance/Payments, Projects/Purchases
  • Primary -> analyze sender/subject patterns

Present as table:

| Sender Pattern | Count | Suggested Label |
|----------------|-------|-----------------|
| @domain.com    | 15    | Category/Label  |

4. Propose Actions (Ask Approval First)

Present proposals:

New Labels:

- Finance/Subscriptions
- Services/Shopping

New Filters:

| From | Label | Keep in Inbox |
|------|-------|---------------|
| rakuten.com | Services/Shopping | Yes |

Emails to Categorize:

Found X emails to label

Wait for user confirmation before executing.

5. Execute Approved Actions

# Create label
gog gmail labels create "Category/Subcategory"

# Create filter (keeps in inbox)
gog gmail settings filters create --from="domain.com" --add-label="Category/Label"

# Apply label to existing emails
THREADS=$(gog gmail search "from:domain.com -label:Target" --max=500 --plain | awk '{print $1}')
for tid in $THREADS; do
  gog gmail labels modify "$tid" --add="Target/Label"
done

6. Report Results

Summarize:

  • Labels created
  • Filters added
  • Emails categorized
  • Remaining uncategorized per category

Label Hierarchy

Finance/     Investments, Taxes, Insurance, Payments, Subscriptions
Services/    Tech, Gaming, Automotive, Shopping
Projects/    Travel, Purchases, Legal
Admin/       Security, Jobs, Notifications
Status/      Pending, Important, Archive

Common Sender Patterns

PatternLabel
bank, creditFinance/Payments
invest, cryptoFinance/Investments
tax, impotsFinance/Taxes
github, gitlabServices/Tech
game, steamServices/Gaming
travel, flightProjects/Travel
shop, orderServices/Shopping

Best Practices

  • Keep all emails in inbox (don't archive unless asked)
  • Always dry-run first with scripts: DRY_RUN=true ./scripts/script.sh
  • Use category filter: CATEGORY=promotions DRY_RUN=true ./scripts/ai_categorize.sh

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.