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

gmail-draft

Skill0 starsChanged 4 months agoMITView on GitHub

Prepare Gmail messages without sending them: create, update, list, send, and delete drafts, with attachments. Use when the user asks to draft, prepare, or write up an email, to save something for later, to revise a draft, or to send one they already approved. Prefer this over sending directly whenever the exact wording has not been agreed yet: a draft is reviewable in Gmail and costs nothing to throw away.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. ericpardee/agent-files★ 3same name
    2. KrishBakshi/wingmate★ 0same 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

3 rules. About 0 are common, 1 is distinctive, and 2 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.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Put the body in a file and pass --body-file.

    line 36
  2. Distinctive:

    Write in the user's voice, not yours.

    line 51
  3. Very specific:

    If a command fails, read error.hint.

    line 101

≈ “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-draft

gmail draft create --to <addr> --subject <s> --body-file <file> [--cc][--bcc][--attach]
gmail draft update --draft-id <id> --to <addr> --subject <s> --body-file <file>
gmail draft list [--query "<gmail query>"] [--max 25]
gmail draft send --draft-id <id>
gmail draft delete --draft-id <id>

--json gives the Envelope on any of them.

When to draft instead of send

Draft by default. Send directly only when the user has seen the words and said to send them. Drafting is the whole reason this is a separate skill from gmail-send: it turns an irreversible action into a reviewable one, and the user can finish it in Gmail on their phone.

Reach for a draft when the user says "write", "draft", "prepare", "put together", "start an email"; when the message matters and they have not read it yet; or when you are composing on their behalf from your own understanding of a thread.

Writing the body

Put the body in a file and pass --body-file. --body exists for one-liners, but shell quoting mangles anything with newlines, quotes, or a dollar sign, and you will not notice until it is sent.

cat > /tmp/reply.txt <<'EOF'
Hi Ada,

Tuesday at 10 works. I will send an agenda beforehand.

Hector
EOF
gmail draft create --to ada@example.com --subject "Re: Tuesday" --body-file /tmp/reply.txt

Write in the user's voice, not yours. If you have their previous mail in context, match its register: how they open, how they sign off, how long their sentences are. Do not add pleasantries they never use.

Attachments

gmail draft create --to ada@example.com --subject "CV" \
  --body-file /tmp/note.txt --attach ~/docs/cv.pdf --attach ~/docs/portfolio.pdf

--attach repeats. Paths must exist; the tool does not expand globs, your shell does. The encoded message has to stay under Gmail's 25 MB, which is about 18 MB of actual files because base64 inflates by a third. Over that, it is refused before anything is created.

Revising

update replaces the draft in place, so pass the whole message again, not just the part that changed. Keep the draft id from create.

gmail draft create --to ada@example.com --subject "v1" --body-file /tmp/a.txt --json
# -> data.draft_id
gmail draft update --draft-id r-8891 --to ada@example.com --subject "v2" --body-file /tmp/b.txt

A draft may be incomplete. No recipient and no subject is fine; it is a scratchpad until it is sent.

Sending one

gmail draft send --draft-id r-8891

This is a real send and cannot be undone. Show the user the recipients, subject, and body first and get an explicit go-ahead, even though they asked for the draft earlier: what they approved was the draft existing, not it leaving.

Previewing

--dry-run on create or update builds the exact message and returns the preview without touching the mailbox. Useful to check attachments resolved and the body survived quoting.

gmail draft create --to ada@example.com --subject "CV" --body-file /tmp/note.txt \
  --attach ~/docs/cv.pdf --dry-run

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.