spree-performance

spree-performance is a skill for Claude Code, Codex from spree/agent-skills. It costs 114 tokens per session (3,215 once invoked), scanned A, original, MIT.

Performance guidance for Spree, an online-store platform, focused on common causes of slow pages and operations. It covers cart recalculation, product-list queries, search, image processing, background job queues, and admin tables.

In plain words
What is it for?
Diagnosing or improving slow product pages, cart updates, searches, image processing, Sidekiq background queues, and admin product lists. It also covers N+1 queries, where one page causes many unnecessary database requests, and cache invalidation.
Why use it?
It narrows performance investigations to the parts of a Spree store that commonly create delays, such as repeated database queries or overloaded background workers. This helps connect a slow customer action to the code or queue causing it.

Skill for Claude CodeCodex

Part of the spree plugin — 26 skills, 2 commands, 1 agent, 2 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/spree/agent-skills/spree-performance
Any agent
npx skills add spree/agent-skills --skill spree-performance
Clone the repo
git clone --depth 1 https://github.com/spree/agent-skills

Made for: Claude Code, Codex.

Or install spree, the plugin that ships this one along with the rest of its 26 skills, 2 commands, 1 agent, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spree-performance

README.md
[![agentmods](https://agentmods.dev/badge/skills/spree/agent-skills/spree-performance.svg)](https://agentmods.dev/skills/spree/agent-skills/spree-performance)
Your own site
<a href="https://agentmods.dev/skills/spree/agent-skills/spree-performance"><img src="https://agentmods.dev/badge/skills/spree/agent-skills/spree-performance.svg" alt="Measured on agentmods" height="20"></a>
Per session 114 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,215 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00114 $0.03215
Opus 5 $0.00057 $0.01607
Sonnet 5 $0.00023 $0.00643
Haiku 4.5 $0.00011 $0.00321

Measured 5d ago against content hash deab4af57b67, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spree-performance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/spree-performance/SKILL.md · 212 lines

How it starts

The opening of the file, as written. The whole thing — 212 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Spree Performance

Most Spree performance work has more leverage than generic Rails tuning because the bottleneck is usually in one of a few known hotspots. This skill covers those.

The biggest leverage areas

In rough order of impact for typical Spree stores:

  1. Cart pipeline cost on every cart change. Spree::Cart::Recalculate is the most-run service in the app — every line-item add, remove, and quantity change fires it. A slow recalculate makes the storefront feel sluggish.
  2. Catalog rendering N+1s. Product listing pages load Products, then prices, then images, then variants, then categories — easy to hit dozens of queries per product.
  3. Search provider latency. Database search degrades past ~10K products. Meilisearch's network round-trip + result deserialization adds up if not bounded.
  4. Image processing. Generating image variants is slow and CPU-bound — variants are pre-generated in background transform jobs at upload time, and bulk uploads can flood the queue.
  5. Sidekiq queue backlog. Per-queue weights matter — image processing flooding the default queue blocks event subscribers from firing in time.
  6. Admin product table. The N+1 problem with 100+ products and all-columns-visible is real.

The cart pipeline

Every cart change runs Spree.cart_recalculate_service (default: Spree::Cart::Recalculate). The chain reads line items, prices, adjustments, shipments, promotions, computes totals, and writes the order back.

Common cart-pipeline N+1s

Each line item lazily loads its variant, then the variant's price, then the variant's images for the cart UI. Eager-load before iterating:

order.line_items.includes(variant: [:prices, :images, product: :categories]).each do |li|
  # ...
end

In a custom recalculate step, prefer batch operations over per-item loops. If you must loop, eager-load the associations the loop touches.

Sidekiq for slow recalculate work

If you have a recalculate step that's slow (external service call, complex computation), make it async via Sidekiq instead of inline. The customer doesn't need to wait for an analytics push; fire-and-forget via a subscriber on order.updated (see the spree-events-webhooks skill).

Read the full file on GitHub · 212 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 212 lines · 114 tokens per session scan A deab4af57b67

Subscribe to this mod's changes

spree-performance is a skill published in the GitHub repository spree/agent-skills (4 stars, last pushed 2mo ago), licensed MIT. It adds 114 tokens to every session and 3,215 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

nemoclaw-contributor-implement-issue

Implement an accepted NemoClaw GitHub issue in the current checkout. Use when a user asks to pick up an issue for implementation, implement or fix a named issue, or add the issue's tests. Confirm accepted scope, deliver the smallest independently valuable capability slice, and record validation and remaining gates…

NVIDIA/NemoClaw · 134 tokens

amazon-reviews-api-skill

This skill helps users automatically extract Amazon product reviews via the Amazon Reviews API. Agent should proactively apply this skill when users express needs like getting reviews for Amazon product with ASIN B07TS6R1SF, analyzing customer feedback for a specific Amazon item, getting ratings and comments for a…

browser-act/skills · 124 tokens

amazon-competitor-analyzer

Scrapes Amazon product data from ASINs using browseract.com automation API and performs surgical competitive analysis. Compares specifications, pricing, review quality, and visual strategies to identify competitor moats and vulnerabilities.

browser-act/skills · 48 tokens

shopify-functions

Shopify Functions allow developers to customize the backend logic that powers parts of Shopify. Available APIs: Discount, Cart and Checkout Validation, Cart Transform, Pickup Point Delivery Option Generator, Delivery Customization, Fulfillment Constraints, Local Pickup Delivery Option Generator, Order Routing Location…

Shopify/Shopify-AI-Toolkit · 61 tokens

food-order

Reorder previous Foodora orders, preview cart contents, and track delivery ETA/status with ordercli. Use when the user wants to reorder food, check delivery status, or browse recent Foodora order history. Never confirm an order without explicit user approval.

Bitterbot-AI/bitterbot-desktop · 53 tokens

asc-subscription-localization

Bulk-localize subscription, subscription-group, and in-app purchase display names across App Store locales using asc, including API 4.4.1 version-scoped v2 resources. Use when filling or updating subscription/IAP names and descriptions without App Store Connect UI work.

rorkai/app-store-connect-cli-skills · 60 tokens