CtrlK
BlogDocsLog inGet started
Tessl Logo

webhook-handler-patterns

Best practices for webhook handlers. Use when implementing the handler sequence (verify first, parse second, handle idempotently), idempotency, error handling, retry logic, or framework-specific issues with Express, Next.js, or FastAPI.

89

1.12x
Quality

87%

Does it follow best practices?

Impact

89%

1.12x

Average score across 3 eval scenarios

SecuritybySnyk

Advisory

Suggest reviewing before use

SKILL.md
Quality
Evals
Security

Evaluation results

95%

15%

Add Stripe Webhook Support to an Existing Express API

Express raw body and middleware ordering

Criteria
Without context
With context

Uses express.raw()

100%

100%

Raw middleware before JSON parser

100%

100%

Verify before parse

100%

100%

Parse after verify

100%

100%

4xx on invalid signature

100%

100%

Correct content-type in express.raw

100%

100%

2xx on success

100%

100%

Idempotency check present

0%

100%

Async processing pattern

0%

50%

No express.json() on webhook route

100%

100%

92%

2%

Fix Duplicate Order Fulfillments Caused by Webhook Retries

Idempotent webhook handler with deduplication

Criteria
Without context
With context

Extracts event ID

100%

100%

Checks for prior processing

100%

100%

2xx for duplicate events

83%

100%

Stores event ID after processing

100%

100%

Processed events schema

100%

100%

Race condition handling

100%

83%

Side effects only once

100%

100%

Handler sequence followed

87%

100%

2xx on first success

100%

100%

No duplicate side effects in test

30%

40%

82%

14%

Build a GitHub Webhook Receiver in FastAPI

FastAPI webhook patterns and response codes

Criteria
Without context
With context

Uses request.body()

100%

100%

Dependency injection for verification

0%

100%

Verify before parse

100%

100%

4xx for invalid signature

100%

100%

BackgroundTasks for async processing

100%

100%

Returns 200 quickly

100%

100%

5xx or 503 for server errors

0%

50%

Handler sequence

100%

100%

Idempotency present

0%

0%

Structured logging

25%

25%

No request.json() first

100%

100%

Repository
hookdeck/webhook-skills
Evaluated
Agent
Claude Code
Model
Claude Sonnet 4.6

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.