domain-skills: amazon — cart.md, orders.md#168
Open
iskyiskyisky wants to merge 1 commit intobrowser-use:mainfrom
Open
domain-skills: amazon — cart.md, orders.md#168iskyiskyisky wants to merge 1 commit intobrowser-use:mainfrom
iskyiskyisky wants to merge 1 commit intobrowser-use:mainfrom
Conversation
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).
✅ Skill review passedReviewed 2 file(s) — no findings. |
Contributor
There was a problem hiding this comment.
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+)`. |
Contributor
There was a problem hiding this comment.
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>
| chunk = js(""" | ||
| (() => { | ||
| const t = document.body.innerText; | ||
| const i = t.indexOf('Arriving'); |
Contributor
There was a problem hiding this comment.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theYour Amazon Cart is emptytext check as the correct signal, plus the active-subtotal selectors and the price-change banner format.orders.md— three things that aren't obvious:.js-order-card, with stableinnerTextblocks).?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-cardregardless of match count, so you have to walkbody.innerTextinstead of iterating cards.data-test-idselectors (primary-status-eta,tracking-number,carrier-name) all returnnull. The reliable extraction is anchored on theArriving …line inbody.innerText, with a stable downstream shape that exposes carrier, tracking number, and seller via simple regexes. Also notes that theOrdered / Shipped / Out for delivery / Deliveredwords 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
/gp/cart/view.htmlon an empty cart, verify[data-asin]returns >0 ASINs and the empty-state string check correctly returnstrue./your-orders/ordersvia the URL param alone; confirm it does not filter..js-order-card.Track packagelink and confirm[data-test-id="primary-status-eta"]isnullwhilebody.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.
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-cardfields (order date, total, order #, ETA, item titles) and how to grab the "Track package" link. Explain that?search=on/your-orders/ordersdoesn’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 frombody.innerTextanchored 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.