skills/inbox-triage/SKILL.md
AI-powered email prioritization and triage system. Automatically classifies emails by category and priority, with bulk actions and undo support.
npx skillsauth add ticruz38/skills inbox-triageInstall 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.
AI-powered email prioritization and triage system that automatically classifies emails by category and priority, helping you focus on what matters most.
npm install
npm run build
Requires the email skill to be configured:
# Connect your Google account with Gmail
node ../google-oauth/dist/cli.js connect default gmail
# Check system health
node dist/cli.js status
node dist/cli.js health
# Classify and sort inbox by priority
node dist/cli.js triage
# Limit to top 10 emails
node dist/cli.js triage 10
node dist/cli.js classify <message-id>
# View urgent emails
node dist/cli.js category urgent
# View promotional emails
node dist/cli.js category promotional 50
# View critical priority emails
node dist/cli.js priority critical
# View high priority
node dist/cli.js priority high 20
# List unreviewed emails
node dist/cli.js unreviewed
# Mark specific email as reviewed
node dist/cli.js mark-reviewed <message-id>
# Manually correct classification
node dist/cli.js set-category <message-id> important
node dist/cli.js set-priority <message-id> high
# Archive multiple emails
node dist/cli.js archive <id1> <id2> <id3>
# Mark as read
node dist/cli.js mark-read <id1> <id2>
# Move to trash
node dist/cli.js trash <id1> <id2>
# Undo last bulk action
node dist/cli.js undo
# Add rule for specific sender
node dist/cli.js add-rule [email protected] urgent critical
node dist/cli.js add-rule [email protected] newsletter low
# List all rules
node dist/cli.js rules
# Delete rule
node dist/cli.js delete-rule [email protected]
# View triage statistics
node dist/cli.js stats
import { InboxTriageSkill } from '@openclaw/inbox-triage';
const triage = new InboxTriageSkill();
// Or for specific profile
const workTriage = InboxTriageSkill.forProfile('work');
const results = await triage.classifyInbox(50);
for (const result of results) {
console.log(`${result.email.subject}: ${result.classification.priority}`);
console.log(` Category: ${result.classification.category}`);
console.log(` Score: ${result.classification.priorityScore}`);
console.log(` Action: ${result.classification.actionSuggested}`);
}
const classification = await triage.classify('message-id');
console.log('Category:', classification.category);
console.log('Priority:', classification.priority);
console.log('Confidence:', classification.confidence);
console.log('Reasons:', classification.reasons);
// Get important emails
const important = await triage.listByCategory('important', 20);
// Get critical priority
const critical = await triage.listByPriority('critical');
// Get unreviewed
const unreviewed = await triage.getUnreviewed(50);
// Mark as reviewed (no changes)
await triage.review('message-id', {});
// Correct classification
await triage.review('message-id', {
category: 'important',
priority: 'high'
});
// Archive multiple emails
const result = await triage.bulkArchive(['id1', 'id2', 'id3']);
console.log(`Archived ${result.success.length} emails`);
// Mark as read
await triage.bulkMarkAsRead(['id1', 'id2']);
// Move to trash
await triage.bulkTrash(['id1', 'id2']);
// Undo last action
await triage.undoLastAction();
// Add rule
await triage.addSenderRule(
'[email protected]',
'urgent',
'critical',
'notify_immediately'
);
// Get rule
const rule = await triage.getSenderRule('[email protected]');
// List all rules
const rules = await triage.listSenderRules();
// Delete rule
await triage.deleteSenderRule('[email protected]');
const stats = await triage.getStats();
console.log('Total classified:', stats.totalClassified);
console.log('Unreviewed:', stats.unreviewed);
console.log('By category:', stats.byCategory);
console.log('By priority:', stats.byPriority);
| Category | Description |
|----------|-------------|
| urgent | Time-sensitive, requires immediate attention |
| important | High-value emails requiring response |
| newsletter | Regular newsletters and digests |
| promotional | Sales, offers, marketing |
| social | Social media notifications |
| updates | System updates, changelogs |
| forums | Discussion forum updates |
| spam | Junk mail (should be rare) |
| unknown | Could not be classified |
| Priority | Score Range | Description |
|----------|-------------|-------------|
| critical | 80-100 | Reply immediately |
| high | 60-79 | Review today |
| medium | 40-59 | Review this week |
| low | 20-39 | Review when convenient |
| none | 0-19 | Can archive |
The skill uses a multi-factor scoring algorithm:
is:important and other labelsConfidence is calculated based on pattern matching strength.
Classification data is stored in:
~/.openclaw/skills/inbox-triage/{profile}.db
Tables:
classifications - Email classifications with metadatasender_rules - Custom rules per senderundo_actions - Bulk action history (24hr retention)action_history - Audit trail of manual reviewsimport { InboxTriageSkill } from '@openclaw/inbox-triage';
// Work account
const work = InboxTriageSkill.forProfile('work');
const workResults = await work.classifyInbox(20);
// Personal account
const personal = InboxTriageSkill.forProfile('personal');
const personalResults = await personal.classifyInbox(20);
Each profile maintains separate classifications and rules.
try {
await triage.classifyInbox(50);
} catch (error) {
if (error.message.includes('Not connected')) {
console.log('Please authenticate email skill first');
} else {
console.error('Error:', error.message);
}
}
# Type checking
npm run typecheck
# Build
npm run build
# Check health
npm run cli -- health
# Triage inbox
npm run cli -- triage 10
@openclaw/email: For Gmail accesssqlite3: Local 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.