agentleFS
shinzoxDshinzoxD/knackbox/skills/coding/webhook-design/SKILL.md

webhook-design

Skill0 starsChanged 5 months agoApache-2.0View on GitHub

Design outbound and inbound webhooks with signatures, retries,

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not use GET for delivery.

    line 74
  2. Very specific:

    Signature schemes you did not invent: follow Stripe/GitHub/Slack docs when integrating *their* platform.

    line 82
  3. Distinctive:

    Private network receivers: prefer allowlisted egress and mTLS over "shared secret in a query param".

    line 84

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Webhook Design

Webhooks are untrusted HTTP with delayed, duplicated, and reordered delivery. Authenticate the sender, make handlers idempotent, and never fetch attacker-controlled URLs without SSRF controls.

For persistent sockets, use websocket-design. For public HTTP APIs, use api-design.

Workflow

  1. Direction: inbound (you receive) vs outbound (you send) vs both.
  2. Event catalog: type, version, payload schema, PII, ordering needs.
  3. Auth: HMAC over the raw body + timestamp (or mTLS / public-key). Reject stale signatures (clock skew window, e.g. 5 minutes).
  4. Idempotency: event id as the dedupe key; store processed ids; safe to retry.
  5. Retries: exponential backoff, give-up budget, dead-letter, and what "success" means (2xx only).
  6. Receiver rules: verify first, parse second; constant-time compare; no work before auth.
  7. Sender rules: timeout, follow-redirects off by default, SSRF allow list if user-supplied URLs, secret rotation with dual-key overlap.

Output format

## Webhook design: <integration>

**Direction:** inbound | outbound | both
**Events:** …

### Signing
…

### Receiver contract
status codes, idempotency, time limit

### Retry / DLQ
…

### Versioning
…

### Abuse cases
replay, SSRF, secret leak, poison payload

Rules

  1. Sign the raw body, not a re-serialized JSON object.
  2. Include a timestamp and reject old signatures (replay).
  3. Deduplicate on a unique event id, not on "looks the same".
  4. Outbound delivery to customer URLs is an SSRF problem: block link- local / metadata / private ranges unless explicitly required.
  5. Secrets rotate with two valid keys during overlap. Never log the signing secret or full payload if it contains PII/tokens.
  6. Version events (type + api_version or schema id). Additive fields first; breaking changes get a new type.
  7. Do not use GET for delivery. POST (or the platform's documented method) with a bounded body size.

Edge cases

  • At-least-once is the default. Design for duplicates; do not promise exactly-once unless a transactional outbox is real.
  • Fan-out storms: one user action → N hooks; budget and coalesce.
  • Signature schemes you did not invent: follow Stripe/GitHub/Slack docs when integrating their platform; do not "improve" them.
  • Private network receivers: prefer allowlisted egress and mTLS over "shared secret in a query param".

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.