commerce-architecture
Skill3.2k starsChanged 3 months agoApache-2.0View on GitHub
How the reference commerce agents of either role are structured, covering the loop, where each rule lives, skills, the backend interface, delegates, and model fields. Load when designing or reviewing the structure of a shopping or merchant agent.
Trending
Quiet since September.about the whole repository
Who's talking about anthropics/commerce-agents
- A Hacker News story“Anthropic commerce agent: open-source blueprint for shopping and merchant agents”Hacker News · Sep 10, 2026 · 3 points
- A Hacker News story“Commerce Agents: Reference blueprint for building shopping and merchant agents”Hacker News · Sep 2, 2026 · 3 points
- @anthropicai.xmirror.bot“Also, see our open-source reference implementation. This includes shopping & merchant agents, four vertical …”Bluesky · Sep 2, 2026 · 3 likes
- @greg-harvey.tooting.ch.ap.brid.gy“Anthropic: "Hey, we do open source stuff too!" https://github.com/anthropics/commerce-agents Me: "Folks, …”Bluesky · Sep 16, 2026 · 2 likes
- ProSkillsMD/proskills“[Candidate] anthropics/commerce-agents/shopping-agent/skills/search-discovery - search-discovery”GitHub · Sep 28, 2026
The biggest 5 of 29 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 29
Talked about on GitHub, Bluesky and Hacker News (29 times).
On GitHub · 23
- Sep 28, 2026[Candidate] anthropics/commerce-agents/shopping-agent/skills/search-discovery - search-discovery — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 27, 2026[Candidate] anthropics/commerce-agents/shopping-agent/skills/purchase-research - purchase-research — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 27, 2026[Candidate] anthropics/commerce-agents/shopping-agent/skills/planning-goals - planning-goals — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 27, 2026[Candidate] anthropics/commerce-agents/shopping-agent/skills/memory-personalization - memory-personalization — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] anthropics/commerce-agents/shopping-agent/skills/customer-care - customer-care — ProSkillsMD/proskills0 reactions · 2 comments
18 more on GitHub
- Sep 26, 2026[Candidate] anthropics/commerce-agents/merchant-agent/skills/pricing-promotions - pricing-promotions — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] anthropics/commerce-agents/merchant-agent/skills/performance-insights - performance-insights — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] anthropics/commerce-agents/merchant-agent/skills/marketing-campaigns - marketing-campaigns — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] anthropics/commerce-agents/merchant-agent/skills/inventory-operations - inventory-operations — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] anthropics/commerce-agents/merchant-agent/skills/catalog-listings - catalog-listings — ProSkillsMD/proskills0 reactions · 1 comment
- Sep 13, 2026fix(81rv10): ground demo in commerce-agents import — huijoohwee/agentic-graph0 reactions · 1 comment
- Sep 12, 2026[新規記事候補] Claude Commerce Agents Blueprint — quintessence-lab/mdTechKnowledge0 reactions · 1 comment
- Sep 10, 2026[mdKnowledge更新候補] 2026-09-11 — quintessence-lab/mdTechKnowledge0 reactions · 2 comments
- Sep 3, 2026📰 Hacker News AI 社区动态日报 2026-09-03 — 96loveslife/big_model_radar0 reactions
- Sep 2, 2026APRV-241: commerce agents blueprint declined in the integrations register — approval-md/approval.md0 reactions
- Sep 2, 2026Add a generic application and workspace-agent builder — tyxter-dev/blackbox0 reactions
- Sep 2, 2026Define a provider-neutral memory policy and reference runtime — tyxter-dev/blackbox0 reactions
- Sep 2, 2026Add cross-surface semantic parity contracts for workspace agent packages — tyxter-dev/blackbox0 reactions
- Sep 2, 2026Add a provenance-gated staged-action reference agent — tyxter-dev/blackbox0 reactions
- Sep 2, 2026Add an optional trust and sanitization boundary for tool results — tyxter-dev/blackbox0 reactions
- Sep 2, 2026Enforce WorkspaceAgentSpec tool permissions at runtime — tyxter-dev/blackbox0 reactions · 1 comment
- Sep 2, 2026Commerce agents: wire the blueprint evals into ork:testing-llm — yonatangross/orchestkitsays it tested it0 reactions
- Sep 2, 2026Commerce agents: skill wrapping the blueprint's shopping and merchant harness for client sites — yonatangross/orchestkit0 reactions
On Bluesky · 4
- Sep 2, 2026Also, see our open-source reference implementation. This includes shopping & merchant agents, four vertical demos, and a Claude Code plugin… — @anthropicai.xmirror.bot3 likes and reposts · 1 reply
- Sep 16, 2026Anthropic: "Hey, we do open source stuff too!" https://github.com/anthropics/commerce-agents Me: "Folks, open sourcing your agents is like… — @greg-harvey.tooting.ch.ap.brid.gy2 likes and reposts
- Sep 6, 2026anthropics/commerce-agents Anthropic published a reference implementation for Claude-powered commerce agents. Shopping flows, merchant… — @githubprojects.bsky.social0 likes and reposts · 1 reply
- Sep 2, 2026Also, see our open-source reference implementation. This includes shopping & merchant agents, four vertical demos, and a Claude Code plugin… — @claudedevs-mirr.selfhosted.social0 likes and reposts · 1 reply
On Hacker News · 2
In this repository16 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- catalog-listingsSkill
- inventory-operationsSkill
- marketing-campaignsSkill
- performance-insightsSkill
- pricing-promotionsSkill
- commerce-evalsSkill
- commerce-merchant-operationsSkill
- commerce-prompt-cachingSkill
- commerce-trust-safetySkill
- commerce-ui-toolsSkill
- customer-careSkill
- memory-personalizationSkill
- planning-goalsSkill
- purchase-researchSkill
- search-discoverySkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Every call on every path runs through the role executor (ShoppingToolExecutor in shopping_agent/executor.py, MerchantToolExecutor in …
- Distinctive: line 83
Put a most-turns rule in a skill, or a one-tool rule in the prompt.
- Very specific: line 86
Add a domain tool to a core package.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Commerce agent architecture
Paths are in the reference repo: commerce_common/ is commerce-common/commerce_common/, shopping_agent/ is
shopping-agent/core/shopping_agent/, merchant_agent/ is merchant-agent/core/merchant_agent/, and the runtimes are
shopping-agent/runtime-messages-api/shopping_agent_runtime/ and merchant-agent/runtime-messages-api/merchant_agent_runtime/.
One loop
- One model owns the conversation. A turn is
ShoppingAgent.stream_turnorMerchantAgent.stream_turn(each runtime'sorchestrator.py): the model reads the cached prompt, calls tools (one round's calls run concurrently), and ends with text plus presentation calls. There is no router, classifier, or hand-off. - Every call on every path runs through the role executor (
ShoppingToolExecutorinshopping_agent/executor.py,MerchantToolExecutorinmerchant_agent/executor.py) overBaseToolExecutorincommerce_common/execution.py. The Messages API runtime, the Agent SDK toolset, and the MCP server call the sameexecute, which never raises; aftermax_tool_iterationsrounds (commerce_common/config.py) the runtime forces a round without tools.
Where a rule lives
| A rule that applies | Lives in | Reference |
| While one call's arguments are being filled in | That tool's description | build_tools in each role's tools/registry.py |
| On most turns: cart and checkout, the staged-write contract, presentation grammar, tool order, trust rules | The static prompt | build_static_system in each role's prompt.py |
| On the minority of requests that need a multi-step procedure | A skill, loaded on demand | shopping-agent/skills/, merchant-agent/skills/ |
A rule the core journey needs on most conversations moves a layer down. This table is the one statement of the layering.
Skills
- A skill is a directory holding
SKILL.md: frontmatternameanddescription, then the body (parse_skill_mdincommerce_common/skills.py). The description names the request class; it carries no sample utterances. - The static prompt carries the index alone (
SkillRegistry.index_block, sorted by name) andload_skillreturns one body (_load_skillincommerce_common/execution.py). On the Agent SDK,ensure_project_skillslinks the same directories into.claude/skills/andSKILL_TOOL_ADAPTERpoints the model at the SDK'sSkilltool (commerce_common/agent_sdk.py); the hosted manifests list the directories underskills[]inagent.yaml.
The backend interface
A deployment implements one abstract class per role; nothing else reaches its systems.
StorefrontBackend(shopping_agent/backend.py): 11 abstract methods, catalog (2), cart (4), preferences (1), orders (2), policies (1), fulfillment (1);get_account_context,get_disclosure, andcheckout_handoffhave defaults. No method places an order or moves money;checkout_handoffnames where payment happens (a hosted checkout URL, or one per seller) and the host renders it.MerchantBackend(merchant_agent/backend.py): 16 abstract methods, reads (8: performance 3, catalog 2, inventory and order health 2, pricing 1) and the change lifecycle (8: fivestage_*,get_pending_changes,apply_change,discard_change);execute_analysis_query,get_analysis_schema,get_merchant_contexthave defaults.- A product or listing sold by size, color, or tier is a family record carrying
options, its variants each a record withoption_valuesandvariant_of; the cart and price or restock writes take a variant's id and the gates hold a family's.docs/backends.mdhas the mapping from common catalog models and what to return for a figure the platform cannot supply. - Eligibility, pricing, inventory, and quantity rules are enforced in the backend; the gates check provenance and caps (commerce-trust-safety). Everything a backend returns is fenced before the model reads it.
- A system that is not wired yet is a method that fails (merchant methods raise
ChangeNotApplicablefrommerchant_agent/changes.py); the tool stays registered, so prompt bytes do not change. A system the business does not have at all is absent: anenable_*switch on the role's config turned off, which removes its tools (absent_tools()), prompt lines, and grounding rule on all three paths, and the executor refuses those names; the skills that need it are parked underskills/_staged/, and the bytes are then fixed for that deployment.NotOffered(shopping_agent/backend.py) is the narrower signal: one item or seller the store does not serve while the system itself is on. executor_class=onShoppingAgent/MerchantAgent, the SDK toolsets, and the MCP servers'build_servertakes a subclass of the role's executor for a deployment's owndomain_errormapping or result wording.
Delegates
A second model call takes one shape: a DelegateExtension (commerce_common/delegation.py). It receives a brief
and the handles in DelegationContext, never the conversation or the executor; it returns one result validated
against result_model; it cannot write, present, or call a delegate; _run_delegate in commerce_common/execution.py
caps its calls per turn at max_delegate_calls_per_turn. MerchantAgent takes extra_delegates, and its
built-in instance is run_analysis (commerce-merchant-operations). ShoppingAgent registers none.
Model fields
model runs the turn loop and memory_model the post-turn extraction (BaseAgentConfig in commerce_common/config.py);
analysis_model runs the delegate, and None means model (MerchantAgentConfig in merchant_agent/config.py). The
SDK runtimes copy config.model into the options; the manifests set model:. Choose the values with your own evals.
Do not
- Vary
tools[]or the static prompt by request (commerce-prompt-caching). - Put a most-turns rule in a skill, or a one-tool rule in the prompt.
- Enforce a cap or a permission in prompt text alone; it belongs in the executor or the backend.
- Let the model author a price, a figure, or a term; components are joined from server records (commerce-ui-tools).
- Add a domain tool to a core package; a vertical adds UI through
PresentationExtensionand keeps the rest in its own code.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

