Gog email draft

From evolution-foundation/evo-nexus · View interactive version

Gog email draft is an AI agent skill from the GitHub repository evolution-foundation/evo-nexus. Draft email replies and compose new messages. Given email ID(s) or message context, generate professional email drafts in user's preferred tone. Offers multiple variants (concise, warmer) and includes assumptions/questions for confirmation. Use when user wants to reply to emails, compose new message

How to use this skill

Skill file

Email Drafting Assistant

Generate professional, context-aware email drafts with tone variants and confirmation prompts.

When to Use

Use this skill when:

Important: This skill creates DRAFTS only. It NEVER sends emails. Use gog-email-send skill for sending (with explicit confirmation).

Inputs You Need

Before drafting, gather:

1. Email Context (choose one)

Option A - Reply to existing email(s):

Option B - Compose new email:

2. User's Tone Preference

If not previously known, ask:

What tone would you like for this email?
- Professional (formal, business-standard)
- Friendly (warm but professional)
- Concise (brief and to-the-point)
- Detailed (thorough, includes context)

Or describe your preferred style.

Remember preference for future drafts in the session.

3. Missing Information

Identify what's needed to draft effectively:

Ask clarifying questions before drafting if critical info is missing.

Workflow

Step 1: Fetch Original Email (if replying)

For replies:

gog gmail get <email_id> --json

Parse:

If email has a thread, consider reading previous messages in thread for context.

Step 2: Identify Required Content

Analyze what the reply should address:

Questions asked: Direct questions that need answers

Action items: Tasks or requests that need response

Context needed: Background or explanation to provide

Next steps: Proposed follow-up or timeline

Tone match: Match or adjust based on sender's tone

Step 3: Draft Initial Assumptions

Before drafting, list assumptions being made:

## Assumptions

- [Assumption 1: e.g., Budget is approved for this project]
- [Assumption 2: e.g., Timeline of 2 weeks is acceptable]
- [Assumption 3: e.g., Legal review is not required]
- [...]

Step 4: Draft Questions for User

List clarifying questions if any:

## Questions to Confirm

1. [Question 1: e.g., Should we include pricing in this email?]
2. [Question 2: e.g., Do you want to propose a specific meeting time?]
3. [Question 3: e.g., Is there a deadline we should mention?]

If questions are critical, ask now and wait for answers. If minor, include in output for user to address.

Step 5: Generate Draft Variants

Create TWO versions:

Variant A: Concise

Variant B: Warmer/Detailed

Step 6: Present Drafts

Output in this format:

# Email Draft: [Subject]

**To**: [recipient(s)]
**CC**: [if applicable]
**Subject**: [subject line]

---

## Variant A: Concise

[Draft text here]

---

## Variant B: Warmer

[Draft text here]

---

## Assumptions

- [List assumptions made]

## Questions to Confirm

1. [List questions if any]

---

**Next Steps**:
- Edit either variant as needed
- Confirm assumptions are correct
- Answer any questions listed
- When ready: "Send this draft" (will invoke gog-email-send with confirmation)

Step 7: Iterative Refinement

After presenting drafts:

Iterate until user is satisfied.

When user approves final draft, offer:

Ready to send? Say "Save as draft" to create in GOG, or "Send this email" to proceed with sending (requires explicit confirmation).

Step 8: Save Draft in GOG

When user says "Save as draft" or "Create draft":

# Create draft body file first
cat > /tmp/draft_body.txt << 'EOF'
[Draft email body content]
EOF

# Create draft
gog gmail drafts create \
  --to "recipient@example.com" \
  --cc "cc@example.com" \
  --subject "Subject line" \
  --body /tmp/draft_body.txt \
  --json

# Clean up temp file
rm /tmp/draft_body.txt

Note: Reply threading is handled automatically by Gmail when replying to a thread. If creating a standalone draft, omit reply-related flags.

Return draft ID to user:

✅ Draft created successfully!
Draft ID: draft_abc123

You can:
- Review it in your email client
- Edit it further there
- Send it via: "Send draft draft_abc123"

Output Format (Strict)

Every draft output MUST include:

  1. Header: To, CC (if any), Subject
  2. Variant A: Concise version
  3. Variant B: Warmer/detailed version
  4. Assumptions: Bulleted list of assumptions
  5. Questions: Numbered list (or "None" if all info is clear)
  6. Next steps: Clear guidance on what to do next

Email body format:

Examples

Example 1: Reply to Meeting Request

User: "Draft a reply to email msg_abc123"

Assistant:

[Fetches email msg_abc123...]

Original email from sarah@company.com:
"Hi, can we schedule a meeting to discuss Q2 budget? I'm available Tuesday or Thursday afternoon."

---

# Email Draft: Re: Q2 Budget Meeting

**To**: sarah@company.com
**Subject**: Re: Q2 Budget Meeting

---

## Variant A: Concise

Hi Sarah,

Tuesday afternoon works for me. How about 2pm? I'll send a calendar invite.

Thanks,

---

## Variant B: Warmer

Hi Sarah,

Thanks for reaching out about the Q2 budget discussion. I'd be happy to meet.

