mail-draft
Skill13 starsChanged 13 days agoMITView on GitHub
Drafts outgoing email and never sends: Markdown to mail-safe HTML themed from DESIGN.md, footers from identity/mail-footers/, occasions from workflow/mail-profiles/, recipients from mandants, preflight checks; Apple Mail, Outlook or .eml. Trigger: "draft an email", "mail to", "email draft", "mail footer", "email signature", "mail profile".
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/board-pilot/references/agents.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- a2aSkill
- archiveSkill
- board-pilotSkill
- bridge-auditSkill
- bridge-contributeSkill
- bridge-curatorSkill
- bridge-explorerSkill
- bridge-greetingSkill
- bridge-leak-checkSkill
- bridge-learnSkill
- bridge-onboardSkill
- bridge-overlaySkill
- bridge-promoteSkill
- bridge-statusSkill
- bridge-syncSkill
- briefingSkill
- calendarSkill
- capability-brokerSkill
- channelSkill
- cmuxSkill
- cockpitSkill
- dashboardSkill
- debriefSkill
- doc-systemSkill
- github-projects-managerSkill
- html-canvasSkill
- html-slidesSkill
- knowledge-repo-initSkill
- mandantsSkill
- meeting-transcriptionSkill
- object-storeSkill
- onboard-simSkill
- remoteSkill
- scheduleSkill
- secretsSkill
- spec-kickoffSkill
- task-close-postmortemSkill
- tmuxSkill
- tracker-syncSkill
- workloadSkill
- workspaceSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 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.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
Every real footer and profile is a USER file (or org when a team shares one through an overlay), and the schema refuses scope: core for a …
- Very specific: line 60
Write the body as Markdown into a file (greeting and sign-off come from the profile.
- Very specific: line 97
Read the matching _template.yaml and _schema.yaml first (rules/file-creation.md), then:
- Very specific: line 127
Every run also writes a bundle (source, HTML, text, .eml, light/dark preview, report) under mail.drafts_dir, by default …
- Distinctive: line 137
write a real footer or profile into CORE
≈ “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.
Files
mail-draft
Builds a mail as a DRAFT in the person's mail client. The person reads it and presses Send. There is no send command, not behind a flag, not in any client module: a draft that is wrong costs a minute, a sent mail that is wrong cannot be taken back. "Send X to Y" is a request for the finished draft.
Engine: skills/mail-draft/mail-draft.sh (Python, stdlib + PyYAML). Model and
every field: docs/mail-draft.md.
What decides what
| Question | Answered by | Tier |
| Who signs, how to reach them | identity/mail-footers/<id>.yaml (borrows from a persona) | user / org |
| What occasion, which footer, greeting, attachments | workflow/mail-profiles/<id>.yaml | user / org |
| Who receives it, in which language, formal or not | identity/mandants/<id>.yaml (mail_profile, defaults.language, defaults.address_form) | user |
| Colours and type | DESIGN.md through the design theme | core / fork |
| Machine defaults (client, drafts folder) | bridge-config.yaml mail: | user |
CORE ships only the engine, the two _schema.yaml and the two _template.yaml.
Every real footer and profile is a USER file (or org when a team shares one
through an overlay), and the schema refuses scope: core for a footer.
Decision tree
Request about mail
├── write / draft / "send" a mail ──────────► § Draft a mail
├── answer / reply to a mail in Mail ───────► § Reply
├── "how will X be addressed?" ─────────────► mail-draft.sh explain --to X
├── new footer / signature / profile ───────► § Set up
├── paste a signature into Outlook/Mail ────► mail-draft.sh signature <footer> --out <dir>
├── "is my mail setup ok?" ─────────────────► mail-draft.sh validate && mail-draft.sh list
└── "what can my mails look like?" ─────────► mail-draft.sh gallery --openDraft a mail
- Resolve the recipient and occasion first:
mail-draft.sh explain --to <who>. It prints the profile, footer, language, form of address and sender, each with the reason. If the profile names astyle_skill, load that skill before writing the text. - Write the body as Markdown into a file (greeting and sign-off come from the
profile; leave them out unless the text needs its own). Syntax: headings,
lists, tables,
> [!NOTE]alerts,[[Button]](url),[done]badges,{{snippet:<name>}}from the profile. - Preview and show the person the text part in chat:
mail-draft.sh preview --to <who> --subject "<s>" --body-file <f> [--attach <file>] - On their go:
mail-draft.sh compose ...with the same arguments. Preflight errors stop it (missing attachment, leftover{placeholder}, required attachment absent). Warnings are printed for the person. - Report what the command printed: client, recipients, attachments, whether the Drafts folder counted it, and for Outlook that "From" must be switched by hand. Never claim a draft that was not verified.
Recipients: an address, mandant:<id>, mandant:<id>#<group> (the mandant's
groups: block), <mandant>/<person>, a person id, or a person's nicknames entry. A body may link [text](site:home) when the
profile or mail.link_aliases defines site:home.
Override anything per call: --profile, --footer/--no-footer,
--footer-style, --theme, --lang, --informal/--formal, --client.
Reply
mail-draft.sh compose --reply-to <message-id|subject words> --body-file <f>
[--attach <file>] [--reply-all] answers a message in Apple Mail. --to and
--subject default to the original's sender and Re: <subject>; profile,
footer and greeting are chosen for that sender as usual. A given --to
replaces whom Mail answers, --cc/--bcc add to it, and all are read back.
The text and footer
are pasted above the quote and files go in by clipboard, so keep hands off the
keyboard for those seconds: a paste only happens while the reply window is in
front, otherwise (or on any script error or timeout) the reply is closed
unsaved and the run says what is left. The saved draft is read back: text and
footer above the quote, the quote below it, every attachment.
Outlook, eml and none are refused for replies, by name. Preview the text first
with preview --to <sender> --subject "Re: <subject>".
Set up
Read the matching _template.yaml and _schema.yaml first
(rules/file-creation.md), then:
- a footer per way of signing:
identity/mail-footers/<id>.yaml,persona_reffor name/email/phone,style: card | compact | minimal | text,variants:per language,extends:to build on a shared team footer - a profile per occasion:
workflow/mail-profiles/<id>.yaml, onedefault: true,applies_to:to be picked by mandant, mandant type or tag,extends:for variations,variants:for per-language wording - on a mandant or person:
mail_profile: <id>to pin an occasion - finish with
mail-draft.sh validate(CI runs it too), thenmail-draft.sh gallery --opento see every profile side by side
Gallery
mail-draft.sh gallery [--out <dir>] [--body-file <f>] [--open] renders one
sample mail per built-in theme and per profile, each with its footer, greeting
and theme, and writes a local overview page (light and dark) under
<mail.drafts_dir>/gallery/. It never touches a mail client. A profile that
cannot render is shown as a tile with the reason, not skipped.
Clients
| client | draft | sender | notes |
apple-mail | real draft, read back from Drafts (sender, attachments); replies with --reply-to | set from the footer, read back | default on macOS |
outlook | open window; counted in Drafts where Outlook lets scripts see it | NOT settable, reported | no --hide, no replies; the new Outlook hides account folders from scripts, so its drafts read as unverified |
eml | .eml with X-Unsent: 1 | in the file | any OS; opens as a draft in Outlook and Thunderbird |
none | only the bundle | n/a | for review or another tool |
Every run also writes a bundle (source, HTML, text, .eml, light/dark preview,
report) under mail.drafts_dir, by default .bridge/mail-drafts/ (gitignored:
a draft holds addresses and private text).
Never
- send, or add a code path that sends
- hand the body to osascript as an argument (it travels as a file); prefer
--body-fileover--bodyfor anything longer than a line - pick a colour in a footer or profile for your own brand (theme roles only)
- write a real footer or profile into CORE
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
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.

