[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H4HCAMQMCZFF6SEE1HQGX5":3,"skill-same:01M6H4HCAMQMCZFF6SEE1HQGX5":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},"01M6H4HCAMQMCZFF6SEE1HQGX5","creating-webhook-handlers",null,"Create webhook endpoints with signature verification, retry logic, and payload validation.\nUse when receiving and processing webhook events.\nTrigger with phrases like \"create webhook\", \"handle webhook events\", or \"setup webhook handler\".","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\u002Fwebhook-handler-creator\u002Fskills\u002Fcreating-webhook-handlers\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"webhook","creating webhook handlers","endpoints","retry","with","webhook handler","processing","trigger","io","logic","codex","use","edit","write","read","Bash","api","verification","code","create","2026-11-10 10:12:30",false,"---\nname: creating-webhook-handlers\ndescription: |\n  Create webhook endpoints with signature verification, retry logic, and payload validation.\n  Use when receiving and processing webhook events.\n  Trigger with phrases like \"create webhook\", \"handle webhook events\", or \"setup webhook handler\".\n  \nallowed-tools: Read, Write, Edit, Grep, Glob, Bash(api:webhook-*)\nversion: 1.0.0\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\nlicense: MIT\ncompatible-with: claude-code, codex, openclaw\n---\n# Creating Webhook Handlers\n\n## Overview\n\nCreate secure webhook receiver endpoints with HMAC signature verification, idempotent event processing, and automatic retry handling. Support ingestion from providers like Stripe, GitHub, Twilio, and Slack with provider-specific signature validation schemes and payload parsing.\n\n## Prerequisites\n\n- Web framework with raw body access (Express with `express.raw()`, FastAPI with `Request.body()`)\n- Webhook provider credentials: signing secret or shared secret key\n- Persistent storage for idempotency tracking (Redis or database table for processed event IDs)\n- Queue system for async processing (optional: Bull, Celery, SQS)\n- ngrok or similar tunnel for local development testing\n\n## Instructions\n\n1. Examine existing route definitions and middleware using Grep and Read to identify where webhook endpoints integrate into the application.\n2. Create a dedicated webhook route (e.g., `POST \u002Fwebhooks\u002F:provider`) that captures the raw request body before any JSON parsing middleware runs.\n3. Implement HMAC-SHA256 signature verification by computing `HMAC(raw_body, signing_secret)` and comparing against the provider's signature header (`X-Hub-Signature-256`, `Stripe-Signature`, `X-Twilio-Signature`).\n4. Add idempotency protection by storing processed event IDs (e.g., `evt_xxx`) in Redis or a database table, rejecting duplicates with 200 OK to prevent provider retries.\n5. Parse the event type from the payload (`event.type`, `action`, `EventType`) and route to the appropriate handler function using a dispatch map.\n6. Respond with 200 OK immediately, then enqueue the event payload for asynchronous processing to avoid webhook timeout failures.\n7. Implement dead-letter handling for events that fail processing after maximum retry attempts, logging the full payload for manual inspection.\n8. Write tests that replay recorded webhook payloads with valid and tampered signatures to verify acceptance and rejection behavior.\n\nSee `${CLAUDE_SKILL_DIR}\u002Freferences\u002Fimplementation.md` for the full implementation guide.\n\n## Output\n\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fwebhooks\u002Freceiver.js` - Webhook endpoint with signature verification\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fwebhooks\u002Fhandlers\u002F` - Per-event-type handler functions\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fwebhooks\u002Fverify.js` - HMAC signature verification utilities\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fwebhooks\u002Fidempotency.js` - Duplicate event detection logic\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fqueues\u002Fwebhook-processor.js` - Async event processing queue worker\n- `${CLAUDE_SKILL_DIR}\u002Ftests\u002Fwebhooks\u002F` - Replay tests with recorded payloads\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| 401 Signature Mismatch | HMAC verification failed against provider signature | Log the expected vs. received signature (redacted); verify signing secret rotation status |\n| 400 Malformed Payload | Raw body is not valid JSON or missing required fields | Return 400 so provider marks delivery as failed; log raw body for debugging |\n| 200 OK (duplicate) | Event ID already processed; idempotency guard triggered | Return 200 to prevent provider retry loops; log duplicate detection for monitoring |\n| 504 Gateway Timeout | Synchronous processing exceeded provider timeout (typically 5-30s) | Move processing to async queue; respond 200 immediately upon signature verification |\n| 500 Handler Exception | Business logic threw unhandled error during processing | Catch at dispatch layer; log full error with event payload; allow provider to retry |\n\nRefer to `${CLAUDE_SKILL_DIR}\u002Freferences\u002Ferrors.md` for comprehensive error patterns.\n\n## Examples\n\n**Stripe payment webhook**: Verify `Stripe-Signature` header using `stripe.webhooks.constructEvent()`, then dispatch `payment_intent.succeeded` to fulfill orders and `charge.refunded` to process refund credits.\n\n**GitHub push webhook**: Validate `X-Hub-Signature-256`, parse `push` events, extract commit list, and trigger CI\u002FCD pipeline via queue message.\n\n**Multi-provider router**: Single `\u002Fwebhooks\u002F:provider` endpoint that loads provider-specific signature verifier and event schema from a registry, supporting Stripe, GitHub, Twilio, and custom providers.\n\nSee `${CLAUDE_SKILL_DIR}\u002Freferences\u002Fexamples.md` for additional examples.\n\n## Resources\n\n- Stripe Webhook Signatures: https:\u002F\u002Fstripe.com\u002Fdocs\u002Fwebhooks\u002Fsignatures\n- GitHub Webhook Events: https:\u002F\u002Fdocs.github.com\u002Fen\u002Fwebhooks\n- RFC 2104 HMAC specification for signature computation\n- OWASP Webhook Security best practices","# Creating Webhook Handlers\n\n## Overview\n\nCreate secure webhook receiver endpoints with HMAC signature verification, idempotent event processing, and automatic retry handling. Support ingestion from providers like Stripe, GitHub, Twilio, and Slack with provider-specific signature validation schemes and payload parsing.\n\n## Prerequisites\n\n- Web framework with raw body access (Express with `express.raw()`, FastAPI with `Request.body()`)\n- Webhook provider credentials: signing secret or shared secret key\n- Persistent storage for idempotency tracking (Redis or database table for processed event IDs)\n- Queue system for async processing (optional: Bull, Celery, SQS)\n- ngrok or similar tunnel for local development testing\n\n## Instructions\n\n1. Examine existing route definitions and middleware using Grep and Read to identify where webhook endpoints integrate into the application.\n2. Create a dedicated webhook route (e.g., `POST \u002Fwebhooks\u002F:provider`) that captures the raw request body before any JSON parsing middleware runs.\n3. Implement HMAC-SHA256 signature verification by computing `HMAC(raw_body, signing_secret)` and comparing against the provider's signature header (`X-Hub-Signature-256`, `Stripe-Signature`, `X-Twilio-Signature`).\n4. Add idempotency protection by storing processed event IDs (e.g., `evt_xxx`) in Redis or a database table, rejecting duplicates with 200 OK to prevent provider retries.\n5. Parse the event type from the payload (`event.type`, `action`, `EventType`) and route to the appropriate handler function using a dispatch map.\n6. Respond with 200 OK immediately, then enqueue the event payload for asynchronous processing to avoid webhook timeout failures.\n7. Implement dead-letter handling for events that fail processing after maximum retry attempts, logging the full payload for manual inspection.\n8. Write tests that replay recorded webhook payloads with valid and tampered signatures to verify acceptance and rejection behavior.\n\nSee `${CLAUDE_SKILL_DIR}\u002Freferences\u002Fimplementation.md` for the full implementation guide.\n\n## Output\n\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fwebhooks\u002Freceiver.js` - Webhook endpoint with signature verification\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fwebhooks\u002Fhandlers\u002F` - Per-event-type handler functions\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fwebhooks\u002Fverify.js` - HMAC signature verification utilities\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fwebhooks\u002Fidempotency.js` - Duplicate event detection logic\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fqueues\u002Fwebhook-processor.js` - Async event processing queue worker\n- `${CLAUDE_SKILL_DIR}\u002Ftests\u002Fwebhooks\u002F` - Replay tests with recorded payloads\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| 401 Signature Mismatch | HMAC verification failed against provider signature | Log the expected vs. received signature (redacted); verify signing secret rotation status |\n| 400 Malformed Payload | Raw body is not valid JSON or missing required fields | Return 400 so provider marks delivery as failed; log raw body for debugging |\n| 200 OK (duplicate) | Event ID already processed; idempotency guard triggered | Return 200 to prevent provider retry loops; log duplicate detection for monitoring |\n| 504 Gateway Timeout | Synchronous processing exceeded provider timeout (typically 5-30s) | Move processing to async queue; respond 200 immediately upon signature verification |\n| 500 Handler Exception | Business logic threw unhandled error during processing | Catch at dispatch layer; log full error with event payload; allow provider to retry |\n\nRefer to `${CLAUDE_SKILL_DIR}\u002Freferences\u002Ferrors.md` for comprehensive error patterns.\n\n## Examples\n\n**Stripe payment webhook**: Verify `Stripe-Signature` header using `stripe.webhooks.constructEvent()`, then dispatch `payment_intent.succeeded` to fulfill orders and `charge.refunded` to process refund credits.\n\n**GitHub push webhook**: Validate `X-Hub-Signature-256`, parse `push` events, extract commit list, and trigger CI\u002FCD pipeline via queue message.\n\n**Multi-provider router**: Single `\u002Fwebhooks\u002F:provider` endpoint that loads provider-specific signature verifier and event schema from a registry, supporting Stripe, GitHub, Twilio, and custom providers.\n\nSee `${CLAUDE_SKILL_DIR}\u002Freferences\u002Fexamples.md` for additional examples.\n\n## Resources\n\n- Stripe Webhook Signatures: https:\u002F\u002Fstripe.com\u002Fdocs\u002Fwebhooks\u002Fsignatures\n- GitHub Webhook Events: https:\u002F\u002Fdocs.github.com\u002Fen\u002Fwebhooks\n- RFC 2104 HMAC specification for signature computation\n- OWASP Webhook Security best practices",{"name":5,"author":43,"license":14,"version":44,"description":45,"allowed-tools":46,"compatible-with":47},"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Create webhook endpoints with signature verification, retry logic, and payload validation.\nUse when receiving and processing webhook events.\nTrigger with phrases like \"create webhook\", \"handle webhook events\", or \"setup webhook handler\".\n","Read, Write, Edit, Grep, Glob, Bash(api:webhook-*)","claude-code, codex, openclaw","master","3f5d983eb4ef375b749adcd6b07ec03bd82ae8a8","claude-code\u002Fplugins-plus-skills\u002Fplugins\u002Fapi-development\u002Fwebhook-handler-creator\u002Fskills\u002Fcreating-webhook-handlers",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 creating-webhook-handlers",{"tool":61,"command":62},"bunx","bunx skills add micsapp\u002Fmicstec-skills --skill creating-webhook-handlers",{"tool":64,"command":65},"pnpm","pnpm dlx skills add micsapp\u002Fmicstec-skills --skill creating-webhook-handlers","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fclaude-code\u002Fplugins-plus-skills\u002Fplugins\u002Fapi-development\u002Fwebhook-handler-creator\u002Fskills\u002Fcreating-webhook-handlers\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\u002Fwebhook-handler-creator\u002Fskills\u002Fcreating-webhook-handlers\u002Freferences\u002Ferrors.md",{"path":76,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fexamples.md",6957,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fclaude-code\u002Fplugins-plus-skills\u002Fplugins\u002Fapi-development\u002Fwebhook-handler-creator\u002Fskills\u002Fcreating-webhook-handlers\u002Freferences\u002Fexamples.md",{"path":80,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fimplementation.md",1405,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fclaude-code\u002Fplugins-plus-skills\u002Fplugins\u002Fapi-development\u002Fwebhook-handler-creator\u002Fskills\u002Fcreating-webhook-handlers\u002Freferences\u002Fimplementation.md",[84,120,149,168,187,210],{"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":100,"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",[90,95],{"categoryNo":91,"categoryName":92,"taxonomyType":93,"taxonomyTypeDesc":94},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":96,"categoryName":97,"taxonomyType":98,"taxonomyTypeDesc":99},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[101,102,103,104,105,106,107,108,109,34,110,111,112,113,114,115,116,117,118,119],"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":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":134,"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",[126,127,130,133],{"categoryNo":91,"categoryName":92,"taxonomyType":93,"taxonomyTypeDesc":94},{"categoryNo":128,"categoryName":129,"taxonomyType":93,"taxonomyTypeDesc":94},"01JBSEEDCAT000000000000011","运维与部署",{"categoryNo":131,"categoryName":132,"taxonomyType":93,"taxonomyTypeDesc":94},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":96,"categoryName":97,"taxonomyType":98,"taxonomyTypeDesc":99},[135,136,137,138,102,139,36,140,141,142,143,144,34,110,116,145,146,117,147,148],"deployment","apiops deployment","workflows","azure devops","infrastructure","infrastructure as code","actions","ci","github actions","github-actions","as","guides","CI\u002FCD","implementing",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":156,"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",[155],{"categoryNo":91,"categoryName":92,"taxonomyType":93,"taxonomyTypeDesc":94},[157,158,159,160,102,105,34,110,161,29,162,163,164,165,24,117,166,167,148,119],"policy","authoring","apim policy authoring","security","access","ready","api security","Access Control","error","cors configuration","production-ready",{"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":176,"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",[174,175],{"categoryNo":91,"categoryName":92,"taxonomyType":93,"taxonomyTypeDesc":94},{"categoryNo":96,"categoryName":97,"taxonomyType":98,"taxonomyTypeDesc":99},[177,160,178,34,163,179,102,135,180,35,181,182,110,183,117,184,185,186,118,119],"review","security review","api security review","benchmark","owasp","owasp-api","alignment","azure security","reviews","top",{"skillNo":188,"name":189,"nameZh":6,"description":190,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":191,"categories":192,"keywords":193,"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",[],[194,195,196,137,197,198,37,199,34,200,201,202,30,203,204,205,206,207,208,209],"cli","jira","jira cli","init","tasks","issues","common","work","command","list","view","project","project work","token","line","sprints",{"skillNo":211,"name":212,"nameZh":6,"description":213,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":214,"categories":215,"keywords":216,"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",[],[212,217,218,219,220,221,222,29,223,224],"npm","js","calculate","node","math","user","compute","errors"]