email-formatter

TotalClaw 作者 Your Name v1.0.0

将粗糙的电子邮件草稿转变为精美、专业的消息。当用户想要提高电子邮件质量、修复语法和语气、格式化商务电子邮件或将休闲消息转换为专业通信时,请使用此技能。触发因素包括:“格式化我的电子邮件”、“使其专业”、“改进此邮件”、“修复我的电子邮件”、“完善此草稿”或任何提高电子邮件写作质量的请求。也可以在将要点或注释转换为完整的电子邮件、调整语气(正式/休闲/友好)或为客户、经理或利益相关者准备重要消息时使用。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:totalclaw~cerbug45-email-formatter-skill
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~cerbug45-email-formatter-skill/file -o cerbug45-email-formatter-skill.md
## 概述(中文)

将粗糙的电子邮件草稿转变为精美、专业的消息。当用户想要提高电子邮件质量、修复语法和语气、格式化商务电子邮件或将休闲消息转换为专业通信时,请使用此技能。触发因素包括:“格式化我的电子邮件”、“使其专业”、“改进此邮件”、“修复我的电子邮件”、“完善此草稿”或任何提高电子邮件写作质量的请求。也可以在将要点或注释转换为完整的电子邮件、调整语气(正式/休闲/友好)或为客户、经理或利益相关者准备重要消息时使用。

## 原文

# Email Formatter - Professional Email Enhancement

## Installation & Setup

### Prerequisites Check
Before using this skill, verify the environment has required capabilities:

```bash
# Check if bash is available
which bash

# Check Python version (3.8+ required)
python3 --version

# Check Node.js (optional, for advanced features)
node --version
```

### Auto-Installation Script

**For AI Agents: Run this installation check at first use**

```bash
#!/bin/bash
# Email Formatter Skill - Auto Setup
# This script installs required dependencies

echo "🔧 Email Formatter Skill - Installation Starting..."

# Create skill workspace
SKILL_DIR="$HOME/.email-formatter-skill"
mkdir -p "$SKILL_DIR"
cd "$SKILL_DIR"

# Install Python dependencies
echo "📦 Installing Python packages..."
pip3 install --break-system-packages --quiet \
    language-tool-python \
    textstat \
    spacy 2>/dev/null || pip3 install --user --quiet \
    language-tool-python \
    textstat \
    spacy

# Download language model for grammar checking
echo "📚 Downloading language model..."
python3 -m spacy download en_core_web_sm --quiet 2>/dev/null || true

# Create helper scripts directory
mkdir -p "$SKILL_DIR/scripts"

# Test installation
if python3 -c "import language_tool_python; import textstat; import spacy" 2>/dev/null; then
    echo "✅ Email Formatter Skill installed successfully!"
    echo "📍 Installed at: $SKILL_DIR"
    exit 0
else
    echo "⚠️  Some dependencies failed. Skill will work with reduced features."
    exit 0
fi
```

### Manual Installation (if auto-install fails)

```bash
# Minimal setup - no external dependencies
# The skill will use built-in Python capabilities only
mkdir -p ~/.email-formatter-skill/scripts
echo "✅ Basic setup complete"
```

### Verify Installation

```bash
# Quick verification
python3 -c "print('Email Formatter: Ready ✅')"
```

## Dependencies

### Required (Always Available)
- Python 3.7+ (standard library only for minimal mode)
- Bash shell

### Optional (Enhanced Features)
- `language-tool-python`: Advanced grammar checking
- `textstat`: Readability analysis  
- `spacy`: NLP for tone detection

**Note for AI Agents:** The skill works in degraded mode without optional dependencies. Install them only if environment allows.

## Overview

This skill transforms rough email drafts into polished, professional communication by improving grammar, adjusting tone, enhancing clarity, and applying proper formatting. It handles everything from quick fixes to complete rewrites while preserving the sender's intent.

## ⚠️ CRITICAL SECURITY & SAFETY REQUIREMENTS

**This skill MUST enforce these non-negotiable safety rules at all times:**

### SECURITY LEVEL: MAXIMUM - Multi-Layer Validation Required

**MANDATORY PRE-PROCESSING SECURITY CHECKS:**
Every email MUST pass ALL security layers before any formatting occurs:

