skills/draft-responses/SKILL.md
Generate email reply suggestions with multiple tone options and context-aware drafting. Built on top of email skill for reading messages and sending replies.
npx skillsauth add ticruz38/skills draft-responsesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate email reply suggestions with multiple tone options, context-aware drafting, and one-click sending. Built on top of the email skill for seamless Gmail integration.
npm install
npm run build
Requires the email skill to be configured:
# Connect your Google account with Gmail scope
node ../google-oauth/dist/cli.js connect default gmail
# Check system health and email skill connection
node dist/cli.js health
# Generate drafts for an email (default tones: professional, friendly)
node dist/cli.js generate <email-id>
# Generate with specific tones
node dist/cli.js generate <email-id> --tones professional,casual
# Generate more drafts
node dist/cli.js generate <email-id> --count 4
# Generate without thread context
node dist/cli.js generate <email-id> --no-context
# List all drafts
node dist/cli.js drafts
# List drafts for specific email
node dist/cli.js drafts <email-id>
# Limit results
node dist/cli.js drafts --limit 10
# Send a draft by ID
node dist/cli.js send <draft-id>
# Delete a draft by ID
node dist/cli.js delete <draft-id>
# List available templates
node dist/cli.js templates
# Filter by category
node dist/cli.js templates --category meetings
# Apply a template
node dist/cli.js template thank-you --variables '{"name":"John","reason":"your help"}'
# View available tones
node dist/cli.js tones
# Show usage statistics
node dist/cli.js stats
import { DraftResponsesSkill } from '@openclaw/draft-responses';
// Create skill for default profile
const drafts = new DraftResponsesSkill();
// Or for specific profile
const workDrafts = new DraftResponsesSkill('work');
// Generate drafts for an email
const drafts = await drafts.generateDrafts('email-message-id', {
tones: ['professional', 'friendly'],
count: 3,
useThreadContext: true
});
for (const draft of drafts) {
console.log(`Tone: ${draft.tone}`);
console.log(`Draft:\n${draft.draft}`);
console.log(`---`);
}
// Send a draft by its ID
const result = await drafts.sendDraft(1);
if (result.success) {
console.log('Sent:', result.message);
}
// Get a template
const template = await drafts.getTemplate('thank-you');
// Apply with variables
const response = drafts.applyTemplate(template, {
name: 'John',
reason: 'your help with the project'
});
console.log(response);
const tones = drafts.getAvailableTones();
// ['professional', 'casual', 'friendly', 'formal',
// 'enthusiastic', 'empathetic', 'authoritative', 'witty']
// Get drafts for a specific email
const emailDrafts = await drafts.getDraftsForEmail('email-message-id');
// Get all drafts
const allDrafts = await drafts.getAllDrafts(50);
// Get statistics
const stats = await drafts.getStats();
console.log(`Generated: ${stats.totalDrafts}, Sent: ${stats.sentDrafts}`);
const health = await drafts.healthCheck();
if (health.status === 'healthy') {
console.log('Ready to generate drafts');
}
| Tone | Description |
|------|-------------|
| professional | Clear, business-appropriate language. Concise and respectful. |
| casual | Relaxed, conversational style. Uses contractions and everyday language. |
| friendly | Warm and approachable. Inclusive language and positive expressions. |
| formal | Proper grammar and sophisticated vocabulary. No contractions or slang. |
| enthusiastic | Shows excitement and energy. Positive adjectives. |
| empathetic | Shows understanding and compassion. Acknowledges feelings. |
| authoritative | Demonstrates expertise and confidence. Strong statements. |
| witty | Clever and light humor where appropriate. |
| Template | Category | Description |
|----------|----------|-------------|
| thank-you | appreciation | Express gratitude |
| acknowledgment | general | Acknowledge receipt |
| follow-up | general | Follow up on conversation |
| meeting-accept | meetings | Accept meeting invitation |
| meeting-decline | meetings | Decline with alternative |
| information-request | general | Request more information |
| deadline-extension | general | Request deadline extension |
| apology | general | Professional apology |
Templates use {{variableName}} syntax for substitution:
const template = await drafts.getTemplate('thank-you');
const response = drafts.applyTemplate(template, {
name: 'Alice',
reason: 'the quick turnaround'
});
// Result:
// Hi Alice,
//
// Thank you so much for the quick turnaround. I really appreciate it!
//
// Best regards
The skill automatically analyzes incoming emails:
Draft history is stored in:
~/.openclaw/skills/draft-responses/drafts.db
Tables:
draft_suggestions - Generated drafts with metadataresponse_templates - Available templates// Work account
const work = new DraftResponsesSkill('work');
const workDrafts = await work.generateDrafts('email-id');
// Personal account
const personal = new DraftResponsesSkill('personal');
const personalDrafts = await personal.generateDrafts('email-id');
try {
const drafts = await drafts.generateDrafts('email-id');
} catch (error) {
if (error.message.includes('Not connected')) {
console.log('Please authenticate with google-oauth first');
} else if (error.message.includes('Email not found')) {
console.log('Invalid email ID');
} else {
console.error('Error:', error.message);
}
}
# Type checking
npm run typecheck
# Build
npm run build
# Check health
npm run cli -- health
# Generate drafts for an email
npm run cli -- generate <email-id>
# List templates
npm run cli -- templates
Authenticate with google-oauth first:
node ../google-oauth/dist/cli.js connect default gmail
Check the email ID is correct. Use the email skill to list emails:
node ../email/dist/cli.js list
@openclaw/email: For reading emails and sending repliessqlite3: Local draft storagetesting
Suggest recipes based on dietary preferences, available ingredients, and cuisine preferences
development
Extract data from receipt photos using Google Vision API
business
QuickBooks Online integration for accounting sync - sync customers, invoices, and transactions with two-way sync and conflict resolution
testing
QuickBooks OAuth adapter for QuickBooks Online accounting integration. Built on top of auth-provider for secure token management with automatic refresh, multi-profile support, sandbox/production toggle, and health checks.