[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H4FRRFKKNFBP9MQ3VQJSDX":3,"skill-same:01M6H4FRRFKKNFBP9MQ3VQJSDX":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":6,"ownerHtmlUrl":53,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":54,"install":55,"resources":68},"01M6H4FRRFKKNFBP9MQ3VQJSDX","emitting-api-events",null,"Build event-driven APIs with webhooks, Server-Sent Events, and real-time notifications.\nUse when building event-driven API architectures.\nTrigger with phrases like \"add webhooks\", \"implement events\", or \"create event-driven API\".","micsapp\u002Fmicstec-skills","micsapp","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F82411001?v=4","01M6GWCFQ6D3PV8EHNY62NN5VW","01M6GWCFVE1PA5HG0DKC7AMFJ3",4,"MIT","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fclaude-code\u002Fplugins-plus-skills\u002Fplugins\u002Fapi-development\u002Fapi-event-emitter\u002Fskills\u002Femitting-api-events\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"events","api","emitting api events","with","codex","event","event-driven","architectures","trigger","io","time","build","use","Bash","real-time","server","notifications","code","create","implement","2026-11-10 10:12:30",false,"---\nname: emitting-api-events\ndescription: |\n  Build event-driven APIs with webhooks, Server-Sent Events, and real-time notifications.\n  Use when building event-driven API architectures.\n  Trigger with phrases like \"add webhooks\", \"implement events\", or \"create event-driven API\".\n  \nallowed-tools: Read, Write, Edit, Grep, Glob, Bash(api:events-*)\nversion: 1.0.0\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\nlicense: MIT\ncompatible-with: claude-code, codex, openclaw\n---\n# Emitting API Events\n\n## Overview\n\nBuild 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.\n\n## Prerequisites\n\n- Message broker: Redis Pub\u002FSub, RabbitMQ, Apache Kafka, or AWS SNS\u002FSQS\n- Persistent storage for event log and subscriber registrations (PostgreSQL, MongoDB)\n- Webhook delivery infrastructure with retry queue (Bull, Celery, or managed service)\n- Event schema registry for versioned event type definitions\n- SSE-capable web framework for real-time event streaming to browser clients\n\n## Instructions\n\n1. 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`).\n2. 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).\n3. 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.\n4. Build a webhook subscription management API: `POST \u002Fwebhooks` (subscribe), `GET \u002Fwebhooks` (list), `DELETE \u002Fwebhooks\u002F:id` (unsubscribe), with URL validation, event type filtering, and signing secret generation.\n5. 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.\n6. Add Server-Sent Events endpoint (`GET \u002Fevents\u002Fstream`) for real-time event delivery to browser clients, with `Last-Event-ID` support for reconnection and missed event replay.\n7. Create a dead-letter queue for events that exhaust all delivery retry attempts, with alerting and manual replay capability.\n8. Write integration tests covering event emission, webhook delivery with signature verification, SSE stream connection with reconnection, and dead-letter queue behavior.\n\nSee `${CLAUDE_SKILL_DIR}\u002Freferences\u002Fimplementation.md` for the full implementation guide.\n\n## Output\n\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fevents\u002Femitter.js` - Event emission service with outbox pattern\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fevents\u002Fschemas\u002F` - Versioned event type schema definitions\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fevents\u002Fwebhooks\u002F` - Webhook delivery, signing, and retry logic\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fevents\u002Fsse.js` - Server-Sent Events streaming endpoint\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Froutes\u002Fwebhooks.js` - Webhook subscription management API\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fevents\u002Fdead-letter.js` - Dead-letter queue handler with replay\n- `${CLAUDE_SKILL_DIR}\u002Ftests\u002Fevents\u002F` - Event emission and delivery integration tests\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| Event lost on crash | Application crashes between database commit and event publish | Use transactional outbox pattern: write event to outbox table in same transaction, poll and publish separately |\n| Webhook delivery failure | Subscriber endpoint unreachable or returns non-2xx | Retry with exponential backoff; deactivate subscription after 5 consecutive failures; notify subscriber admin |\n| Event ordering violation | Concurrent mutations publish events out of order | Use partition keys (resource ID) for ordered delivery within a partition; accept out-of-order across partitions |\n| SSE connection memory leak | Server accumulates stale SSE connections without cleanup | Implement heartbeat comments (`:keepalive\\n\\n`) every 15 seconds; detect and close dead connections |\n| Schema version mismatch | Consumer expects v1 event format but receives v2 | Include `version` field in event envelope; support simultaneous v1\u002Fv2 delivery; deprecate old versions with notice |\n\nRefer to `${CLAUDE_SKILL_DIR}\u002Freferences\u002Ferrors.md` for comprehensive error patterns.\n\n## Examples\n\n**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.\n\n**SSE live notifications**: Browser client connects to `GET \u002Fevents\u002Fstream?types=message.received,order.updated` and receives real-time event updates with automatic reconnection and `Last-Event-ID` replay on network interruption.\n\n**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.\n\nSee `${CLAUDE_SKILL_DIR}\u002Freferences\u002Fexamples.md` for additional examples.\n\n## Resources\n\n- CloudEvents specification: https:\u002F\u002Fcloudevents.io\u002F\n- Server-Sent Events (MDN): https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FServer-sent_events\n- Transactional outbox pattern: Microservices.io\n- Webhook best practices: Standard Webhooks specification","# Emitting API Events\n\n## Overview\n\nBuild 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.\n\n## Prerequisites\n\n- Message broker: Redis Pub\u002FSub, RabbitMQ, Apache Kafka, or AWS SNS\u002FSQS\n- Persistent storage for event log and subscriber registrations (PostgreSQL, MongoDB)\n- Webhook delivery infrastructure with retry queue (Bull, Celery, or managed service)\n- Event schema registry for versioned event type definitions\n- SSE-capable web framework for real-time event streaming to browser clients\n\n## Instructions\n\n1. 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`).\n2. 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).\n3. 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.\n4. Build a webhook subscription management API: `POST \u002Fwebhooks` (subscribe), `GET \u002Fwebhooks` (list), `DELETE \u002Fwebhooks\u002F:id` (unsubscribe), with URL validation, event type filtering, and signing secret generation.\n5. 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.\n6. Add Server-Sent Events endpoint (`GET \u002Fevents\u002Fstream`) for real-time event delivery to browser clients, with `Last-Event-ID` support for reconnection and missed event replay.\n7. Create a dead-letter queue for events that exhaust all delivery retry attempts, with alerting and manual replay capability.\n8. Write integration tests covering event emission, webhook delivery with signature verification, SSE stream connection with reconnection, and dead-letter queue behavior.\n\nSee `${CLAUDE_SKILL_DIR}\u002Freferences\u002Fimplementation.md` for the full implementation guide.\n\n## Output\n\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fevents\u002Femitter.js` - Event emission service with outbox pattern\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fevents\u002Fschemas\u002F` - Versioned event type schema definitions\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fevents\u002Fwebhooks\u002F` - Webhook delivery, signing, and retry logic\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fevents\u002Fsse.js` - Server-Sent Events streaming endpoint\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Froutes\u002Fwebhooks.js` - Webhook subscription management API\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fevents\u002Fdead-letter.js` - Dead-letter queue handler with replay\n- `${CLAUDE_SKILL_DIR}\u002Ftests\u002Fevents\u002F` - Event emission and delivery integration tests\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| Event lost on crash | Application crashes between database commit and event publish | Use transactional outbox pattern: write event to outbox table in same transaction, poll and publish separately |\n| Webhook delivery failure | Subscriber endpoint unreachable or returns non-2xx | Retry with exponential backoff; deactivate subscription after 5 consecutive failures; notify subscriber admin |\n| Event ordering violation | Concurrent mutations publish events out of order | Use partition keys (resource ID) for ordered delivery within a partition; accept out-of-order across partitions |\n| SSE connection memory leak | Server accumulates stale SSE connections without cleanup | Implement heartbeat comments (`:keepalive\\n\\n`) every 15 seconds; detect and close dead connections |\n| Schema version mismatch | Consumer expects v1 event format but receives v2 | Include `version` field in event envelope; support simultaneous v1\u002Fv2 delivery; deprecate old versions with notice |\n\nRefer to `${CLAUDE_SKILL_DIR}\u002Freferences\u002Ferrors.md` for comprehensive error patterns.\n\n## Examples\n\n**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.\n\n**SSE live notifications**: Browser client connects to `GET \u002Fevents\u002Fstream?types=message.received,order.updated` and receives real-time event updates with automatic reconnection and `Last-Event-ID` replay on network interruption.\n\n**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.\n\nSee `${CLAUDE_SKILL_DIR}\u002Freferences\u002Fexamples.md` for additional examples.\n\n## Resources\n\n- CloudEvents specification: https:\u002F\u002Fcloudevents.io\u002F\n- Server-Sent Events (MDN): https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FServer-sent_events\n- Transactional outbox pattern: Microservices.io\n- Webhook best practices: Standard Webhooks specification",{"name":5,"author":43,"license":14,"version":44,"description":45,"allowed-tools":46,"compatible-with":47},"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Build event-driven APIs with webhooks, Server-Sent Events, and real-time notifications.\nUse when building event-driven API architectures.\nTrigger with phrases like \"add webhooks\", \"implement events\", or \"create event-driven API\".\n","Read, Write, Edit, Grep, Glob, Bash(api:events-*)","claude-code, codex, openclaw","master","3f5d983eb4ef375b749adcd6b07ec03bd82ae8a8","claude-code\u002Fplugins-plus-skills\u002Fplugins\u002Fapi-development\u002Fapi-event-emitter\u002Fskills\u002Femitting-api-events",0,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills","https:\u002F\u002Fgithub.com\u002Fmicsapp","2026-03-20 11:24:18",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add micsapp\u002Fmicstec-skills --skill emitting-api-events",{"tool":61,"command":62},"bunx","bunx skills add micsapp\u002Fmicstec-skills --skill emitting-api-events",{"tool":64,"command":65},"pnpm","pnpm dlx skills add micsapp\u002Fmicstec-skills --skill emitting-api-events","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fclaude-code\u002Fplugins-plus-skills\u002Fplugins\u002Fapi-development\u002Fapi-event-emitter\u002Fskills\u002Femitting-api-events\u002FSKILL.md",true,[69,75,79],{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Ferrors.md","REFERENCE","参考文档",901,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fclaude-code\u002Fplugins-plus-skills\u002Fplugins\u002Fapi-development\u002Fapi-event-emitter\u002Fskills\u002Femitting-api-events\u002Freferences\u002Ferrors.md",{"path":76,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fexamples.md",5488,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fclaude-code\u002Fplugins-plus-skills\u002Fplugins\u002Fapi-development\u002Fapi-event-emitter\u002Fskills\u002Femitting-api-events\u002Freferences\u002Fexamples.md",{"path":80,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fimplementation.md",1404,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fclaude-code\u002Fplugins-plus-skills\u002Fplugins\u002Fapi-development\u002Fapi-event-emitter\u002Fskills\u002Femitting-api-events\u002Freferences\u002Fimplementation.md",[84,110,131,150,168,192],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":38},"01M6HBTJ02FXBFG9NYEHHYAP52","azure-apim-architecture","Analyzes and explains Azure API Management architecture decisions for enterprise API marketplace implementations using VNet Internal mode, Front Door, hybrid authentication, and multi-environment strategies. Use when discussing APIM component selection, network topology, cost optimization, or comparing alternatives like workspaces vs instances, VNet Internal vs External mode, or Front Door vs Application Gateway.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fazure-apim-architecture\u002FSKILL.md",[],[91,92,93,94,95,96,97,98,99,19,100,101,102,103,104,105,106,107,108,109],"architecture","azure","azure apim architecture","component","authentication","gateway","topology","Optimization","network","team","environment","multi-environment","workspaces","instances","selection","strategies","azure api management","mode","for",{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":38},"01M6HBT7J4H082JEEA670B3EQ9","apiops-deployment","Guides deployment of Azure API Management infrastructure using Infrastructure as Code (Bicep\u002FTerraform), CI\u002FCD pipelines (GitHub Actions\u002FAzure DevOps), and APIOps workflows. Use when deploying APIM, creating pipelines, or implementing dev→test→prod promotion strategies.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapiops-deployment\u002FSKILL.md",[],[117,118,119,120,92,121,35,122,123,124,125,126,19,100,106,127,128,107,129,130],"deployment","apiops deployment","workflows","azure devops","infrastructure","infrastructure as code","actions","ci","github actions","github-actions","as","guides","CI\u002FCD","implementing",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":38},"01M6HBT2HEA23THNE9E00GYQBE","apim-policy-authoring","Creates production-ready Azure API Management policy XML for authentication (OAuth 2.0, JWT validation, subscription keys), rate limiting, CORS configuration, error handling, and API transformations. Use when implementing API security, access control, or request\u002Fresponse processing logic.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapim-policy-authoring\u002FSKILL.md",[],[138,139,140,141,92,95,19,100,142,30,143,144,145,146,147,107,148,149,130,109],"policy","authoring","apim policy authoring","security","access","ready","api security","Access Control","error","processing","cors configuration","production-ready",{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":38},"01M6HBSY65SB29J9WE9KYD0K6T","api-security-review","Reviews Azure API Management configurations for security vulnerabilities, OWASP API Security Top 10 compliance, VNet Internal mode validation, Private Link verification, and Azure Security Benchmark alignment. Use when performing security audits, pre-deployment validation, or compliance reviews.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapi-security-review\u002FSKILL.md",[],[157,141,158,19,144,159,92,117,160,161,162,163,100,164,107,165,166,167,108,109],"review","security review","api security review","benchmark","verification","owasp","owasp-api","alignment","azure security","reviews","top",{"skillNo":169,"name":170,"nameZh":6,"description":171,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":172,"categories":173,"keywords":174,"publishedAt":38},"01M6HBSRW4PDFE6K4F8JYPZQ05","jira-cli","Interact with Jira from the command line to create, list, view, edit, and transition issues, manage sprints and epics, and perform common Jira workflows. Use when the user asks about Jira tasks, tickets, issues, sprints, or needs to manage project work items.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fawesome-copilot-agents\u002Fskills\u002Fjira-cli\u002FSKILL.md",[],[175,176,177,119,178,179,36,180,19,181,182,183,184,185,186,187,188,189,190,191],"cli","jira","jira cli","init","tasks","issues","common","work","command","edit","list","view","project","project work","token","line","sprints",{"skillNo":193,"name":194,"nameZh":6,"description":195,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":196,"categories":197,"keywords":198,"publishedAt":38},"01M6HBSNS3JHMW603G47TWE31H","calculator","Performs arbitrary-precision arithmetic calculations including addition, subtraction, multiplication, division, and exponents. Use when the user asks to calculate, compute, or evaluate math expressions, or when precise decimal arithmetic is needed to avoid floating-point errors.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fawesome-copilot-agents\u002Fskills\u002Fcalculator\u002FSKILL.md",[],[194,199,200,201,202,203,204,30,205,206],"npm","js","calculate","node","math","user","compute","errors"]