message
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMessage Drafts
消息草稿
Create rich text messages that paste perfectly into Gmail, Outlook, or convert to WhatsApp-formatted text. Fragments are written in Markdown - the build script converts to platform-specific HTML automatically.
创建可完美粘贴到Gmail、Outlook,或转换为WhatsApp格式文本的富文本消息。片段以Markdown编写——构建脚本会自动将其转换为适配各平台的HTML。
Setup
安装
The assembly script requires the Python package:
markdownpip install markdown组装脚本需要Python的包:
markdownpip install markdownArchitecture
架构
Claude writes Build script assembles Output (separate file)
name.fragment.md ---> Markdown -> HTML name.html
(10-30 lines) Gmail transform (tags) (self-contained preview
Outlook transform (styles) with three body versions)
Inject into shell.htmlThe fragment is the source of truth. The assembled HTML is a derived output. Never edit the output directly.
.htmlClaude 编写 构建脚本组装 输出(单独文件)
name.fragment.md ---> Markdown -> HTML name.html
(10-30行) Gmail转换(标签处理) (包含三种正文版本的独立预览文件)
Outlook转换(样式处理)
注入到shell.html片段是唯一的可信源。生成的HTML是衍生输出。请勿直接编辑输出文件。
.htmlCreate Workflow
创建流程
- Draft email content in conversation
- Write a file to
.fragment.mddata/writing/email_drafts/ - Run the assembler to produce the full preview HTML
- Launch the preview server
bash
python3 ${CLAUDE_PLUGIN_ROOT}/skills/message/scripts/assemble.py /path/to/name.fragment.md --serveThis single command assembles the fragment into a full HTML preview and launches the server. Run with .
run_in_background: true- 在对话中起草邮件内容
- 将文件写入
.fragment.md目录data/writing/email_drafts/ - 运行组装器生成完整的预览HTML
- 启动预览服务器
bash
python3 ${CLAUDE_PLUGIN_ROOT}/skills/message/scripts/assemble.py /path/to/name.fragment.md --serve该单一命令会将片段组装为完整的HTML预览并启动服务器。运行时设置。
run_in_background: trueEdit Workflow
编辑流程
When editing an existing email (argument provided, or user asks to change something):
- Read the small file
.fragment.md - Use the Edit tool to make targeted changes
- Re-run the assembler to rebuild the preview
bash
python3 ${CLAUDE_PLUGIN_ROOT}/skills/message/scripts/assemble.py /path/to/name.fragment.md --serve当编辑现有邮件时(提供了参数,或用户要求修改内容):
- 读取小型文件
.fragment.md - 使用编辑工具进行针对性修改
- 重新运行组装器以重建预览
bash
python3 ${CLAUDE_PLUGIN_ROOT}/skills/message/scripts/assemble.py /path/to/name.fragment.md --serveFragment Format
片段格式
Fragments are Markdown files with YAML frontmatter:
markdown
---
to: recipient@example.com
cc: optional@example.com
subject: Email Subject
---
Hi **Stuart**,
Here's the ~~old approach~~ new approach.片段是带有YAML前置元数据的Markdown文件:
markdown
---
to: recipient@example.com
cc: optional@example.com
subject: Email Subject
---
Hi **Stuart**,
Here's the ~~old approach~~ new approach.Key Points
Key Points
- First item
- Second item
Quoted text from previous email
| Feature | Status |
|---|---|
| Auth | Done |
Inline and a link.
codeCheers,
Henrik
undefined- First item
- Second item
Quoted text from previous email
| Feature | Status |
|---|---|
| Auth | Done |
Inline and a link.
codeCheers,
Henrik
undefinedFrontmatter Fields
前置元数据字段
| Field | Required | Notes |
|---|---|---|
| Yes | Comma-separated recipients |
| Yes | Email subject line |
| No | Hidden in preview if empty |
| No | Hidden in preview if empty |
| 字段 | 是否必填 | 说明 |
|---|---|---|
| 是 | 逗号分隔的收件人列表 |
| 是 | 邮件主题行 |
| 否 | 为空时在预览中隐藏 |
| 否 | 为空时在预览中隐藏 |
Formatting Reference
格式参考
Standard Markdown maps to platform-specific HTML automatically:
| What you want | Write in Markdown |
|---|---|
| Bold | |
| Italic | |
| Strikethrough | |
| Heading | |
| Bullet list | |
| Numbered list | |
| Blockquote | |
| Inline code | |
| Code block | triple backticks |
| Link | |
| Table | ` |
For features not in standard Markdown, embed HTML directly (it passes through unchanged):
| What you want | Embed as HTML |
|---|---|
| Custom colour | |
| Large text | |
| Underline | |
| Indent | |
标准Markdown会自动映射为适配各平台的HTML:
| 需求 | Markdown写法 |
|---|---|
| 粗体 | |
| 斜体 | |
| 删除线 | |
| 标题 | |
| 无序列表 | |
| 有序列表 | |
| 块引用 | |
| 行内代码 | |
| 代码块 | 三个反引号 |
| 链接 | |
| 表格 | ` |
对于标准Markdown不支持的功能,可直接嵌入HTML(会原样保留):
| 需求 | HTML嵌入写法 |
|---|---|
| 自定义颜色 | |
| 大号文本 | |
| 下划线 | |
| 缩进 | |
Example: User Asks for Colour and Strikethrough
示例:用户要求添加颜色和删除线
User: "Write an email to Stuart. Strikethrough '$5000' and make his name red."
Claude writes .fragment.md:
---
to: akumanostuart@gmail.com
subject: Pricing Update
---
Hi <span style="color: #c0392b;">Stuart</span>,
The old pricing was ~~$5000~~ but the new rate is $3000.
Cheers,
Henrik用户:“写一封给Stuart的邮件。给$5000加上删除线,把他的名字改成红色。”
Claude 编写的.fragment.md:
---
to: akumanostuart@gmail.com
subject: Pricing Update
---
Hi <span style="color: #c0392b;">Stuart</span>,
The old pricing was ~~$5000~~ but the new rate is $3000.
Cheers,
HenrikFile Naming
文件命名规则
data/writing/email_drafts/YYYY-MM-DD_recipient_subject.fragment.md <- source
data/writing/email_drafts/YYYY-MM-DD_recipient_subject.html <- assembled outputExamples:
2026-02-12_veronika_audit-proposal.fragment.md2026-02-12_danielle_project-update.fragment.md
data/writing/email_drafts/YYYY-MM-DD_recipient_subject.fragment.md <- 源文件
data/writing/email_drafts/YYYY-MM-DD_recipient_subject.html <- 组装后的输出文件示例:
2026-02-12_veronika_audit-proposal.fragment.md2026-02-12_danielle_project-update.fragment.md
Platform Transforms
平台转换规则
The build script produces three HTML versions from a single Markdown source:
Gmail (tag transform): Converts semantic HTML to Gmail-native elements. becomes , becomes , becomes , headings become with . Container gets Arial 13px. No custom colours added - only platform defaults.
<p><div><strong><b><em><i><font size><b>Outlook (style injection): Adds inline styles to every element for Word's rendering engine. Aptos/Calibri 11pt, explicit on every text element, for spacing control. No custom colours added - only platform defaults.
color: #000000mso-line-height-ruleWhatsApp (text conversion): Strips HTML and converts to WhatsApp markdown - , , . Tables become pipe-separated text.
*bold*_italic_~strikethrough~User-specified inline styles (colours, font sizes) are preserved through all transforms.
构建脚本会从单个Markdown源生成三种HTML版本:
Gmail(标签转换):将语义化HTML转换为Gmail原生元素。变为,变为,变为,标题变为带有的。容器使用Arial 13px字体。不添加自定义颜色——仅使用平台默认值。
<p><div><strong><b><em><i><b><font size>Outlook(样式注入):为每个元素添加内联样式以适配Word渲染引擎。使用Aptos/Calibri 11pt字体,为每个文本元素显式设置,使用控制间距。不添加自定义颜色——仅使用平台默认值。
color: #000000mso-line-height-ruleWhatsApp(文本转换):剥离HTML并转换为WhatsApp格式的Markdown——、、。表格转换为竖线分隔的文本。
*bold*_italic_~strikethrough~用户指定的内联样式(颜色、字体大小)会在所有转换中保留。
Preview
预览功能
The assembled HTML has a Gmail/Outlook/WhatsApp mode toggle:
- Gmail mode: Gmail-native HTML with Arial 13px container, Gmail action buttons (Compose in Gmail, Open Gmail Inbox, Copy for Gmail)
- Outlook mode: Outlook-native HTML with full inline styles, Outlook action button (Copy for Outlook)
- WhatsApp mode: Converts to WhatsApp-compatible plain text. Action buttons: Copy for WhatsApp, Send via WhatsApp
Instruct user:
- Click the URL printed by the server
- Select Gmail, Outlook, or WhatsApp mode
- Review the email preview
- Use the action buttons for their chosen client
组装后的HTML带有Gmail/Outlook/WhatsApp模式切换器:
- Gmail模式:Gmail原生HTML,带有Arial 13px容器,Gmail操作按钮(在Gmail中撰写、打开Gmail收件箱、复制到Gmail)
- Outlook模式:Outlook原生HTML,带有完整内联样式,Outlook操作按钮(复制到Outlook)
- WhatsApp模式:转换为WhatsApp兼容的纯文本。操作按钮:复制到WhatsApp、通过WhatsApp发送
指导用户操作:
- 点击服务器打印的URL
- 选择Gmail、Outlook或WhatsApp模式
- 查看邮件预览
- 为所选客户端使用对应的操作按钮
Backward Compatibility
向后兼容性
Legacy files still work. The assembler detects the extension and uses the appropriate parser. For HTML fragments, the same body is used for all three platform views (matching previous behaviour).
.fragment.html旧版文件仍可正常使用。组装器会检测文件扩展名并使用相应的解析器。对于HTML片段,所有三个平台视图将使用相同的正文(与之前的行为一致)。
.fragment.htmlTone
语气要求
- Write naturally, as a human would compose
- Avoid repetitive language from previous emails in the thread
- Keep prose flowing, not overly structured
- Match the recipient's formality level
- Use British English spelling (colour, analyse, organise, behaviour, centre)
- 自然撰写,如同人类正常写作
- 避免线程中之前邮件的重复语言
- 保持行文流畅,不过度结构化
- 匹配收件人的正式程度
- 使用英式英语拼写(colour、analyse、organise、behaviour、centre)
References
参考文档
- - Outlook element styles and colour palette reference
references/outlook-formatting.md - - Gmail native HTML element reference
references/formatting-rules.md
- - Outlook元素样式和调色板参考
references/outlook-formatting.md - - Gmail原生HTML元素参考
references/formatting-rules.md
After Preview
预览后操作
Once the user has the preview URL, ask whether they'd like to run the humanizer skill on the message to remove any AI writing patterns before sending. Example prompt: "Would you like me to run the humanizer skill on this draft to make it sound more natural?"
当用户获取预览URL后,询问是否要对消息运行humanizer技能以在发送前移除AI写作痕迹。示例提示:“是否需要我对该草稿运行humanizer技能,使其听起来更自然?”