webhook
Skill2 starsChanged 4 months agoMITView on GitHub
Securely receive and handle an inbound webhook from a third party (Stripe, GitHub, Shopify, etc.) — verify the signature, reject replays, acknowledge fast, and process idempotently — so forged or duplicated events can't harm the system. Use when the user says "handle this webhook", "verify a webhook signature", "add a Stripe/GitHub webhook endpoint", "secure my webhook", "my webhook fires twice", or "process incoming events from X".
2 other projects use a version of this.
Adopted by
Most recently taken up by
- Alteriom/ai-dev-skillstheir own version, first seen Oct 11, 2026
- nickalie/nclawtheir own version, first seen Feb 25, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- nickalie/nclaw★ 15same name
- Alteriom/ai-dev-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository68 other files it gives its agents.
- a11ySkill
- api-docsSkill
- audit-logSkill
- benchmarkSkill
- bisectSkill
- cacheSkill
- changelogSkill
- cherry-pickSkill
- ci-setupSkill
- codeownersSkill
- commit-messageSkill
- connection-poolSkill
- contributingSkill
- coverageSkill
- db-migrateSkill
- dead-codeSkill
- debugSkill
- depsSkill
- diagramSkill
- dockerizeSkill
- docstringSkill
- e2eSkill
- env-exampleSkill
- error-handlingSkill
- explainSkill
- feature-flagSkill
- flaky-testSkill
- gitignoreSkill
- graceful-shutdownSkill
- graphqlSkill
- healthcheckSkill
- i18nSkill
- idempotencySkill
- licenseSkill
- lint-fixSkill
- loggingSkill
- migrateSkill
- mockSkill
- onboardSkill
- optimizeSkill
- paginationSkill
- pr-descriptionSkill
- pre-commitSkill
- profileSkill
- prune-branchesSkill
- rate-limitSkill
- readmeSkill
- rebaseSkill
- refactorSkill
- regexSkill
- releaseSkill
- resolve-conflictsSkill
- retrySkill
- review-diffSkill
- scaffoldSkill
- secrets-scanSkill
- security-headersSkill
- seedSkill
- soft-deleteSkill
- sqlSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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
- Distinctive: line 21
Reject replays: Check the signed timestamp (when the provider signs one) and reject requests outside a small tolerance (e.g.
- Very specific: line 25
Verify: Add tests: a valid signed payload is accepted and processed once.
- Distinctive: line 29
Always verify the signature against the raw body with a constant-time compare before doing anything else.
- Distinctive: line 30
Never trust or act on an unverified payload — parsing, logging PII, or side effects must come after verification.
- Distinctive: line 33
Keep the signing secret in config/env, and end by summarizing the verification method, replay/idempotency handling, the async processing …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Provider, framework & signing signals
!grep -rilE "webhook|stripe|svix|Webhook-Signature|X-Hub-Signature|X-Signature|hmac|createHmac|constant_time|express|fastify|nestjs|flask|fastapi|django" --include='*.*' package.json pyproject.toml go.mod Gemfile 2>/dev/null | grep -vE 'node_modules|\.git|dist|build' | head -8
Instructions
Wire up the inbound webhook in $ARGUMENTS so it only acts on authentic, non-replayed, deduplicated events. A webhook endpoint is public and attacker-reachable — treat every request as untrusted until the signature verifies. Reuse the project's framework and the provider's official SDK/verification helper where one exists.
Method
- Verify the signature over the raw body. Compute the HMAC (or use the provider's verify helper — e.g. Stripe's
constructEvent, GitHub'sX-Hub-Signature-256) using the signing secret, and compare with a constant-time comparison. Critically, verify against the raw, unparsed request body — many frameworks' JSON body parsers mutate bytes and break the signature, so capture the raw buffer before parsing for the webhook route only. - Load the signing secret from config/env, never hardcoded (see the
secrets-scanskill). A missing secret should fail closed, not skip verification. - Reject replays. Check the signed timestamp (when the provider signs one) and reject requests outside a small tolerance (e.g. ±5 min) so a captured request can't be resent later.
- Acknowledge fast, process out of band. Return
2xxas soon as the event is verified and safely recorded; do the real work (DB writes, emails, downstream calls) asynchronously (queue/background job). Providers time out and retry aggressively — slow handlers cause duplicate deliveries and back-pressure. - Process idempotently. Providers deliver at-least-once, so the same event id will arrive more than once. Dedupe on the provider's event id before applying effects (see the
idempotencyskill). An unrecognized or unhandled event type should be acknowledged and ignored, not error. - Return honest status codes.
400for a malformed/invalid signature,2xxfor accepted (even if the event type is ignored). Don't return2xxon a signature failure, and don't5xxon events you simply don't handle — that triggers needless provider retries. - Verify. Add tests: a valid signed payload is accepted and processed once; a tampered body or wrong secret is rejected with
400; a stale timestamp is rejected; the same event id delivered twice applies the effect once.
Rules
- Always verify the signature against the raw body with a constant-time compare before doing anything else; fail closed if the secret is missing.
- Never trust or act on an unverified payload — parsing, logging PII, or side effects must come after verification.
- Reject replays via the signed timestamp tolerance, and dedupe by event id so at-least-once delivery can't double-apply effects.
- Acknowledge quickly with
2xxand move heavy processing off the request path; reserve4xxfor auth/validation failures and don't5xxon unhandled event types. - Keep the signing secret in config/env, and end by summarizing the verification method, replay/idempotency handling, the async processing path, and the status codes returned.
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
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.

