home / skills / openclaw / skills / webhook-gen

webhook-gen skill

/skills/lxgicstudios/webhook-gen

This skill generates complete webhook handlers with signature verification, retry logic, and idempotency for Stripe, GitHub, and other providers.

npx playbooks add skill openclaw/skills --skill webhook-gen

Review the files below or copy the command above to add this skill to your agents.

Files (12)
SKILL.md
2.5 KB
---
name: webhook-gen
description: Generate webhook handlers with retry logic using AI. Use when integrating Stripe, GitHub, or any webhook provider.
---

# Webhook Generator

Describe the webhook you're handling. Get a complete handler with signature verification, retry logic, and proper error handling. Stripe, GitHub, Twilio. all the patterns you need.

**One command. Zero config. Just works.**

## Quick Start

```bash
npx ai-webhook "stripe payment succeeded"
```

## What It Does

- Generates complete webhook handler functions
- Includes signature verification for popular providers
- Adds idempotency checks to prevent duplicate processing
- Implements retry-safe patterns with proper status codes
- Handles common webhooks from Stripe, GitHub, Shopify, and more

## Usage Examples

```bash
# Stripe payment webhook
npx ai-webhook "stripe checkout.session.completed"

# GitHub push events
npx ai-webhook "github push event to trigger deployment"

# Generic webhook with retry
npx ai-webhook "order created webhook with idempotency" 

# Specify provider explicitly
npx ai-webhook "new subscriber notification" --provider convertkit

# TypeScript output
npx ai-webhook "invoice paid" --typescript
```

## Best Practices

- **Always verify signatures** - Never trust raw webhook payloads
- **Return 200 quickly** - Process async. Don't make providers wait
- **Handle duplicates** - Webhooks retry. Your handler should be idempotent
- **Log everything** - Debugging webhook issues without logs is painful

## When to Use This

- Integrating a payment provider like Stripe or Paddle
- Setting up GitHub Actions alternatives with webhooks
- Building notification systems triggered by external services
- Any third-party integration that sends webhooks

## Part of the LXGIC Dev Toolkit

This is one of 110+ free developer tools built by LXGIC Studios. No paywalls, no sign-ups, no API keys on free tiers. Just tools that work.

**Find more:**
- GitHub: https://github.com/LXGIC-Studios
- Twitter: https://x.com/lxgicstudios
- Substack: https://lxgicstudios.substack.com
- Website: https://lxgic.dev

## Requirements

No install needed. Just run with npx. Node.js 18+ recommended.

```bash
npx ai-webhook --help
```

## How It Works

The tool recognizes common webhook patterns from your description. It generates a handler function with the appropriate verification method, event parsing, and response codes. AI ensures the handler follows best practices for reliability and security.

## License

MIT. Free forever. Use it however you want.

Overview

This skill generates complete webhook handlers with signature verification, idempotency, and retry-safe patterns using AI. It produces ready-to-use Python (and optionally TypeScript) handler code tailored to providers like Stripe, GitHub, Twilio, and generic webhook sources. Use it to get a secure, production-ready handler in one command with no configuration.

How this skill works

Describe the webhook you need and the tool infers the provider and event pattern. It generates a handler function that includes signature verification, event parsing, idempotency checks, proper HTTP responses for retries, and structured error handling. The output follows best practices: quick 200 responses when appropriate, async processing, and clear logging hooks for debugging.

When to use it

  • Integrating payment providers such as Stripe or Paddle
  • Receiving GitHub or GitLab event webhooks for CI/CD triggers
  • Building notification or order systems that rely on external webhook events
  • Creating retry-safe endpoints that must be idempotent
  • Prototyping webhook handlers quickly without writing boilerplate

Best practices

  • Always verify the provider signature before trusting payload data
  • Return success responses quickly and offload heavy work to background jobs
  • Implement idempotency using event IDs or deduplication stores
  • Log raw payloads and processing results to aid debugging and replay
  • Use exponential backoff and proper status codes so providers can retry safely

Example use cases

  • Generate a Stripe checkout.session.completed handler with signature verification and a dedupe store
  • Create a GitHub push event endpoint that triggers an automated deployment pipeline
  • Produce a generic order.created webhook with idempotency and retry-safe processing
  • Make a Twilio inbound message webhook that validates signatures and queues background work
  • Output TypeScript or Python handlers depending on your stack preference

FAQ

Do I need to install anything locally?

No install is required for generating code; the tool runs via npx and works with Node.js 18+ for command execution.

Can it produce handlers for multiple languages?

Yes. It primarily targets Python but can output TypeScript variants on request, adapting verification and framework idioms accordingly.