ask-matt
MAmattpocock/skills337k近 7 天新增 4,978 个 star
Build and review Rails webhook systems with safe delivery, retries, observability, and tenant-aware security controls. Use when adding webhook endpoints, outbound deliveries, retry logic, or webhook admin tooling.
Use for outbound/inbound webhook architecture and reliability. Modeled on Fizzy's event-driven webhook pipeline (with Campfire's simpler bot webhooks as contrast).
Delivery row per webhook, each with a state enum (pending in_progress completed errored — string-backed via index_by(&:itself)).after_create_commit :deliver_later — persist first, deliver second, so state survives crashes and retries.ActiveJob::Continuable: cursor over matching webhooks (find_each(start: step.cursor) + step.advance!) so a mid-batch crash resumes, not restarts.webhooks queue so slow destinations can't starve other work.completed with a symbolic error (response: { error: :connection_timeout }). The delivery ran; the destination failed. Do not retry the job.errored!, re-raise so ActiveJob retries.first_failure_at per webhook; auto-deactivate after N failures spanning a minimum window (Fizzy: 10 failures over 1+ hour).resource :activation).normalizes :subscribed_actions, with: ->(v) { Array.wrap(v).map(&:to_s).uniq & PERMITTED_ACTIONS }.for_slack?, for_campfire?), then vary content type, payload format (JSON/form/HTML), and rendering template per destination. Don't fork the delivery code per integration.script_name so links in payloads work.construct_event-style), then re-fetch canonical state from the provider's API instead of trusting payload content or ordering.text/plain/text/html become replies), and prevent loops — never trigger a bot from its own messages.delete_all on a stale scope).MAmattpocock/skills337k近 7 天新增 4,978 个 star
MAmattpocock/skills337k近 7 天新增 4,978 个 star
MAmattpocock/skills337k近 7 天新增 4,978 个 star
OBobra/superpowers331k近 7 天新增 4,772 个 star
AFaffaan-m/ECC315k近 7 天新增 4,381 个 star
AFaffaan-m/ECC315k近 7 天新增 4,381 个 star