Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    webhook reliability scaffold

    1

    Generate production-grade, resilient webhook handlers with documented reliability constraints and validation tests.

    $9

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    webhook reliability scaffold

    webhook reliability scaffold

    Example session with this skill installed

    I need a reliable webhook receiver in Node.js/Express using Redis for idempotency. I'm consuming Stripe events and need to handle duplicates and potential out-of-order delivery.

    • Read your context and instructions
    • Compiled the webhook reliability scaffold

    The webhook receiver scaffold has been generated for a Node.js/Express stack using Redis. The implementation includes a constraint-verified handler, signature verification logic, and a per-event idempotency check.

    WEBHOOK RELIABILITY SCAFFOLD — receiver · Node.js/Express/Redis

    ══════════════════════════════════════════════════════════

    CONSTRAINT LEDGER

    • C1 RETRY SAFETY: SATISFIED — Framework-level 2xx fast-ack; retry logic deferred to Stripe provider settings.
    • C2 IDEMPOTENCY: SATISFIED — Redis SETNX using evt_ ID with 24h TTL.
    • C3 AUTHENTICITY: SATISFIED — stripe.webhooks.constructEvent using raw body before JSON parsing.
    • C4 REPLAY PROTECTION: SATISFIED — Stripe signature includes timestamp; 5-minute tolerance enforced.

    C5 FAILURE VISIBILITY: SATISFIED — Failed processes logged to webhooks:dead_letter Redis list for manual replay.

    • C6 FAST ACK: SATISFIED — Immediate 200 OK after ingestion to Redis queue.
    • C7 ORDERING: SATISFIED — Per-customer sequential processing enforced via Redis-backed queue locks.

    GENERATED ARTIFACT

    const express = require('express');
    const Redis = require('ioredis');
    const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
    const redis = new Redis(process.env.REDIS_URL);
    const app = express();
    
    app.post('/webhook', express.raw({type: 'application/json'}), async (req, res) => {
      const sig = req.headers['stripe-signature'];
      let event;
    
      // C3: Authenticity check before parsing
      try {
        event = stripe.webhooks.constructEvent(req.body, sig, process.env.STRIPE_WEBHOOK_SECRET);
      } catch (err) {
        return res.status(400).send(`Webhook Error: ${err.message}`);
      }
    
      // C2: Idempotency check
      const lockKey = `webhook_idempotency:${event.id}`;
      const isNew = await redis.set(lockKey, 'processed', 'NX', 'EX', 86400);
      if (!isNew) return res.status(200).json({ received: true, duplicate: true });
    
      // C6 & C7: Fast Ack and Queue for Processing
      await redis.lpush('webhook_queue', JSON.stringify(event));
      res.status(200).json({ received: true });
    });
    

    ALTERNATIVES CONSIDERED

    Dedup mechanism: Chose Redis SETNX; rejected PostgreSQL unique constraint because high-volume spikes could saturate DB connections.

    Ack strategy: Chose process-after-queue; rejected process-then-ack because Stripe's 10s timeout causes retry loops on long-running worker tasks.

    VALIDATION GATE

    • V1 DUPLICATE TEST: Send same Stripe ID twice; verify Redis key exists and second call returns duplicate: true.
    • V2 FORGERY TEST: Send payload with invalid signature; verify 400 status returned before processing.
    • V4 CRASH TEST: Stop worker after Lpush; verify event remains in webhook_queue for next worker start.

    Next steps

    1. Set STRIPE_WEBHOOK_SECRET in your environment variables.
    2. Implement the background worker to consume the webhook_queue list.
    3. Configure your dead-letter alert threshold in your monitoring tool.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem

    Webhooks fail in ways that demos don't show: duplicate charges from multiple deliveries, unverified payloads allowing forgeries, and out-of-order events that break data integrity. Standard boilerplate handlers often ignore these edge cases, leading to silent data loss or race conditions in production.

    What it does

    • Generates a production-grade webhook consumption or delivery layer for specific stacks.
    • Implements exponential backoff with jitter and replay protection to handle service instability.
    • Builds idempotency logic to prevent duplicate processing of the same event.
    • Enforces signature verification before payload parsing to prevent injection attacks.
    • Produces a dead-letter strategy to ensure failed events are captured, never dropped.

    Frameworks & tools

    Works with any language or framework including Node.js, Python, Go, and Ruby. Supports integrations with Redis, SQS, PostgreSQL, and providers like Stripe, GitHub, and Shopify.

    Why this beats prompting it yourself

    This skill uses a Generative/Synthetic reasoning engine to document why specific design choices were made over rejected alternatives. It forces a constraint ledger that maps every reliability requirement to a concrete validation test, ensuring no silent failures in the architecture.

    Use cases

    • Building a Stripe payment handler that prevents double-fulfillment on duplicate webhooks.
    • Scaling webhook ingestion for high-volume event streams (100+ events/sec).
    • Securing custom internal webhooks with robust signature verification and replay windows.
    • Scaffolding a resilient delivery system that handles target service downtime without data loss.

    Known limitations

    Cannot diagnose live incidents from existing logs. Does not invent signing algorithms for unknown providers; it provides the implementation slot for their specific scheme.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.

    Requires stack details (language/queue/store) for accurate persistence logic. Will not diagnose live production logs or correlate alert storms.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 2 months ago

    Permissions

    No special permissions declared or detected

    Listed2 months ago

    What's inside

    Frequently Asked Questions

    This skill generates code for production-grade webhook layers that handle critical edge cases like duplicate deliveries (idempotency), signature verification, and dead-lettering to prevent data loss. Unlike standard boilerplate, it provides a constraint ledger that maps reliability requirements to specific validation tests.

    The scaffold is language-agnostic and supports major environments including Node.js, Python, Go, and Ruby. It includes specific patterns for popular providers like Stripe, Shopify, and GitHub, and integrates with infrastructure like Redis, SQS, or PostgreSQL for event persistence.

    You will receive the logic for the consumption or delivery layer, a documented reliability constraint ledger, and a suite of validation tests to verify that your implementation handles failures as expected. It also provides the structural slots for provider-specific signing algorithms.

    While this skill builds the architecture to capture and log failures via dead-letter strategies, it is a design and scaffolding tool rather than a monitoring service. It cannot ingest your live production logs to diagnose active incidents.

    Yes, the skill is designed to generate highly scalable ingestion layers. It implements strategies like exponential backoff with jitter and asynchronous processing patterns that allow your infrastructure to handle bursts of 100+ events per second without dropping data.

    New in APIs & Backend