Tuesday afternoon works well for me. Would 2pm work for you? I can send a calendar invite with a Zoom link if that's convenient, or we can meet in person if you prefer.

Looking forward to discussing the budget plans!

Thanks,

---

## Assumptions

- 2pm is a reasonable time for "afternoon"
- Virtual meeting is acceptable (can offer in-person)
- User has authority to discuss Q2 budget

## Questions to Confirm

1. Do you have any specific time preferences for Tuesday afternoon?
2. Should I propose an agenda or specific topics to cover?

---

**Next Steps**: Which variant do you prefer, or would you like me to adjust anything?

Example 2: Compose New Email

User: "Compose an email to vendor@acme.com asking about the pricing proposal status"

Assistant:

# Email Draft: Pricing Proposal Follow-up

**To**: vendor@acme.com
**Subject**: Following up on pricing proposal

---

## Variant A: Concise

Hi [Vendor Name],

I wanted to follow up on the pricing proposal we discussed. Have you had a chance to review it?

Please let me know if you need any additional information.

Thanks,

---

## Variant B: Warmer

Hi [Vendor Name],

I hope this email finds you well. I wanted to check in regarding the pricing proposal we sent over on [date, if known].

We're working on finalizing our Q2 budget and would greatly appreciate an update on where things stand. If you need any clarification or additional details from our side, please don't hesitate to reach out.

Thank you for your time, and I look forward to hearing from you soon.

Best regards,

---

## Assumptions

- Vendor contact name is known (replace [Vendor Name])
- Previous proposal was sent and vendor is aware of it
- There's no hard deadline pressuring the follow-up

## Questions to Confirm

1. Do you know the vendor contact's name? (Replace [Vendor Name])
2. When was the original proposal sent? (Can mention specific date)
3. Is there a deadline by which you need their response?
4. Should I mention the next steps if they accept?

---

**Next Steps**: Please provide the vendor contact's name and any other details, then I can finalize the draft.

Example 3: Multiple Drafts

User: "Draft replies for emails msg_123 and msg_456"

Assistant:

Let me draft replies for both emails.

---

# Draft 1: Re: [Subject of msg_123]

[Full draft for email 1...]

---

# Draft 2: Re: [Subject of msg_456]

[Full draft for email 2...]

---

Would you like to review and refine these individually, or are they ready to save as drafts?

Failure Modes / Troubleshooting

Cannot Fetch Original Email

Symptom: gog gmail get <messageId> fails or returns error

Resolution:

  1. Verify message ID is correct (ask user to confirm)
  2. Check if email was deleted or moved
  3. Try fetching full thread: gog gmail thread get <threadId>
  4. Ask user to describe email context manually

Missing Critical Information

Symptom: Cannot draft effectively without key facts

Resolution:

  1. List what's missing in "Questions to Confirm"
  2. Suggest: "I need more information to draft this effectively. Can you provide [X, Y, Z]?"
  3. Offer placeholder draft: "Here's a template you can fill in..."
  4. Do NOT guess facts (dates, numbers, commitments)

Tone Mismatch

Symptom: User says "Too formal" or "Too casual"

Resolution:

  1. Ask: "What tone would you prefer? More [formal/casual/friendly/brief]?"
  2. Regenerate with adjusted tone
  3. Learn preference for future drafts in session

Large Email Threads

Symptom: Original email is part of long thread

Resolution:

  1. Summarize thread context: "This is part of a 12-message thread about [topic]"
  2. Ask: "Should the reply reference earlier messages?"
  3. Focus reply on most recent message unless user requests broader context

Multiple Recipients / Reply-All Ambiguity

Symptom: Original email has many recipients

Resolution:

  1. Default to "Reply" (sender only) unless clear that Reply-All is needed
  2. Ask: "Should this be Reply-All (to all [N] recipients) or just to [sender]?"
  3. List recipients so user can decide

Safety Rules

  1. Never send emails - Only create drafts
  2. Always show drafts first - Never create drafts without user seeing content
  3. Explicit confirmation for saving - Ask "Ready to save this draft?" before invoking gog gmail drafts create
  4. Protect sensitive info - Don't include passwords, credentials, or highly sensitive data unless explicitly instructed
  5. Two-variant rule - Always offer Concise + Warmer variants (user choice improves over time)
  6. Assumptions transparency - Always list assumptions so user can catch errors

Safe Test

To safely test this skill using only user@example.com:

Test 1: Draft to self (safe)

In Claude Code:

  1. Load gog-email-draft skill
  2. Say: "Compose an email to user@example.com with subject 'Test Draft' and a brief greeting"
  3. Verify output includes:
  1. Say: "Save as draft"
  2. Verify draft is created via gog gmail drafts create command
  3. Confirm draft is NOT sent

Test 2: Reply to self (safe)

  1. Send yourself an email first (or use existing)
  2. Get email ID: gog gmail search "from:user@example.com" --max 1 --json
  3. Say: "Draft a reply to [email_id]"
  4. Verify skill fetches original email and generates appropriate reply

See skills/gog/_shared/references/testing.md for complete test plan.

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.