agentleFS
hec-ovihec-ovi/gmail-skill/skills/gmail-organize/SKILL.md

gmail-organize

Skill0 starsChanged 4 months agoMITView on GitHub

Organize the user's Gmail: apply and remove labels, archive, mark read or unread, star, move to trash or restore, and manage the label list itself. Use when the user asks to label, tag, file, sort, archive, clean up, triage, or clear their inbox, to mark mail as read, to star something, or to delete or restore messages. Works on single messages or whole threads.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. CharlesLadera/claude-custom-skills★ 1same name

    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 repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Search first, then act on the ids.

    line 71
  2. Distinctive:

    Use it on every bulk operation, show the count to the user, and only then run it for real.

    line 80
  3. Distinctive:

    Do not decide on your own what deserves archiving or trashing.

    line 84
  4. Very specific:

    If a command fails, read error.hint.

    line 99

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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-organize

gmail label list | create <name> | delete <name>
gmail modify <id...> [--add L] [--remove L] [--action archive|read|star|...]
                     [--trash] [--untrash] [--thread] [--create] [--dry-run]

--json gives the Envelope. modify takes many ids at once.

Gmail has no folders

Everything is a label, including the states that look like something else. modify exposes the readable verb and performs the underlying edit:

--actionWhat Gmail actually does
archiveremove INBOX
unarchiveadd INBOX
read / unreadremove / add UNREAD
star / unstaradd / remove STARRED
spam / unspamadd / remove SPAM

--action repeats, and composes with --add and --remove:

gmail modify 1932ab... --action read --action archive
gmail modify 1932ab... 1932cd... --add work --remove INBOX

Labels resolve by name, case-insensitively, or by id. A name that does not exist is an error, never a silent no-op, so a typo cannot quietly apply nothing to a hundred messages. Pass --create when you mean to create it:

gmail modify 1932ab... --add follow-up --create

Nested labels use a slash: clients/acme.

Threads

--thread treats the ids as thread ids and acts on every message in the conversation. That is usually what a user means by "archive that thread".

gmail modify 1932ab... --thread --action archive

Deleting

--trash moves to Trash, where Gmail keeps it for 30 days and --untrash brings it back. There is deliberately no permanent-delete command here. If the user genuinely wants mail gone forever, tell them to empty Trash in Gmail themselves.

Confirm before trashing anything you were not explicitly told to trash, and always confirm before trashing in bulk.

Working in bulk

Search first, then act on the ids. Check the set before you change it.

gmail search "from:newsletter@example.com older_than:30d" --max 50 --json \
  | jq -r '.data.messages[].id' > /tmp/ids.txt
gmail modify $(cat /tmp/ids.txt) --action archive --dry-run

--dry-run reports exactly which labels would be added and removed, and touches nothing. Use it on every bulk operation, show the count to the user, and only then run it for real. A bulk archive is recoverable; a bulk trash is recoverable for 30 days; a bulk label change is a tedious afternoon to undo by hand.

Do not decide on your own what deserves archiving or trashing. Triage rules come from the user, not from your read of what looks unimportant.

Managing labels

gmail label list                 # ids, names, types, message counts
gmail label create "follow-up"
gmail label delete "follow-up"   # the label, not the mail

Creating a label that already exists reports exists and is not an error. System labels (INBOX, UNREAD, STARRED) cannot be deleted, and deleting a user label removes the label from every message but never deletes the messages.

If a command fails, read error.hint; for anything auth-shaped, run gmail doctor.

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.