name: email-writer description: This skill should be used when the user needs to write professional emails. It guides users through a multi-step process to generate well-formatted HTML emails with proper structure, tone, and styling. Trigger phrases include "帮我写封邮件", "生成邮件", "写辞职信", "写会议邀请", "email writer", "draft an email".
This skill helps users write professional emails through a guided multi-step process (L3 SimpleSequentialChain). It analyzes user intent, collects necessary information dynamically, and generates well-formatted HTML emails with proper structure and styling.
This skill uses an interactive state machine. Execute commands in order:
# 1. Start new session
python scripts/email_writer.py --start --input "帮我写封感谢信"
# 2. After getting analysis instruction, run LLM analysis, then:
python scripts/email_writer.py --session <id> --analyze-result '{"intent":"thankyou",...}'
# 3. This will output questions. Use appropriate tool to collect answers, then:
python scripts/email_writer.py --continue --session <id> --answers '{"recipient":"...",...}'
# 4. After getting outline instruction, run LLM, then:
python scripts/email_writer.py --session <id> --outline-result '{"outline":{...}}'
# 5. After getting draft instruction, run LLM, then:
python scripts/email_writer.py --session <id> --draft-result '邮件正文...'
# 6. After getting Step 5a (plain text) instruction, run LLM, then:
python scripts/email_writer.py --session <id> --plain-result '{"subject":"...","plainText":"..."}'
# 7. After getting Step 5b (HTML) instruction, run LLM, then:
python scripts/email_writer.py --session <id> --html-result '{"html":"..."}'
Each session has a state file in state/{session_id}.json. The script manages:
- Current step (1-5)
- Collected information
- Intermediate results
- Final output
Important: Always use the script to manage state. Do not manually edit state files.
Analyze the user's request to determine: - Email type (resignation, meeting invitation, thank you, apology, inquiry, custom) - Required tone (formal, business, friendly, urgent) - Required fields to collect - Optional fields that enhance the email
Output format:
{
"analysis": {
"intent": "resignation|meeting|thankyou|apology|inquiry|custom",
"tone": "formal|business|friendly|urgent",
"requiredFields": ["fieldName"],
"optionalFields": ["fieldName"]
},
"collection": {
"strategy": "tool_call|text",
"reasoning": "why this strategy was chosen"
}
}
CRITICAL: You MUST collect missing information before proceeding.
Based on Step 1 analysis, identify missing required fields and collect them:
Collection Strategy (MUST choose one):
ask_followup_question 等多选/单选/文本输入工具Only proceed to Step 3 after receiving the answers
Text Strategy (Fallback)
⚠️ IMPORTANT: You MUST stop after requesting information. Do not generate example content or proceed to the next step until the user provides the actual information.
Common fields by email type: - Resignation: recipient, lastDay, reason (optional), thanks (optional) - Meeting: recipient, meetingTime, meetingTopic, location (optional), agenda - Thank You: recipient, reason, specificDetails (optional) - Apology: recipient, apologyReason, correctiveAction (optional) - Inquiry: recipient, inquiryTopic, background (optional)
Generate email outline based on collected information:
{
"outline": {
"subject": "email subject line",
"sections": [
{"type": "greeting", "content": "..."},
{"type": "opening", "content": "..."},
{"type": "body", "content": "..."},
{"type": "closing", "content": "..."},
{"type": "signature", "content": "..."}
]
}
}
Generate the complete email content following format specifications from references/email-formats.md.
Generate final output in TWO separate substeps:
Step 5a: Generate Plain Text Version - Polish the draft for clarity and tone consistency - Output clean, formatted plain text - No HTML tags, no CSS, no styling - Proper paragraph breaks and spacing
Step 5b: Generate HTML Version - Take the polished plain text from Step 5a - Apply professional HTML email styling - Use the template from assets/email-template.html - Inline CSS for email client compatibility - Keep content identical to plain text version, only add HTML structure
Output Format:
{
"subject": "email subject",
"plainText": "Clean plain text version without any HTML",
"html": "Full HTML with inline CSS styling",
"metadata": {
"type": "email type",
"tone": "tone used",
"generatedAt": "timestamp"
}
}
Important: The plainText field must contain NO HTML tags. The html field must contain the complete HTML document with styling.
Always provide both formats:
7w4.net小葱技能站,你的AI助手技能库。
Include a copy button or clear separation for easy use.
Email format specifications and templates. Load this file when generating emails to ensure proper structure and styling.
Python script that executes the L3 multi-step chain. Use this for deterministic email generation when needed.
HTML email template with professional CSS styling.
这个Skill质量还不错,能帮你快速生成专业的辞职信、会议邀请、感谢信等5种常见邮件。它会自动询问你必要信息,生成带漂亮格式的HTML邮件和纯文本版本,中文支持也比较好。主要缺点是使用说明不够通俗,新手可能不知道怎么操作;生成的邮件偶尔会有格式问题;万一填错信息也没有好的修改方式。总体来说功能实用,但还有改进空间。