From web-commerce
Harden a commerce webhook handler: verify the provider signature with a constant-time compare BEFORE parsing the body, then de-duplicate retried deliveries by provider event id. Use when writing or reviewing any Stripe/Square/Shopify webhook receiver. Two invariants (verify-before-parse, event-id idempotency) that are non-negotiable.
How this skill is triggered — by the user, by Claude, or both
Slash command
/web-commerce:webhook-hardeningThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Two non-negotiable invariants for every webhook handler this plugin scaffolds. Both are enforced by the [`commerce-gold-standard-rubric`](../commerce-gold-standard-rubric/SKILL.md) (dimensions 2 and 3).
Two non-negotiable invariants for every webhook handler this plugin scaffolds. Both are enforced by the commerce-gold-standard-rubric (dimensions 2 and 3).
safeSignatureEqual from templates/shared/webhook-verify.ts — a constant-time compare. A plain === leaks timing an attacker uses to forge signatures.Per-provider scheme:
| Provider | Header | Signed over | Notes |
|---|---|---|---|
| Stripe | Stripe-Signature | payload + whsec_ secret | 5-min timestamp tolerance guards replays |
| Square | x-square-hmacsha256-signature | signatureKey + notificationUrl + rawBody | HMAC-SHA256 |
| Shopify | X-Shopify-Hmac-Sha256 | rawBody | base64 HMAC-SHA256 |
Providers retry deliveries and do not guarantee ordering. Before any side effect:
event.id, Square event_id, Shopify delivery id).await store.seen(eventId) — if true, return 2xx and stop (already processed).await store.remember(eventId, ttl).Use an IdempotencyStore (templates/shared/idempotency-store.ts). On a static tier the store is KV-backed (Upstash / Vercel KV) behind a serverless function — never a process-memory Set (a recycled invocation loses it and re-processes) and never browser state.
payment-lifecycle-contract.npx claudepluginhub mcorbett51090/ravenclaude --plugin web-commerceGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
Dispatches multiple subagents concurrently for independent tasks without shared state. Use when facing 2+ unrelated failures or subsystems that can be investigated in parallel.