agentleFS
ridzkyyyyyridzkyyyyy/apple-mail/SKILL.md

apple-mail

Skill0 starsChanged 8 months agoMITView on GitHub

read, write, search, and manage emails in macos mail.app via cli scripts. use when the user wants to send, read, search, draft, or organise emails.

9 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 4

    Distinctive

    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:

    always draft first -- never send without creating and confirming a draft

    line 95
  2. Distinctive:

    never delete without confirmation -- always confirm with the user before deletion

    line 96
  3. Very specific:

    prefer --message-id over --id -- the RFC 2822 message-id (the message_id field from list commands) is stable across exchange syncs.

    line 97
  4. Distinctive:

    verify draft ids -- draft ids may change after creation.

    line 98
  5. Very specific:

    read, delete, move, reply, and forward commands all accept --message-id as the preferred identifier

    line 107
  6. Distinctive:

    if time runs out, spawns a background worker and returns partial results

    line 120

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “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

apple mail skill

read, write, search, and manage emails in macos mail.app via cli.

quick start

# verify setup (mail.app running, full disk access, dependencies)
.cursor/skills/apple-mail/scripts/check-setup.sh

# build the search index (required for search and content previews)
.cursor/skills/apple-mail/scripts/mail.sh build-index

# list recent emails with content previews
.cursor/skills/apple-mail/scripts/mail.sh list-recent --include-content

important: symlink path

this skill lives under .cursor/skills/apple-mail/ which may be a symlink. all script invocations should use the resolved path from this skill directory. run .cursor/skills/apple-mail/scripts/check-setup.sh to see resolved paths.

tool reference

all commands are invoked via .cursor/skills/apple-mail/scripts/mail.sh <command> [args].

all output is json with this contract:

{"success": bool, "data": ..., "error": ..., "warnings": [], "meta": {...}}
commandwhat it doesspeed
server-infoskill version and metadatainstant
check-healthverify mail.app is responding~1 s
list-accountslist all mail accounts~0.15 s
list-folders --account EMAILlist folders with email counts~1-2 s
list-recent [--limit N] [--include-content]recent emails from all inboxes~0.3 s
list-emails --account EMAIL --folder NAME [--limit N] [--include-content]emails in a folder~0.3 s
list-drafts [--limit N] [--include-content]drafts across all accounts~0.25 s
read-email --message-id MID or --id IDfull email content, recipients, attachments~1-2 s
search --query TEXT [--scope all|subject|sender] [--limit N]search emails~1 ms (all) / ~200 ms (subject/sender)
compose-draft --account EMAIL --subject TEXT --body TEXT --to ADDR...create a new draft~1 s
amend-draft --id ID [--subject TEXT] [--body TEXT]modify an existing draft~2 s
send-draft --id IDsend a draft~2 s
reply-draft --message-id MID --body TEXT [--reply-all] or --id IDcreate a reply draft~2 s
forward-draft --message-id MID --account EMAIL --body TEXT --to ADDR...forward as draft~2 s
delete-email --message-ids MID [MID...] or --ids ID [ID...]delete email(s) (single or batch)~1-3 s
delete-draft --id IDdelete a draft~1 s
move-email --message-id MID --to FOLDER or --id IDmove email to folder~3-5 s
build-indexbuild/rebuild fts5 search index~30-120 s
index-statuscheck background indexing progressinstant
index-cancelcancel background indexinginstant

array arguments use space separation: --to a@b.com c@d.com --cc x@y.com

for detailed parameter docs and return shapes, see references/tool-reference.md.

workflows

triage inbox

  1. list-recent --include-content -- scan recent emails with previews (note the message_id field in output)
  2. read-email --message-id MID -- open specific email for full content (prefer --message-id over --id)
  3. move-email --message-id MID --to Archive or delete-email --message-ids MID -- act on it

reply to an email

  1. read-email --message-id MID -- read the email
  2. reply-draft --message-id MID --body "..." [--reply-all] -- create reply draft
  3. list-drafts -- confirm draft and get stable id
  4. send-draft --id DRAFT_ID -- send

search and act

  1. search --query "invoice" --scope all -- find matching emails
  2. read-email --message-id MID -- read full content
  3. take action (reply, forward, move, delete)

compose and send

  1. compose-draft --account me@example.com --subject "Hello" --body "..." --to recipient@example.com
  2. list-drafts — get stable draft id
  3. amend-draft --id ID --body "revised text" — (optional) revise
  4. send-draft --id ID — send

safety rules

  1. always draft first -- never send without creating and confirming a draft
  2. never delete without confirmation -- always confirm with the user before deletion
  3. prefer --message-id over --id -- the RFC 2822 message-id (the message_id field from list commands) is stable across exchange syncs; integer ids can shift
  4. verify draft ids -- draft ids may change after creation; always re-list drafts for stable ids
  5. content previews are partial -- previews are the first ~5000 chars, not full content. use read-email for the complete message
  6. exchange sync delay -- move operations on exchange accounts need ~3 s for server sync

id shift recovery

mail.app integer ids can change after exchange sync. use --message-id (the stable RFC 2822 header) to avoid this problem entirely:

  • list commands (list-emails, list-recent, list-drafts) return both id (integer) and message_id (stable string) for each email
  • read, delete, move, reply, and forward commands all accept --message-id as the preferred identifier
  • --id (integer) still works as a fallback for backward compatibility

if a --message-id lookup fails (edge case), re-list the folder:

.cursor/skills/apple-mail/scripts/mail.sh list-emails --account EMAIL --folder FOLDER

background indexing

when --include-content is used and some emails aren't in the index, the system:

  1. tries to find .emlx files on disk (instant)
  2. falls back to jxa content fetch (up to 60 s)
  3. if time runs out, spawns a background worker and returns partial results

check background progress: .cursor/skills/apple-mail/scripts/mail.sh index-status cancel if needed: .cursor/skills/apple-mail/scripts/mail.sh index-cancel

writing style

see references/writing-style.md for email composition guidelines.

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.