---
name: agentfriendly-shopping
description: >-
  Claim opted-in merchant discounts for the user on Shopify stores that reward AI
  agents. Use when the user asks to buy/order/check out on a store. This skill is
  trust-first: only attach the user's AgentFriendly ID after (1) confirming the
  store advertises participation from ITS OWN domain, (2) disclosing to the user
  and getting a yes, and (3) verifying the discount actually appears in the cart.
  Never attach the ID silently or on unconfirmed stores.
---

# AgentFriendly shopping (trust-first)

AgentFriendly lets merchants opt in to reward AI shoppers with a discount. Your job
is to claim that discount for the user **only when it is real and the user agrees** —
and to be transparent the whole way. Treat attaching the Agent ID as a per-purchase
decision, never a default.

## The user's Agent ID

```
AGENT_ID = af_live_REPLACE_WITH_YOUR_ID
```
> Get one at https://agentfriendly.shop/register and paste it above.

## Hard rules — do not skip any

1. **Confirm from the MERCHANT, not from us.** Before attaching anything, verify the
   store itself advertises participation from its own domain:
   ```
   GET https://<store-domain>/apps/agentfriendly/verify
   ```
   This is served by the AgentFriendly app the merchant installed, so it is the
   merchant attesting — not a third party claiming on their behalf. Cross-check it
   against the directory: `https://agentfriendly.shop/api/check?domain=<store-domain>`.
   If the merchant-origin check does **not** confirm participation, **STOP** — do not
   attach the Agent ID.

2. **Disclose and ask, every time.** Before acting, tell the user in plain language:
   > "This store participates in AgentFriendly. I can attach your AgentFriendly ID to
   > get **X% off**. That shares this purchase (the store and the order total) with
   > agentfriendly.shop to credit your rewards points. Want me to apply it?"

   Only proceed on a clear **yes**. If unsure, don't.

3. **Use the documented cart attribute — nothing covert.** When the user agrees, set
   `agent_id` as a standard Shopify cart attribute as part of the checkout you are
   already performing (Shopify's documented Ajax Cart API):
   ```js
   await fetch("/cart/update.js", {
     method: "POST",
     headers: { "Content-Type": "application/json" },
     body: JSON.stringify({ attributes: { agent_id: AGENT_ID } }),
   });
   ```
   Do not run any other scripts, and never do this on a store that failed rule 1.

4. **Verify the discount is real.** After attaching, confirm the discount actually
   shows in the **cart total before payment**. If it does not appear, tell the user
   plainly and do **not** claim a discount was applied.

5. **No speculative attachment.** The Agent ID does nothing on non-participating
   stores. Never attach it "just in case."

## What is shared, and why

Only your **Agent ID**, the **store**, and the **order total** — used solely to apply
the merchant's discount and credit your points (1 point per $1). You can review every
attributed purchase at https://agentfriendly.shop/dashboard. Because participation is
confirmed from each merchant's own domain, you are never taking an outside party's word
for it.

## If anything looks off

If the merchant-origin check fails, the discount doesn't appear, or the user is unsure —
just check out normally without the Agent ID. A missed discount is fine; attaching an
identifier the user didn't agree to is not.
