email-writer

👤 carbide 📦 v1.0.0 ⭐ 4.2 ⬇️ 314 下載
📄 辦公效率 免費

📖 技能介紹


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".


Email Writer

Overview

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.

How to Use This Skill

This skill uses an interactive state machine. Execute commands in order:

Quick Start

# 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":"..."}'

State Management

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.

Workflow

Step 1: Intent Analysis

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"
  }
}

Step 2: Information Collection

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):

  1. Tool Call Strategy (Preferred if tools available)

    小蔥技能站7w4.net每天更新,海量AI技能等你發現。

  2. 使用支援結構化表單互動的工具,如 ask_followup_question 等多選/單選/文本輸入工具
  3. 理想工具特徵:支援多欄位表單、單選/多選選項、必填/選填標記、互動式問答
  4. 將缺失的欄位組織成結構化問題(多選題、單選題、文本輸入框),然後呼叫工具
  5. CRITICAL: After calling the tool, STOP and wait for user response
  6. Only proceed to Step 3 after receiving the answers

  7. Text Strategy (Fallback)

  8. If no tools available, ask user directly in natural language
  9. List all required fields clearly
  10. STOP and wait for user to provide the information
  11. Only proceed to Step 3 after receiving all required fields

⚠️ 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)

Step 3: Content Planning

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": "..."}
    ]
  }
}

Step 4: Email Generation

Generate the complete email content following format specifications from references/email-formats.md.

Step 5: Polish and Format

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.

Output Format

Always provide both formats:

  1. HTML Version: Rich text with professional styling
  2. Plain Text Version: Compatible with all email clients

Include a copy button or clear separation for easy use.

Resources

references/email-formats.md

Email format specifications and templates. Load this file when generating emails to ensure proper structure and styling.

scripts/generate_email.py

Python script that executes the L3 multi-step chain. Use this for deterministic email generation when needed.

assets/email-template.html

HTML email template with professional CSS styling.

🤖 AI 評測

這個Skill質量還不錯,能幫你快速生成專業的辭職信、會議邀請、感謝信等5種常見郵件。它會自動詢問你必要資訊,生成帶漂亮格式的HTML郵件和純文本版本,中文支援也比較好。主要缺點是使用說明不夠通俗,新手可能不知道怎麼操作;生成的郵件偶爾會有格式問題;萬一填錯資訊也沒有好的修改方式。總體來說功能實用,但還有改進空間。

📊 多維度評分

適應性4.2
規範性4.1
有效性4.2
可靠性4
可信度4.8

📁 包含檔案 (5 個)

📄 SKILL.md 6.3 KB
📄 assets/email-template.html 5 KB
📄 references/email-formats.md 4.9 KB
📄 scripts/email_writer.py 15 KB
📄 scripts/generate_email.py 10.6 KB