agentsclimarketplace

Shopify reliability patterns

Skill jeremylongshore/claude-code-plugins-plus-skills/plugins/saas-packs/shopify-pack/skills/shopify-reliability-patterns

'Implement reliability patterns for Shopify apps including circuit breakersFrom its SKILL.md

Install
npx -y skills add jeremylongshore/claude-code-plugins-plus-skills --skill shopify-reliability-patterns

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.2 KB, 842 tokens by cl100k_base, as published. Nobody here has run it

Shopify Reliability Patterns

Overview

Build fault-tolerant Shopify integrations that handle API outages, webhook retry storms, and rate limit exhaustion gracefully.

Prerequisites

  • Understanding of circuit breaker pattern
  • Queue infrastructure (BullMQ, SQS, etc.) for async processing
  • Cache layer for fallback data

Instructions

Step 1: Circuit Breaker for Shopify API

Wrap all Shopify API calls in a circuit breaker (using opossum) that opens at 50% error rate, only counting 5xx and timeout errors. When open, serve cached data. The breaker auto-tests recovery after 30 seconds in half-open state.

See Circuit Breaker for the complete implementation.

Step 2: Webhook Idempotency

Shopify retries webhooks up to 19 times over 48 hours if your endpoint doesn't return 200. Your handler must be idempotent. Use Redis to track X-Shopify-Webhook-Id with a 7-day TTL. Always respond 200 within 5 seconds, then process asynchronously.

See Webhook Idempotency for the complete implementation.

Step 3: Graceful Degradation with Cached Fallback

Implement a three-tier fallback: try the live API first (caching the result), fall back to cached data, then fall back to an alternative data source (e.g., local DB). Track the data source so you can log degraded responses.

See Cached Fallback for the complete implementation.

Step 4: Webhook Processing Queue

Don't process webhooks inline — queue them with BullMQ for resilience. Verify HMAC first, respond 200 immediately, then enqueue with topic/shop/payload metadata. The worker processes jobs with exponential backoff (5 retries) and idempotency checks.

See Webhook Processing Queue for the complete implementation.

Step 5: Rate Limit-Aware Retry

Retry logic that respects Shopify's Retry-After header (REST 429) and GraphQL throttle status restore rate. Calculates optimal wait time from available points rather than blindly backing off.

See Rate Limit-Aware Retry for the complete implementation.

Output

  • Circuit breaker preventing cascade failures during Shopify outages
  • Idempotent webhook processing preventing duplicate operations
  • Graceful degradation with cached fallback data
  • Queue-based webhook processing for resilience
  • Rate limit-aware retry logic

Error Handling

IssueCauseSolution
Circuit stays openShopify extended outageServe cached data, monitor status page
Duplicate orders processedMissing idempotencyUse X-Shopify-Webhook-Id for dedup
Queue growing unboundedWorker downMonitor queue depth, alert on backlog
Stale cache served for hoursCircuit never recoversSet max cache staleness, force refresh

Examples

Health Check with Circuit State

app.get("/health", async (req, res) => {
  res.json({
    status: shopifyCircuit.opened ? "degraded" : "healthy",
    shopify: {
      circuit: shopifyCircuit.opened ? "open" : "closed",
      stats: shopifyCircuit.stats,
    },
    webhookQueue: {
      waiting: await webhookQueue.getWaitingCount(),
      active: await webhookQueue.getActiveCount(),
      failed: await webhookQueue.getFailedCount(),
    },
  });
});

Resources

What ships with it: 5 files

7.2 KB alongside SKILL.md

Keep looking

Skills are one crate of 326,144. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.