Creates event-driven email listeners that monitor for specific conditions (like urgent emails from boss, newsletters to archive, package tracking) and execute custom actions. Use when user wants to be notified about emails, automatically handle certain emails, or set up email automation workflows.
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "listener-creator" 技能: 1. 下载 https://raw.githubusercontent.com/anthropics/claude-agent-sdk-demos/main/email-agent/agent/.claude/skills/listener-creator/SKILL.md 2. 保存为 ~/.claude/skills/listener-creator/SKILL.md 3. 装好后重载技能,告诉我可以用了
Creates TypeScript listener files that monitor email events and execute custom logic when conditions are met.
Use this skill when the user wants to:
Listeners are TypeScript files in agent/custom_scripts/listeners/ that:
config object defining the event type and metadatahandler function that filters and processes eventsListenerContext methods to perform actions (notify, archive, star, etc.)The system automatically loads enabled listeners and executes them when matching events occur.
Parse the user's request to identify:
// Available event types:
- "email_received" // Most common - new email arrives
- "email_sent" // User sends an email
- "email_starred" // Email is starred
- "email_archived" // Email is archived
- "email_labeled" // Label added to email
- "scheduled_time" // Time-based (cron) - requires scheduler setup
Create a file in agent/custom_scripts/listeners/ with this structure:
import type { ListenerConfig, Email, ListenerContext } from "../types";
export const config: ListenerConfig = {
id: "unique_listener_id", // kebab-case, descriptive
name: "Human Readable Name", // For UI display
description: "What this does", // Optional but helpful
enabled: true, // Start enabled
event: "email_received" // Event type
};
export async function handler(email: Email, context: ListenerContext): Promise<void> {
// 1. Basic filter (identity/sender only)
if (!email.from.includes("[email protected]")) return;
// 2. Use AI for intelligent classification (PREFERRED over keyword matching)
const analysis = await context.callAgent<{ isUrgent: boolean; reason: string }>({
prompt: `Is this email urgent?\nSubject: ${email.subject}\nBody: ${email.body.substring(0, 500)}`,
schema: {
type: "object",
properties: {
isUrgent: { type: "boolean" },
reason: { type: "string" }
},
required: ["isUrgent", "reason"]
},
model: "haiku"
});
if (!analysis.isUrgent) return;
// 3. Perform actions via context methods
await context.notify(`Urgent email: ${email.subject}\n${analysis.reason}`, {
priority: "high"
});
await context.starEmail(email.messageId);
}
Use kebab-case matching the listener's purpose:
boss-urgent-watcher.tsauto-archive-newsletters.tspackage-tracking.tsdaily-summary.tsThe ListenerContext provides these methods:
// Notifications
await context.notify(message, { priority: "high" | "normal" | "low" });
// Email actions
await context.archiveEmail(emailId);
await context.starEmail(emailId);
await context.unstarEmail(emailId);
await context.markAsRead(emailId);
await context.markAsUnread(emailId);
await context.addLabel(emailId, "label-name");
await context.removeLabel(emailId, "label-name");
// AI-powered analysis
const result = await context.callAgent<ResultType>({
prompt: "Your prompt with email content",
schema: {
type: "object",
…
Creates user-specific one-click action templates that execute email operations when clicked in the chat interface. Use when user wants reusable actions for their specific workflows (send payment reminder to ACME Corp, forward bugs to engineering, archive old newsletters from specific sources).
Transforms research findings into executive-ready briefings. Automatically activated when user mentions 'executive', 'briefing', 'C-suite', 'board', 'leadership', or 'presentation'.
在分享分析结论前,检查方法、计算、偏差与结论是否可靠
生成人员规模、流失率、多元化与组织健康等人力分析报告
帮助识别、分类并排序技术债,明确重构与代码健康改进优先级。
帮助你为具体产品场景选择合适的 Zoom 能力层,并清晰说明技术取舍。