Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问许可证需确认审计提醒

listener-creator听众创造者

Agent Skill

listener-creator 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,640

周安装

67

GitHub Stars

2,313

下载量

531
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:listener-creator(听众创造者)
来源仓库:https://github.com/anthropics/claude-agent-sdk-demos
仓库路径:skills/listener-creator
安装命令:
npx skills add https://github.com/anthropics/claude-agent-sdk-demos --skill listener-creator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/anthropics/claude-agent-sdk-demos --skill listener-creator

简介

listener-creator 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态或协作事项进行整理。
  • 通过 npx 命令从指定 GitHub 仓库安装并使用。
  • 使用前需确认权限范围、维护状态及是否涉及联网或文件操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Listener Creator

Creates TypeScript listener files that monitor email events and execute custom logic when conditions are met.

When to Use This Skill

Use this skill when the user wants to:

  • Get notifications about specific emails ("notify me when boss sends urgent emails")
  • Automatically handle certain emails ("auto-archive newsletters")
  • Monitor for patterns ("watch for package tracking emails")
  • Set up scheduled actions ("daily email summary at 9am")
  • Create custom email workflows

How Listeners Work

Listeners are TypeScript files in agent/custom_scripts/listeners/ that:

  1. Export a config object defining the event type and metadata
  2. Export a handler function that filters and processes events
  3. Use ListenerContext methods to perform actions (notify, archive, star, etc.)

The system automatically loads enabled listeners and executes them when matching events occur.

Creating a Listener

1. Understand the User's Intent

Parse the user's request to identify:

  • Event type: What triggers this listener? (email_received, email_sent, email_starred, email_archived, email_labeled, scheduled_time)
  • Filter conditions: What specific emails/events to match? (sender, subject keywords, time-based)
  • Actions: What should happen? (notify, archive, star, mark as read, add label)
  • Priority: How urgent is this? (high/normal/low)

2. Choose an Event Type

// 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

3. Write the Listener File

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("example@email.com")) 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);
}

4. File Naming Convention

Use kebab-case matching the listener's purpose:

  • boss-urgent-watcher.ts
  • auto-archive-newsletters.ts
  • package-tracking.ts
  • daily-summary.ts

5. Available Context Methods

The 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",
    properties: { field: { type: "string" } },
    required: ["field"]
  },
  model: "haiku" // or "sonnet" or "opus"
});

Recommended Approach: AI-Powered Classification

Default to using context.callAgent() for intelligent decision-making instead of hard-coded keyword lists. This provides better accuracy and adaptability.

// PREFERRED: AI-based urgency detection
const analysis = await context.callAgent<{ isUrgent: boolean; reason: string }>({
  prompt: `Analyze if this email is urgent:
Subject: ${email.subject}
Body: ${email.body.substring(0, 500)}

Is this email urgent or time-sensitive? Consider context, not just keywords.`,

  schema: {
    type: "object",
    properties: {
      isUrgent: { type: "boolean" },
      reason: { type: "string" }
    },
    required: ["isUrgent", "reason"]
  },
  model: "haiku" // Fast and cost-effective
});

if (analysis.isUrgent) {
  await context.notify(`Urgent: ${email.subject}\n${analysis.reason}`);
}

// AVOID: Hard-coded keyword lists (brittle and prone to false positives)
// const isUrgent = subject.includes("urgent") || subject.includes("asap");

Examples and Templates

Reference the template files for common patterns:

Best Practices

  1. Prefer AI Classification: Use context.callAgent() instead of hard-coded keyword lists for intelligent decision-making
  2. Filter Early: Return early if email doesn't match basic criteria (like sender)
  3. Clear IDs: Use descriptive, unique listener IDs
  4. Error Handling: Wrap context method calls in try-catch when appropriate
  5. Performance: Use "haiku" model for fast AI classification (< 1 second typical)
  6. Notify Wisely: Only notify when truly important
  7. Avoid Hard-Coded Lists: Let AI determine urgency, importance, or categories instead of keyword matching

Type Imports

Always import types from the correct location:

import type { ListenerConfig, Email, ListenerContext } from "../types";

// For scheduled listeners:
import type { ListenerConfig, ListenerContext } from "../types";

// For labeled event:
import type { ListenerConfig, Email, ListenerContext } from "../types";

Common Patterns

AI-Powered (PREFERRED)

Basic filter (sender/type) → Call AI agent for intelligent classification → Act on AI result → Notify if important

This is the recommended approach for most listeners as it:

  • Avoids brittle keyword matching
  • Adapts to nuanced language and context
  • Makes better decisions about urgency and categorization
  • Reduces false positives

Simple Notification (Use sparingly)

Basic filter (sender only) → Notify → Optional star/label

Only use this when: The trigger is purely identity-based (e.g., "notify me about ALL emails from X")

Auto-Archive

Basic filter → Archive → Mark as read → Optional notify

Scheduled

Run at specific time → Query emails → Analyze → Send summary

Creating the File

When the user requests a listener:

  1. Ask clarifying questions if the intent is unclear:

- Who is the sender? What keywords? - What action should happen? - How urgent is this?

  1. Choose the right event type (usually email_received)
  2. Write the TypeScript file in agent/custom_scripts/listeners/
  3. Use Write tool to create the file with:

- Proper imports - Descriptive config - Handler with early filtering - Appropriate context method calls

  1. Return listener reference in markdown format using [listener:filename.ts] notation (e.g., [listener:boss-urgent-watcher.ts]) for easy parsing and linking in the UI
  2. Confirm with user that the listener matches their intent

Output Format Example

When presenting a created listener to the user, use this format:

Created listener: [listener:boss-urgent-watcher.ts]

This listener will:
- Monitor emails from boss@company.com
- Use AI to detect urgent emails (not just keywords)
- Send high-priority notifications for truly urgent emails
- Star emails that require immediate action

When to Use AI vs Simple Filtering

Use AI (context.callAgent()) when:

  • Detecting urgency, importance, or sentiment
  • Classifying email content or intent
  • Extracting structured data from email bodies
  • Making nuanced decisions based on context
  • Any logic that involves "understanding" the email content

Use simple filtering when:

  • Checking exact sender/recipient
  • Basic pattern matching on email fields (e.g., "from specific domain")
  • Identity-based triggers (e.g., "all emails from X person")

Default to AI unless the filter is purely identity-based.

Scheduled Listeners

For time-based actions (daily summaries, weekly reports):

export const config: ListenerConfig = {
  id: "daily_summary",
  name: "Daily Email Summary",
  enabled: true,
  event: "scheduled_time"
  // Note: Cron schedule configured separately in scheduler
};

export async function handler(
  data: { timestamp: Date },
  context: ListenerContext
): Promise<void> {
  // Your scheduled logic here
  await context.notify("Good morning! Your daily summary...");
}

Note: Scheduled listeners require cron scheduler configuration outside the listener file.

Reference

Full specification: See project root LISTENERS_SPEC.md for complete details on:

  • All event types
  • Complete type definitions
  • ListenersManager implementation
  • Advanced examples
  • Error handling patterns

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.92%
按下载量换算191

Claude

29.89%
按下载量换算159

Cursor

19.04%
按下载量换算101

Gemini CLI

8.21%
按下载量换算44

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills