agent-skills: Instructions file for Claude Code

AGENTS.md

agent-skills AGENTS.md is an instructions file for Claude Code, Codex, OpenCode from spree/agent-skills. It costs 3,554 tokens per session, scanned A, original, MIT.

A set of instructions for coding agents working on Spree Commerce, an open-source online-store platform built with Ruby on Rails. It explains Spree's backend, administration interface, and REST APIs—the web endpoints used to manage store data.

In plain words
What is it for?
Use it when building or changing Spree stores, including business logic, store or admin APIs, the admin interface, and payment or integration components.
Why use it?
It gives an agent the project's conventions and structure before it changes code. This reduces mistakes caused by treating a customizable commerce system like an ordinary Rails app.

Instructions file for Claude CodeCodexOpenCode

Written for Claude Code and Codex and OpenCode: Claude Code plugin machinery, but also the file is AGENTS.md. Also seen: mentions subagents; mentions Claude Code; mentions AGENTS.md.

This is spree/agent-skills's own configuration. It tells Claude Code, Codex and OpenCode how to work on agent-skills itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agent-skills configures →

Reuse

Borrowing it

Nothing to install: this file belongs to spree/agent-skills. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/spree/agent-skills/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/spree/agent-skills

Made for: Claude Code, Codex, OpenCode.

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 agent-skills AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/spree/agent-skills/agents-md/github.svg)](https://agentmods.dev/instructions/spree/agent-skills/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/spree/agent-skills/agents-md"><img src="https://agentmods.dev/badge/instructions/spree/agent-skills/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agent-skills AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/spree/agent-skills/agents-md"><img src="https://agentmods.dev/badge/instructions/spree/agent-skills/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,554 This file is loaded in full into every session.
When invoked 3,554 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.03554 $0.03554
Opus 5.5 $0.01422 $0.01422
Sonnet 5.5 $0.00711 $0.00711
Haiku 4.5 $0.00355 $0.00355

Measured 20d ago against content hash 21dbaf9f4f58, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

agent-skills AGENTS.md 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 20d 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.

AGENTS.md · 172 lines

How it starts

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

Spree Commerce — Agent Guidance

This file follows the agents.md cross-tool standard. It's a portable summary of how to be effective on a Spree Commerce codebase, written for any agentic CLI (Codex, Cursor, Copilot, Aider, Windsurf, Zed, Amp, etc.) that reads AGENTS.md.

Targets Spree 6.x (Rails 8.1). For Spree 5.x projects, use the v0.3.0 tag of this repository.

If you're running in Claude Code, install this package as a plugin and you'll get the 38 SKILL.md files under skills/ as on-demand context, the spree-expert subagent, two slash commands, and two safety hooks. See README.md for install instructions.

If you're running in any other tool: read this file, then dive into the relevant skills/<name>/SKILL.md when the task matches its domain.


What Spree is

Spree Commerce is an open-source, self-hosted, API-first commerce platform built on Ruby on Rails. The thing people choose it for is the ability to customize and extend it without forking. Architecture:

  1. Backend (Ruby gems) — spree_core (models, services, workflows), spree_api (Store, Admin and Seller REST APIs under /api/v3/), spree_dashboard (serves the admin dashboard at /dashboard), spree_emails (transactional email), plus provider gems (spree_stripe, spree_meilisearch, spree_easypost, …).
  2. TypeScript SDKs — @spree/sdk (Store API), @spree/admin-sdk (Admin API), @spree/seller-sdk (Seller API).
  3. Admin UI — @spree/dashboard, a React app you own and extend with plugins (apps/dashboard/). An optional seller dashboard exists for marketplaces.
  4. Storefront — the reference Next.js storefront (apps/storefront/), or anything you build on the Store API.

Users run Spree in their own infrastructure. Everything is opt-in customization.

Core conventions (don't violate these without a reason)

Ruby / Rails

  • All Spree code is namespaced under Spree::; models inherit from Spree.base_class, not ApplicationRecord directly.
  • Use Spree.customer_class (default Spree::Customer) and Spree.admin_user_class (default Spree::AdminUser) — never hardcode the class. Spree.user_class is deprecated.
  • Always scope queries through the current store (current_store.products, not Spree::Product.all). Multi-store apps share a database; un-scoped queries leak data across stores. Spree::Store.default can return nil — set Spree::Current.store in jobs, rake tasks and tests.
  • Cart and Order are separate models. Spree::Cart (cart_…) is the shopping/checkout phase; completing it creates an immutable Spree::Order (or_…). Records owned by either side (line items, payments, fulfillments, tax lines, discounts, fees) use #owner.
  • No state machines. Status fields are plain string status columns declared with has_status; transitions happen in Spree::Workflow classes. Don't add state machines and don't convert statuses to Rails enums.
  • Side effects go in workflow hooks or event subscribers, not after_* callbacks or decorators on business methods. Spree.hooks.register('carts.complete.before_finalize', …) for in-flow logic; publish_event + subscribers for reactions.
  • Money adjustments are typed rows: Spree::TaxLine, Spree::Discount, Spree::Fee. Prices are per currency: variant.price_in(currency) / variant.set_price(currency, amount).
  • IDs are strings at the API surface (Stripe-style prefixed IDs); never .to_i an ID.
  • belongs_to is required by default — declare optional: true where blank is legitimate.
  • Uniqueness validations use scope: spree_base_uniqueness_scope plus a DB index. Always pass class_name and dependent on associations.
  • Permit extra attributes on the model: Spree::Product.additional_permitted_attributes += [:brand_id] (never <<).
  • Merchant-managed data belongs in custom fields; schemaless private data in metadata.

Read the full file on GitHub · 172 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. 20d ago Changed · +2 lines · +428 tokens per session 21dbaf9f4f58
  2. 1mo ago First seen · 170 lines · 3,126 tokens per session scan A e4444c7f1eb4

Subscribe to this mod's changes

agent-skills AGENTS.md is an instructions file published in the GitHub repository spree/agent-skills (10 stars, last pushed 21d ago), licensed MIT. It adds 3,554 tokens to every session, about $0.0142 per session on Opus 5.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 instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,649 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,384 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens