| name | email-formatter |
| description | Transform rough email drafts into polished, professional messages. Use this skill when the user wants to improve email quality, fix grammar and tone, format business emails, or convert casual messages into professional communication. Triggers include: 'format my email', 'make this professional', 'improve this message', 'fix my email', 'polish this draft', or any request to enhance email writing quality. Also use when converting bullet points or notes into complete emails, adjusting tone (formal/casual/friendly), or preparing important messages for clients, managers, or stakeholders. |
| license | MIT |
| author | Your Name |
| version | 1.0.0 |
Email Formatter - Professional Email Enhancement
Installation & Setup
Prerequisites Check
Before using this skill, verify the environment has required capabilities:
which bash
python3 --version
node --version
Auto-Installation Script
For AI Agents: Run this installation check at first use
#!/bin/bash
echo "🔧 Email Formatter Skill - Installation Starting..."
SKILL_DIR="$HOME/.email-formatter-skill"
mkdir -p "$SKILL_DIR"
cd "$SKILL_DIR"
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
echo "📚 Downloading language model..."
python3 -m spacy download en_core_web_sm --quiet 2>/dev/null || true
mkdir -p "$SKILL_DIR/scripts"
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)
mkdir -p ~/.email-formatter-skill/scripts
echo "✅ Basic setup complete"
Verify Installation
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:
ZERO_TOLERANCE_PATTERNS = [
r'(send|give|provide).{0,20}(password|credential|login)',
r'verify.{0,20}(password|account|identity)',
r'wire transfer.{0,30}(urgent|immediately|today)',
r'gift card.{0,20}(purchase|buy|get)',
r'(bitcoin|crypto).{0,20}(send|transfer|wallet)',
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)',
r'(or else|otherwise).{0,30}(fire|sue|report|punish)',
r'you (will|better).{0,20}(regret|pay|suffer)',
r'(launder|hide|conceal).{0,20}money',
r'(fake|forged|fraudulent).{0,20}(document|invoice|receipt)',
r'(minor|child|kid|underage).{0,50}(sexual|romantic|date|meet)',
r'(click|download).{0,20}(attachment|link|file).{0,20}(urgent|immediately)',
r'account.{0,20}(suspend|lock|close|expire).{0,20}(unless|until)',
r'(stupid|idiot|incompetent|worthless).{0,20}(you|employee|coworker)',
r"i'?ll make sure you (never|don't|can't)",
]
Enhanced Security Response Protocol
When prohibited content detected:
1. STOP - Do not process further
2. LOG - Record violation type (no content)
3. INFORM - Tell user specifically what rule was violated
4. EDUCATE - Explain why it's harmful/illegal
5. REDIRECT - Suggest legitimate alternatives
6. REPORT - Flag for review if severe (threats, child safety, fraud)
Example Response Template:
🛑 SECURITY BLOCK: Email Formatting Refused
REASON: [Specific violation - e.g., "Credential request detected"]
WHY THIS IS BLOCKED:
[Explanation - e.g., "Legitimate organizations never ask for
passwords via email. This matches phishing attack patterns."]
WHAT YOU SHOULD DO:
[Alternative - e.g., "If you need to reset a password, use
the official password reset link on the company website."]
THIS SKILL CANNOT:
- Help with fraudulent communications
- Bypass security protocols
- Facilitate illegal activities
- Enable harassment or threats
Helper Scripts & Tools
The skill includes utility scripts for AI agents to use. Create these in ~/.email-formatter-skill/scripts/:
1. Grammar Checker (grammar_check.py)
"""
Basic grammar and spell checker
Usage: python3 grammar_check.py "email text here"
"""
import sys
import re
def basic_grammar_check(text):
"""Basic grammar checks without external dependencies"""
issues = []
typos = {
'recieve': 'receive', 'occured': 'occurred', 'seperate': 'separate',
'definately': 'definitely', 'accomodate': 'accommodate',
'tommorow': 'tomorrow', 'untill': 'until', 'truely': 'truly'
}
for wrong, right in typos.items():
if wrong in text.lower():
issues.append(f"Spelling: '{wrong}' → '{right}'")
if re.search(r'\bi\s', text):
issues.append("Grammar: 'i' should be capitalized to 'I'")
if re.search(r'\s{2,}', text):
issues.append("Formatting: Multiple spaces detected")
if re.search(r'[.!?]\s*[a-z]', text):
issues.append("Grammar: Sentence should start with capital letter")
if re.search(, text):
issues.append()
issues
__name__ == :
(sys.argv) < :
()
sys.exit()
text = sys.argv[]
issues = basic_grammar_check(text)
issues:
issue issues:
()
:
()
2. Tone Analyzer (tone_analyzer.py)
"""
Analyze email tone
Usage: python3 tone_analyzer.py "email text"
"""
import sys
import re
def analyze_tone(text):
"""Detect tone indicators in email text"""
formal_words = ['pursuant', 'hereby', 'aforementioned', 'regarding',
'sincerely', 'respectfully', 'cordially']
casual_words = ['hey', 'gonna', 'wanna', 'yeah', 'yep', 'nope',
'btw', 'fyi', 'lol', 'omg', 'tbh']
aggressive_words = ['immediately', 'must', 'unacceptable', 'ridiculous',
'obviously', 'clearly', 'need to', 'have to']
polite_words = ['please', 'kindly', 'would you', 'could you',
'appreciate', 'thank', 'grateful']
text_lower = text.lower()
formal_count = sum(1 for w formal_words w text_lower)
casual_count = ( w casual_words w text_lower)
aggressive_count = ( w aggressive_words w text_lower)
polite_count = ( w polite_words w text_lower)
exclamations = (re.findall(, text))
caps_words = (re.findall(, text))
tones = []
formal_count >= :
tones.append()
casual_count >= :
tones.append()
aggressive_count >= caps_words >= :
tones.append()
polite_count >= :
tones.append()
exclamations >= :
tones.append()
tones:
tones.append()
{
: tones[],
: tones,
: formal_count,
: casual_count,
: aggressive_count,
: polite_count,
: exclamations,
: caps_words
}
__name__ == :
(sys.argv) < :
()
sys.exit()
result = analyze_tone(sys.argv[])
()
()
(
)
result[] >= :
()
result[] >= :
()
result[] >= :
()
3. Readability Scorer (readability.py)
"""
Calculate email readability
Usage: python3 readability.py "email text"
"""
import sys
import re
def count_syllables(word):
"""Simple syllable counter"""
word = word.lower()
vowels = 'aeiouy'
syllable_count = 0
previous_was_vowel = False
for char in word:
is_vowel = char in vowels
if is_vowel and not previous_was_vowel:
syllable_count += 1
previous_was_vowel = is_vowel
if word.endswith('e'):
syllable_count -= 1
if syllable_count == 0:
syllable_count = 1
return syllable_count
def flesch_reading_ease(text):
"""Calculate Flesch Reading Ease score"""
sentences = len(re.findall(r'[.!?]+', text)) or 1
words = len(text.split())
syllables = sum(count_syllables(word) for word in text.split())
if words == 0:
return 0
score = 206.835 - 1.015 * (words / sentences) - * (syllables / words)
(score, )
():
words = text.split()
sentences = (re.findall(, text))
avg_word_length = ((w) w words) / (words) words
avg_sentence_length = (words) / sentences
flesch_score = flesch_reading_ease(text)
flesch_score >= :
level =
flesch_score >= :
level =
flesch_score >= :
level =
flesch_score >= :
level =
flesch_score >= :
level =
flesch_score >= :
level =
:
level =
{
: flesch_score,
: level,
: (avg_word_length, ),
: (avg_sentence_length, ),
: (words),
: sentences
}
__name__ == :
(sys.argv) < :
()
sys.exit()
result = analyze_readability(sys.argv[])
()
()
()
()
result[] < :
()
result[] > :
()
4. Security Scanner (security_scan.py)
"""
ULTRA-SECURE Email Scanner - Multi-Layer Threat Detection
Usage: python3 security_scan.py "email text"
Exit codes: 0=safe, 1=warning, 2=critical_block, 3=report_required
"""
import sys
import re
import json
from datetime import datetime
class SecurityScanner:
"""Military-grade email security scanner"""
def __init__(self):
self.threat_level = 0
self.violations = []
self.warnings = []
def scan(self, text):
"""Run all security checks"""
self.check_zero_tolerance(text)
self.check_financial_fraud(text)
self.check_impersonation(text)
self.check_credential_harvesting(text)
self.check_threats(text)
self.check_harassment(text)
self.check_privacy_violations(text)
self.check_social_engineering(text)
.check_child_safety(text)
.check_malicious_patterns(text)
.generate_report()
():
text_lower = text.lower()
critical_patterns = [
(,
, ),
(,
, ),
(,
, ),
(,
, ),
(,
, ),
(,
, ),
(,
, ),
(,
, ),
(,
, ),
(,
, ),
(,
, ),
(,
, ),
(,
, ),
(,
, ),
]
pattern, violation_type, severity critical_patterns:
re.search(pattern, text_lower):
.add_violation(violation_type, severity, pattern)
():
text_lower = text.lower()
fraud_indicators = [
(,
, ),
(,
, ),
(,
, ),
(,
, ),
(,
, ),
(,
, ),
(,
, ),
]
pattern, violation_type, severity fraud_indicators:
re.search(pattern, text_lower):
.add_violation(violation_type, severity, pattern)
():
text_lower = text.lower()
impersonation_patterns = [
(,
, ),
(,
, ),
(,
, ),
]
pattern, violation_type, severity impersonation_patterns:
re.search(pattern, text_lower):
.add_violation(violation_type, severity, pattern)
():
text_lower = text.lower()
patterns = [
(,
, ),
(,
, ),
(,
, ),
(,
, ),
]
pattern, violation_type, severity patterns:
re.search(pattern, text_lower):
.add_violation(violation_type, severity, pattern)
():
text_lower = text.lower()
threat_words = [
, , , , , ,
, , ,
]
word threat_words:
word text_lower:
.add_violation(, , )
re.search(, text_lower):
.add_violation(, , )
():
text_lower = text.lower()
hostile_words = [
, , , , ,
, , , ,
]
count = ( word hostile_words word text_lower)
count >= :
.add_violation(, , )
count == :
.add_warning(, )
protected_characteristics = [
(,
),
(,
),
(, ),
]
pattern, violation_type protected_characteristics:
re.search(pattern, text_lower):
.add_violation(violation_type, , pattern)
():
re.search(, text):
.add_violation(, , )
re.search(, text):
.add_violation(, , )
emails = re.findall(, text)
(emails) > :
.add_warning(, )
phones = re.findall(, text)
(phones) > :
.add_warning(, )
re.search(, text.lower()):
.add_warning(, )
():
text_lower = text.lower()
urgency_words = [, , , , ,
, , ]
urgency_count = ( word urgency_words word text_lower)
urgency_count >= :
.add_violation(, , )
urgency_count >= :
.add_warning(, )
re.search(, text_lower):
.add_violation(, , )
re.search(, text_lower):
.add_violation(, , )
re.search(, text_lower):
.add_warning(, )
():
text_lower = text.lower()
child_terms = [, , , , , , , ]
inappropriate_context = [, , , , ,
, , , ]
has_child_term = (term text_lower term child_terms)
has_inappropriate = (term text_lower term inappropriate_context)
has_child_term has_inappropriate:
.add_violation(, , )
():
text_lower = text.lower()
malicious_patterns = [
(,
, ),
(,
, ),
(,
, ),
(,
, ),
]
pattern, violation_type, severity malicious_patterns:
re.search(pattern, text_lower):
.add_violation(violation_type, severity, pattern)
():
.violations.append({
: violation_type,
: severity,
: pattern,
: datetime.now().isoformat()
})
severity > .threat_level:
.threat_level = severity
():
.warnings.append({
: warning_type,
: message
})
.threat_level == :
.threat_level =
():
{
: .threat_level,
: .get_status(),
: .violations,
: .warnings,
: .get_summary()
}
():
.threat_level >= :
.threat_level == :
.threat_level == :
:
():
.threat_level >= :
.threat_level == :
.threat_level == :
:
__name__ == :
(sys.argv) < :
()
sys.exit()
scanner = SecurityScanner()
report = scanner.scan(sys.argv[])
()
()
()
()
()
()
report[]:
()
v report[]:
severity_icon = v[] >=
()
()
report[]:
()
w report[]:
()
()
sys.exit(report[])
Usage Workflow for AI Agents
MANDATORY SECURITY-FIRST WORKFLOW:
#!/bin/bash
set -e
EMAIL_TEXT="$1"
TEMP_DIR="/tmp/email-formatter-$$"
mkdir -p "$TEMP_DIR"
echo "🔒 Starting Secure Email Processing Pipeline..."
echo "================================================"
echo "Step 1/7: Running security scan..."
python3 ~/.email-formatter-skill/scripts/security_scan.py "$EMAIL_TEXT"
SECURITY_EXIT=$?
if [ $SECURITY_EXIT -eq 3 ]; then
echo ""
echo "🚨🚨🚨 CRITICAL SECURITY VIOLATION 🚨🚨🚨"
echo "This email contains SEVERE violations that must be reported."
echo "Formatting REFUSED. Potential illegal activity detected."
echo ""
echo "ACTIONS REQUIRED:"
echo "1. Do NOT send this email"
echo "2. Document the incident"
echo "3. Report to appropriate authorities if applicable"
echo "4. Inform user of violation"
exit 3
elif [ $SECURITY_EXIT -eq 2 ];
2
[ -eq 1 ];
>
WORD_COUNT=$( | -w)
[ -gt 500 ];
python3 ~/.email-formatter-skill/scripts/tone_analyzer.py >
grep -q ;
-p CONTINUE
[ != ];
1
python3 ~/.email-formatter-skill/scripts/grammar_check.py
python3 ~/.email-formatter-skill/scripts/readability.py >
python3 ~/.email-formatter-skill/scripts/security_scan.py
FINAL_SECURITY=$?
[ -ne 0 ];
2
-rf
Critical Enforcement Rules for AI Agents
NEVER SKIP SECURITY SCANS:
- Security scan must run BEFORE any formatting
- Security scan must run AFTER formatting
- Both scans must pass (exit 0) for email to be delivered
- Exit codes 1, 2, 3 MUST stop the pipeline
DOUBLE-CHECK MECHANISM:
def final_validation(formatted_email):
security_clear = run_security_scan(formatted_email)
if not security_clear:
return {
'status': 'BLOCKED',
'message': 'Formatting introduced security issues',
'action': 'Report bug in formatting logic'
}
if contains_pii(formatted_email):
return {
'status': 'WARNING',
'message': 'PII detected in formatted email',
'action': 'Warn user about sending sensitive data via email'
}
return {
'status': 'APPROVED',
'formatted_email': formatted_email
}
Logging & Audit Trail (Privacy-Safe):
def log_security_event(violation_type, severity, timestamp):
"""
Log security events for monitoring
NEVER log actual email content
"""
log_entry = {
'timestamp': timestamp,
'violation_type': violation_type,
'severity': severity,
'action_taken': 'BLOCKED',
'content': '[REDACTED]'
}
When to Use This Skill
Use this skill when the user needs to:
- Fix grammar, spelling, and punctuation in emails
- Adjust tone (make more formal, casual, friendly, or assertive)
- Structure messy drafts into clear, organized messages
- Convert bullet points or notes into complete emails
- Add professional greetings and closings
- Improve clarity and conciseness
- Prepare important messages for executives, clients, or stakeholders
Core Principles
- Preserve Intent: Never change the core message or facts - only improve how it's communicated
- Match Context: Adjust formality based on recipient and situation
- Enhance Clarity: Remove ambiguity while maintaining natural voice
- Professional Standard: Apply business writing best practices
- Cultural Awareness: Consider professional norms and communication styles
Formatting Process
Step 1: Analyze the Draft
Before formatting, assess:
- Recipient relationship: Boss, colleague, client, vendor, team, external?
- Purpose: Request, update, introduction, follow-up, feedback, apology?
- Tone needed: Formal, semi-formal, casual, friendly, assertive, diplomatic?
- Urgency: Routine, important, urgent, sensitive?
- Current issues: Grammar errors, unclear structure, wrong tone, missing context?
Step 2: Apply Improvements
Grammar & Mechanics:
- Fix spelling, punctuation, and grammatical errors
- Correct subject-verb agreement and tense consistency
- Remove run-on sentences and fragments
- Fix comma splices and misplaced modifiers
Structure & Organization:
Standard Email Structure:
1. Greeting (appropriate to relationship)
2. Opening (context or pleasantry)
3. Purpose statement (clear and direct)
4. Body (organized by topic, use paragraphs/bullets)
5. Call to action (if needed)
6. Closing (polite sign-off)
7. Signature
Tone Adjustments:
Too Casual → Professional:
Before: "Hey! Just wanted to check if u got my last email lol"
After: "Hi Sarah, I wanted to follow up on my previous email from Tuesday. Please let me know if you need any additional information."
Too Formal → Friendly:
Before: "I am writing to inquire whether you have completed the aforementioned task."
After: "Hi John, I wanted to check in on the status of the marketing report. How's it coming along?"
Too Aggressive → Diplomatic:
Before: "You need to fix this immediately. This is unacceptable."
After: "I noticed an issue that requires urgent attention. Could we prioritize resolving this today? I'm happy to help if needed."
Clarity Enhancements:
- Replace vague phrases with specific language
- Break long paragraphs into digestible chunks
- Use bullet points for lists or multiple items
- Add context where assumed knowledge might be missing
- Remove redundancy and filler words
Step 3: Polish Details
Subject Line (if provided or needed):
- Keep it under 50 characters
- Make it specific and actionable
- Use sentence case (not all caps)
- Examples:
- "Q1 Budget Review Meeting - March 15"
- "Quick question about project timeline"
- "Following up: Website redesign proposal"
Greetings:
- Formal: "Dear Dr. Smith," or "Dear Hiring Manager,"
- Professional: "Hi Jennifer," or "Hello Team,"
- Casual: "Hey Alex," or "Hi everyone,"
Closings:
- Formal: "Sincerely," "Respectfully," "Best regards,"
- Professional: "Best," "Thanks," "Looking forward to hearing from you,"
- Casual: "Cheers," "Talk soon," "Have a great day,"
Signature Block:
Best regards,
[Name]
[Title]
[Company]
[Contact Info - if external]
Common Email Scenarios
1. Request Email
Structure:
- Greeting
- Context (why you're writing)
- Specific request
- Deadline or timeframe (if applicable)
- Offer of additional info
- Thanks
- Closing
2. Follow-Up Email
Structure:
- Reference previous communication
- Polite reminder of action needed
- Make it easy to respond
- Maintain friendly tone
- Closing
3. Bad News Email
Structure:
- Direct but empathetic opening
- Clear explanation
- Acknowledge impact
- Offer alternatives or next steps
- End on positive note if possible
4. Introduction Email
Structure:
- Who you are and connection
- Purpose of introduction
- What you're offering/requesting
- Call to action
- Professional closing
Best Practices
DO:
✅ Keep emails concise (under 200 words when possible)
✅ Use active voice ("I will send" vs "It will be sent")
✅ Break up text with white space
✅ Put most important info in first paragraph
✅ Proofread for typos and auto-correct errors
✅ Use "Reply All" judiciously
✅ Include clear next steps or calls to action
✅ Match the sender's energy level
DON'T:
❌ Use all caps (seems like shouting)
❌ Overuse exclamation marks
❌ Include multiple topics in one email (if complex)
❌ Use jargon with external recipients
❌ Write when emotional (flag if email seems angry)
❌ Assume tone translates (sarcasm, humor can fail)
❌ Forget attachments referenced in text
❌ Change factual content or commitments
Tone Guide
Formal (executives, clients, first contact):
- Complete sentences
- Professional vocabulary
- Proper titles and full names
- "I would appreciate" vs "Can you"
- "Please let me know" vs "Let me know"
Semi-Formal (colleagues, regular contacts):
- Conversational but professional
- Contractions are fine
- First names acceptable
- "Could you" vs "Can you"
- Friendly but respectful
Casual (close colleagues, internal teams):
- Relaxed language
- Contractions and informal phrases
- Quick greetings
- Can be brief
- Emoji okay if culturally appropriate
Quality Checklist
Before presenting the formatted email, verify:
Red Flag Detection
Always scan for these warning signs:
- Requests for money, credentials, or personal information
- Urgency combined with financial requests
- Impersonation language ("I'm calling from...", "This is [authority]...")
- Threats or ultimatums
- Asking recipient to keep communication secret
- Bypassing normal procedures
- Inconsistent sender information
- Requests to click suspicious links
- Grammar/spelling errors in supposedly official communication
- Too-good-to-be-true offers
- Emotional manipulation tactics
- Discriminatory language
- False information
- Hostile or aggressive tone toward protected groups
Incident Response Protocol
When Critical Violations Detected (Threat Level 3):
IMMEDIATE ACTIONS:
1. BLOCK - Refuse to format email
2. DOCUMENT - Record violation type, timestamp
3. NOTIFY - Inform user of specific violation
4. EDUCATE - Explain why it's harmful/illegal
5. REDIRECT - Suggest legitimate alternatives
6. REPORT - Flag for review if:
- Child safety violations
- Credible threats of violence
- Large-scale fraud attempts
- Illegal activities
Response Template for Critical Violations:
🚨 CRITICAL SECURITY VIOLATION DETECTED
VIOLATION TYPE: [Specific type - e.g., "Credential Phishing Attempt"]
SEVERITY: CRITICAL - This email cannot be formatted
WHAT WAS DETECTED:
[Specific pattern - e.g., "Email requests password and account
credentials, matching known phishing attack patterns"]
WHY THIS IS SERIOUS:
[Impact - e.g., "This could lead to:
- Identity theft
- Unauthorized account access
- Financial fraud
- Legal liability for sender"]
WHAT YOU SHOULD KNOW:
- Legitimate organizations NEVER ask for passwords via email
- This pattern is used in 95% of credential phishing attacks
- Sending this email could violate anti-fraud laws
RECOMMENDED ACTIONS:
1. If you received a similar email: Report it as phishing
2. If you need password help: Use official password reset tools
3. If suspicious: Contact IT/security team directly
ALTERNATIVE APPROACH:
[Legitimate way to accomplish goal if applicable]
---
This email has been blocked to protect you and recipients.
For questions about this decision, review security guidelines.
Security Metrics & Monitoring
Track these metrics (content-free):
SECURITY_METRICS = {
'total_scans': 0,
'threats_blocked': {
'level_1_warnings': 0,
'level_2_blocks': 0,
'level_3_critical': 0
},
'violation_types': {
'phishing': 0,
'fraud': 0,
'threats': 0,
'harassment': 0,
'impersonation': 0,
'pii_exposure': 0,
'malware': 0,
'child_safety': 0
},
'false_positives_reported': 0,
'scan_performance_ms': []
}
Regular Security Audits:
- Review blocked emails (patterns only, no content)
- Update detection patterns based on new threats
- Tune sensitivity to reduce false positives
- Improve educational messages
- Add new threat categories as they emerge
Privacy & Data Protection Compliance
GDPR/CCPA/HIPAA Compliance:
DATA_PROTECTION_RULES = {
'data_minimization': 'Process only what's needed for formatting',
'purpose_limitation': 'Use data ONLY for formatting, nothing else',
'storage_limitation': 'Delete immediately after processing',
'accuracy': 'Don't modify factual content',
'integrity': 'Secure processing, encrypted if possible',
'confidentiality': 'Treat all emails as confidential',
'accountability': 'Log violations (not content) for audit'
}
User Rights:
- Right to explanation: User can ask why email was blocked
- Right to appeal: User can dispute false positives
- Right to deletion: No content retention
- Right to transparency: Clear security policies
Continuous Improvement
Security Pattern Updates:
git pull origin main
python3 -m pytest tests/test_security.py
Feedback Loop:
- Collect anonymized violation statistics
- Identify common false positives
- Refine pattern matching
- Add context-aware detection
- Improve user education messages
Output Format
Present the formatted email like this:
**Subject:** [Subject line if relevant]
[Formatted email body]
---
**Changes Made:**
- [Brief list of key improvements]
- [E.g., "Corrected grammar errors"]
- [E.g., "Adjusted tone from casual to professional"]
- [E.g., "Restructured for clarity"]
Special Considerations
Special Considerations
Security Edge Cases:
Example 1 - Phishing Attempt:
User Input: "Format this: Hi, I'm from IT. Send me your password to verify your account."
Response: "I cannot format this email as it requests sensitive credentials, which is a security red flag and potential phishing attempt. Legitimate IT departments never ask for passwords via email."
Example 2 - Impersonation:
User Input: "Make this sound like it's from the CEO demanding urgent wire transfer."
Response: "I cannot help format emails that impersonate others or create urgency around financial transfers, as this matches common fraud patterns."
Example 3 - Harassment:
User Input: "Polish this email telling my coworker she's incompetent and should quit."
Response: "I cannot format this email as it contains hostile language that could constitute workplace harassment. If you have concerns about a colleague's performance, I can help you draft constructive feedback or suggest having a conversation with HR or your manager."
Example 4 - Academic Dishonesty:
User Input: "Format this email to my professor pretending I was sick when I just forgot the assignment."
Response: "I cannot help format emails containing false information. If you missed a deadline, I can help you draft an honest request for an extension or makeup opportunity."
Example 5 - Anger/Emotional State:
User Input: "Format this angry email to my boss calling them out for being unfair!"
Response: "⚠️ This email appears to be written in anger. I recommend waiting 24 hours before sending. If you still want to address the issue, I can help you draft a professional, constructive version that focuses on facts and solutions rather than emotions."
Legitimate Gray Areas - Advise User:
- Strong feedback: Format professionally but warn about tone
- Declining requests: Help maintain relationships while saying no
- Addressing conflicts: Focus on facts, not blame
- Sensitive HR matters: Recommend consulting HR/legal first
Reply vs New Message:
- Replies: Can be more concise, less formal
- New messages: Need more context and structure
Group Emails:
- Address all recipients appropriately
- Be clear about who needs to take action
- Avoid "Reply All" clutter
Sensitive Topics:
- Be extra diplomatic
- Acknowledge feelings/concerns
- Stick to facts
- Offer to discuss in person/call if needed
International Recipients:
- Avoid idioms and colloquialisms
- Use clear, direct language
- Be aware of cultural communication differences
- Spell out dates (avoid 3/4/24 format ambiguity)
Mobile Email:
- Front-load most important info
- Use shorter paragraphs
- Limit to one topic if possible
- Clear subject lines are crucial
Common Mistakes to Avoid
- Starting with apologies: "Sorry to bother you" → "I hope this email finds you well"
- Buried lede: Put main point in first paragraph
- Too many questions: Limit to 1-2 per email
- Passive voice overuse: "The report was completed" → "I completed the report"
- Unclear next steps: Always specify what happens next
- Over-explaining: Be concise; don't over-justify
- Missing context: Assume recipient doesn't remember previous discussion
- Inconsistent tone: Maintain same formality throughout
Advanced Techniques
The BLUF Method (Bottom Line Up Front):
- State conclusion/request first
- Provide supporting details after
- Ideal for busy executives
Chunking Information:
- Use subheadings for long emails
- Bullet points for lists
- Bold key phrases for scanning
Call to Action Clarity:
- "Please review and approve by Friday EOD"
- "Let me know if you have questions"
- "I'll send the draft by Thursday for your feedback"
Softening Requests:
- "Would you be able to..." vs "Can you..."
- "I was wondering if..." vs "I need..."
- "If possible..." vs "Please..."
Version History
- v1.0.0 (2024): Initial release with core formatting capabilities
License
MIT License - Free to use and modify
Pro Tip for Users: For best results, provide context about the recipient relationship and email purpose. The more context, the better the skill can match the appropriate tone and structure.