import type { EmailCategory } from "./schema.js";
export interface EmailStyleGuide {
tone: string;
guidelines: string[];
example: string;
}
export const emailStyleGuides: Record<EmailCategory, EmailStyleGuide> = {
urgent: {
tone: "Professional, immediate, action-oriented",
guidelines: [
"Acknowledge the urgency immediately",
"Provide a clear timeline for response or action",
"Be concise and direct",
"Confirm you understand the priority",
"Avoid unnecessary pleasantries",
],
example: `Hi [Name],
I've received your urgent message and understand the time-sensitive nature.
I'm prioritizing this now and will [specific action] by [timeframe].
I'll update you as soon as [milestone].
Best regards,
[Your name]`,
},
newsletter: {
tone: "Polite but brief, professional",
guidelines: [
"Keep it very short - newsletters don't expect detailed replies",
"Only reply if there's a specific action item or question",
"Use this as a template for unsubscribe requests if needed",
"Acknowledge the content only if genuinely interested",
"Default response: no reply needed",
],
example: `Hi,
Thanks for the update. I appreciate the information.
Best,
[Your name]
---
OR for unsubscribe:
Hi,
Please remove me from this mailing list.
Thank you,
[Your name]`,
},
work: {
tone: "Professional, collaborative, clear",
guidelines: [
"Address the sender by name",
"Reference specific points from their email",
"Provide concrete next steps or deliverables",
"Set clear expectations for follow-up",
"Use professional but approachable language",
"Include relevant context or background if needed",
],
example: `Hi [Name],
Thanks for reaching out about [topic].
I've reviewed [specific item] and here's my thoughts:
- [Point 1]
- [Point 2]
I'll [specific action] by [date/time]. Let me know if you need anything else in the meantime.
Best regards,
[Your name]`,
},
personal: {
tone: "Warm, friendly, conversational",
guidelines: [
"Use casual, natural language",
"Match the sender's tone and energy",
"Include personal touches or references",
"Ask follow-up questions to show interest",
"Be genuine and warm",
"Keep it conversational, not formal",
],
example: `Hey [Name]!
Great to hear from you! Hope you're doing well.
[Respond to their main points naturally]
[Ask a question or share something relevant]
Would love to catch up more soon!
Best,
[Your name]`,
},
unknown: {
tone: "Neutral, cautious, non-committal",
guidelines: ["Maintain a polite tone"],
example: `Hi [Name]`,
},
};
/**
* Get the style guide prompt for a specific category
*/
export function getStyleGuidePrompt(category: EmailCategory): string {
const guide = emailStyleGuides[category];
return `You are drafting a reply to a ${category} email.
TONE: ${guide.tone}
GUIDELINES:
${guide.guidelines.map((g, i) => `${i + 1}. ${g}`).join("\n")}
EXAMPLE FORMAT:
${guide.example}
Now draft a reply following these guidelines.`;
}