#### Layer 1: Content Classification (BLOCK IMMEDIATELY)
❌ **Illegal Activities**: Fraud, scams, phishing, money laundering, tax evasion, bribery
❌ **Violence & Threats**: Physical threats, intimidation, stalking, doxxing, revenge threats
❌ **Impersonation**: Government officials, company executives, IT/support staff, law enforcement
❌ **Financial Fraud**: Wire transfers, cryptocurrency scams, investment fraud, Ponzi schemes
❌ **Identity Theft**: SSN requests, password sharing, credential phishing, fake verification
❌ **Misinformation**: Health fraud, election interference, conspiracy theories, fake news
❌ **Child Safety**: ANY content involving minors in inappropriate context
❌ **Hate Speech**: Racism, sexism, homophobia, religious hatred, ethnic slurs
❌ **Sexual Content**: Harassment, explicit content, unwanted advances, grooming
❌ **Workplace Violations**: Discrimination, harassment, retaliation, hostile environment
❌ **Academic Fraud**: Plagiarism, cheating, fake credentials, assignment ghostwriting
❌ **Medical Fraud**: Fake prescriptions, unlicensed advice, miracle cures, dangerous treatments
❌ **Legal Violations**: Contract fraud, perjury, witness tampering, obstruction
❌ **Privacy Violations**: Sharing private info without consent, surveillance, stalking
❌ **Malware/Hacking**: Phishing links, malicious attachments, system exploits
❌ **Extortion**: Blackmail, ransomware, threats for money, coercion

#### Layer 2: Pattern Recognition (RED FLAGS)
Scan for suspicious patterns that indicate malicious intent:

**Financial Red Flags:**
- Urgent payment requests
- Wire transfer instructions
- Gift card purchases
- Cryptocurrency transactions
- "Keep this confidential" + money
- Bypassing normal approval process
- Unusual account changes
- Tax refund scams
- Inheritance scams
- Lottery/prize scams

**Authority Impersonation Red Flags:**
- "I'm from IT/HR/Legal/Management"
- "CEO needs you to..."
- "Urgent request from [authority]"
- "Don't tell anyone"
- Bypassing email/domain verification
- Unusual requests from superiors
- Fake emergency scenarios

**Credential Harvesting Red Flags:**
- "Verify your password"
- "Confirm your account"
- "Click to prevent suspension"
- "Unusual login detected"
- Links to login pages
- Fake security alerts
- Account expiration warnings

**Social Engineering Red Flags:**
- Artificial urgency
- Emotional manipulation
- Too good to be true
- Requests for secrecy
- Unusual sender behavior
- Pressure tactics
- Fear-based messaging

#### Layer 3: Sentiment & Tone Analysis (WARN OR BLOCK)
⚠️ **Aggressive/Hostile**: Insulting, demeaning, threatening language
⚠️ **Manipulative**: Guilt-tripping, gaslighting, emotional blackmail
⚠️ **Coercive**: Power imbalance exploitation, quid pro quo
⚠️ **Deceptive**: Half-truths, misleading statements, omissions
⚠️ **Discriminatory**: Based on protected characteristics
⚠️ **Retaliatory**: Punishment for protected actions

#### Layer 4: Context Validation (VERIFY LEGITIMACY)
✓ **Sender-Recipient Relationship**: Does this match their normal communication?
✓ **Request Reasonability**: Is this a normal business request?
✓ **Communication Channel**: Should this be email or in-person/phone?
✓ **Timing**: Why is this urgent? Is urgency justified?
✓ **Information Sensitivity**: Should this data be in email?
✓ **Authorization**: Does sender have authority for this request?

#### Layer 5: Privacy & Data Protection (GDPR/CCPA COMPLIANCE)
🔒 **PII Detection**: Name, address, phone, email, SSN, DOB, photos
🔒 **Financial Data**: Credit cards, bank accounts, tax IDs, salary info
🔒 **Health Data**: Medical records, diagnoses, prescriptions, HIPAA data
🔒 **Credentials**: Passwords, API keys, tokens, security questions
🔒 **Proprietary Data**: Trade secrets, confidential business info, NDA material
🔒 **Children's Data**: ANY data about individuals under 18

**ACTION REQUIRED:** If PII detected, warn user about:
- Email is not encrypted by default
- Data breach risks
- Regulatory compliance (GDPR, CCPA, HIPAA)
- Suggest secure alternatives (encrypted email, secure portal, in-person)

### ZERO TOLERANCE BLOCKING - Immediate Rejection

If ANY of these detected, **REFUSE IMMEDIATELY WITHOUT FORMATTING**:

```python
ZERO_TOLERANCE_PATTERNS = [
    # Credential Requests
    r'(send|give|provide).{0,20}(password|credential|login)',
    r'verify.{0,20}(password|account|identity)',
    
    # Financial Fraud
    r'wire transfer.{0,30}(urgent|immediately|today)',
    r'gift card.{0,20}(purchase|buy|get)',
    r'(bitcoin|crypto).{0,20}(send|transfer|wallet)',
    
    # Impersonation
    r"i'?m.{0,10}(from|with|calling from).{0,20}(IT|HR|legal|IRS|FBI)",
    r'(this is|i am).{0,20}(CEO|CFO|president|director)',
    
    # Threats
    r'(or else|otherwise).{0,30}(fire|sue|report|punish)',
    r'you (will|better).{0,20}(regret|pay|suffer)',
    
    # Illegal Activities
    r'(launder|hide|con