Skip to content

domain-skills: amazon — cart.md, orders.md#168

Open
iskyiskyisky wants to merge 1 commit intobrowser-use:mainfrom
iskyiskyisky:domain-skills/amazon-cart-orders
Open

domain-skills: amazon — cart.md, orders.md#168
iskyiskyisky wants to merge 1 commit intobrowser-use:mainfrom
iskyiskyisky:domain-skills/amazon-cart-orders

Conversation

@iskyiskyisky
Copy link
Copy Markdown
Contributor

@iskyiskyisky iskyiskyisky commented Apr 23, 2026

Summary

Two new amazon.com domain skills derived from a logged-in session, capturing traps that cost real round-trips to figure out:

  • cart.md — the cart page renders [data-asin] elements (recommendation strips, "Items you may like") even when the cart is empty, so a naive ASIN scrape returns 8–12 items on an empty cart. Documents the Your Amazon Cart is empty text check as the correct signal, plus the active-subtotal selectors and the price-change banner format.

  • orders.md — three things that aren't obvious:

    1. The order-list card shape (.js-order-card, with stable innerText blocks).
    2. The order-search URL param ?search= does not filter on /your-orders/orders — you have to submit the form (or hit the post-submit URL /your-orders/search/ref=...?opt=ab&search=<query>). The search-results page also collapses to a single .js-order-card regardless of match count, so you have to walk body.innerText instead of iterating cards.
    3. The tracking page's data-test-id selectors (primary-status-eta, tracking-number, carrier-name) all return null. The reliable extraction is anchored on the Arriving … line in body.innerText, with a stable downstream shape that exposes carrier, tracking number, and seller via simple regexes. Also notes that the Ordered / Shipped / Out for delivery / Delivered words on the page are a static legend, not a progress indicator — easy to mistake for live status.

Both files follow the durability guidance from SKILL.md ("the map, not the diary"): no pixel coordinates, no run narration, no user-specific state.

Test plan

  • Open /gp/cart/view.html on an empty cart, verify [data-asin] returns >0 ASINs and the empty-state string check correctly returns true.
  • Search for an item in /your-orders/orders via the URL param alone; confirm it does not filter.
  • Submit the search form and confirm the post-submit URL renders the filtered view with a single .js-order-card.
  • Open a Track package link and confirm [data-test-id="primary-status-eta"] is null while body.innerText.indexOf('Arriving') returns a usable chunk.

Summary by cubic

Add two amazon.com domain skills to reliably read Cart and Orders/Tracking, avoiding common traps that cause false positives and extra requests. Improves selector guidance for empty carts, order search, and tracking details.

  • New Features
    • cart.md: Use the "Your Amazon Cart is empty" string to detect emptiness; do not rely on [data-asin]. Document subtotal selectors (#sc-subtotal-amount-activecart / #sc-subtotal-amount-buybox), stable price-change banner phrases, and "Saved for later" behavior. Scope item scrapes inside [data-name="Active Items"].
    • orders.md: Define .js-order-card fields (order date, total, order #, ETA, item titles) and how to grab the "Track package" link. Explain that ?search= on /your-orders/orders doesn’t filter; submit the form or use /your-orders/search/ref=...?opt=ab&search=<query>. Note search results collapse into one card. On tracking pages, [data-test-id] selectors are unreliable; extract from body.innerText anchored at "Arriving" and parse carrier, tracking ID, and seller. The milestone legend is static and not live status.

Written for commit 17e88b4. Summary will update on new commits.

Two new domain skills for amazon.com derived from a logged-in session:

- cart.md: documents the empty-cart trap where `[data-asin]` selectors
  match recommendation widgets even on an empty cart, plus the stable
  subtotal selectors and the price-change banner format.

- orders.md: covers the order-list card structure, the order-search
  quirk (the `?search=` URL param doesn't filter — must submit the
  form or hit the post-submit `/your-orders/search/` URL), and the
  tracking page (whose `data-test-id` selectors are all null — extract
  from `body.innerText` anchored on the "Arriving" line).
@browser-harness-review
Copy link
Copy Markdown

✅ Skill review passed

Reviewed 2 file(s) — no findings.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="domain-skills/amazon/orders.md">

<violation number="1" location="domain-skills/amazon/orders.md:113">
P2: Tracking extraction is overly coupled to the `Arriving` token and can fail on non-Arriving shipment states.</violation>

<violation number="2" location="domain-skills/amazon/orders.md:138">
P2: Carrier parsing is too restrictive and will mis-parse multi-word carrier names.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.


Pull individual fields with regexes against that chunk:
- ETA: `^Arriving (.+)$` (first line).
- Carrier: `Shipped with (\w+)`.
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Carrier parsing is too restrictive and will mis-parse multi-word carrier names.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At domain-skills/amazon/orders.md, line 138:

<comment>Carrier parsing is too restrictive and will mis-parse multi-word carrier names.</comment>

<file context>
@@ -0,0 +1,151 @@
+
+Pull individual fields with regexes against that chunk:
+- ETA: `^Arriving (.+)$` (first line).
+- Carrier: `Shipped with (\w+)`.
+- Tracking #: `Tracking ID:\s*(\S+)`.
+- Seller (if 3P): `Tracking info provided by (.+)`.
</file context>
Fix with Cubic

chunk = js("""
(() => {
const t = document.body.innerText;
const i = t.indexOf('Arriving');
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Tracking extraction is overly coupled to the Arriving token and can fail on non-Arriving shipment states.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At domain-skills/amazon/orders.md, line 113:

<comment>Tracking extraction is overly coupled to the `Arriving` token and can fail on non-Arriving shipment states.</comment>

<file context>
@@ -0,0 +1,151 @@
+chunk = js("""
+  (() => {
+    const t = document.body.innerText;
+    const i = t.indexOf('Arriving');
+    return i >= 0 ? t.slice(i, i + 1500) : null;
+  })()
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant