Token导航 LogoToken导航TokenDH.com
开发操作浏览器github未标认证来源可访问许可证需确认审计提醒

emitting-api-eventsemitting API events 文档

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

792

周安装

34

GitHub Stars

2,104

下载量

277
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:emitting-api-events(emitting API events 文档)
来源仓库:https://github.com/jeremylongshore/claude-code-plugins-plus-skills
仓库路径:skills/emitting-api-events
安装命令:
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill emitting-api-events
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill emitting-api-events

简介

用于辅助 API 设计和接口文档编写。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

  • 适合事件驱动架构和 webhook 集成场景。
  • 需配置消息代理如 Redis 或 Kafka 基础设施。
  • 应避免凭空补字段,优先从现有代码中提取事实。
  • emitting-api-events 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Emitting API Events

Overview

Build event-driven API architectures using outbound webhooks, Server-Sent Events (SSE), and message broker integration. Implement event emission from API mutations, event schema registry, subscriber management, delivery guarantees with retry logic, and event sourcing patterns for maintaining a complete audit log of API state changes.

Prerequisites

  • Message broker: Redis Pub/Sub, RabbitMQ, Apache Kafka, or AWS SNS/SQS
  • Persistent storage for event log and subscriber registrations (PostgreSQL, MongoDB)
  • Webhook delivery infrastructure with retry queue (Bull, Celery, or managed service)
  • Event schema registry for versioned event type definitions
  • SSE-capable web framework for real-time event streaming to browser clients

Instructions

  1. Identify event-producing operations using Grep and Read, cataloging every API mutation (POST, PUT, PATCH, DELETE) that should emit events, with event type names following resource.action convention (e.g., order.created, user.updated).
  2. Define event schemas for each event type with versioning: include eventId (UUID), eventType, version, timestamp (ISO 8601), source (service identifier), and data (type-specific payload).
  3. Implement the event emitter service that publishes events to the message broker after successful API mutations, using the transactional outbox pattern to ensure events are not lost on application crash.
  4. Build a webhook subscription management API: POST /webhooks (subscribe), GET /webhooks (list), DELETE /webhooks/:id (unsubscribe), with URL validation, event type filtering, and signing secret generation.
  5. Implement webhook delivery with HMAC-SHA256 signed payloads, configurable retry policy (exponential backoff: 1min, 5min, 30min, 2hr, 24hr), and automatic subscription deactivation after consecutive failures.
  6. Add Server-Sent Events endpoint (GET /events/stream) for real-time event delivery to browser clients, with Last-Event-ID support for reconnection and missed event replay.
  7. Create a dead-letter queue for events that exhaust all delivery retry attempts, with alerting and manual replay capability.
  8. Write integration tests covering event emission, webhook delivery with signature verification, SSE stream connection with reconnection, and dead-letter queue behavior.

See ${CLAUDE_SKILL_DIR}/references/implementation.md for the full implementation guide.

Output

  • ${CLAUDE_SKILL_DIR}/src/events/emitter.js - Event emission service with outbox pattern
  • ${CLAUDE_SKILL_DIR}/src/events/schemas/ - Versioned event type schema definitions
  • ${CLAUDE_SKILL_DIR}/src/events/webhooks/ - Webhook delivery, signing, and retry logic
  • ${CLAUDE_SKILL_DIR}/src/events/sse.js - Server-Sent Events streaming endpoint
  • ${CLAUDE_SKILL_DIR}/src/routes/webhooks.js - Webhook subscription management API
  • ${CLAUDE_SKILL_DIR}/src/events/dead-letter.js - Dead-letter queue handler with replay
  • ${CLAUDE_SKILL_DIR}/tests/events/ - Event emission and delivery integration tests

Error Handling

ErrorCauseSolution
Event lost on crashApplication crashes between database commit and event publishUse transactional outbox pattern: write event to outbox table in same transaction, poll and publish separately
Webhook delivery failureSubscriber endpoint unreachable or returns non-2xxRetry with exponential backoff; deactivate subscription after 5 consecutive failures; notify subscriber admin
Event ordering violationConcurrent mutations publish events out of orderUse partition keys (resource ID) for ordered delivery within a partition; accept out-of-order across partitions
SSE connection memory leakServer accumulates stale SSE connections without cleanupImplement heartbeat comments (:keepalive\n\n) every 15 seconds; detect and close dead connections
Schema version mismatchConsumer expects v1 event format but receives v2Include version field in event envelope; support simultaneous v1/v2 delivery; deprecate old versions with notice

Refer to ${CLAUDE_SKILL_DIR}/references/errors.md for comprehensive error patterns.

Examples

Order lifecycle events: Emit order.created, order.payment_received, order.shipped, and order.delivered events with order details, enabling downstream services (warehouse, email, analytics) to react asynchronously.

SSE live notifications: Browser client connects to GET /events/stream?types=message.received,order.updated and receives real-time event updates with automatic reconnection and Last-Event-ID replay on network interruption.

Transactional outbox: Write the event record to an outbox table within the same database transaction as the API mutation, then poll the outbox table every 100ms to publish events to Kafka, ensuring at-least-once delivery.

See ${CLAUDE_SKILL_DIR}/references/examples.md for additional examples.

Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.56%
按下载量换算96

Claude

29.52%
按下载量换算82

Cursor

21.65%
按下载量换算60

Gemini CLI

10.88%
按下载量换算30

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

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

来源信息

继续浏览同类 Skills