← Commit history

native-browser-first sourcing: root strategy + per-site sub-skills (digikey/mouser/snapeda/manufacturer + template)

John Lauer ·bed1a65929 ·3mo ago ·parent 3266ceb
7 files changed +225
SKILL.mdadded+92
@@ -0,0 +1,92 @@+---+name: chip-sourcing+description: Native-browser-first strategy for sourcing electronic parts (chip-fetcher and any EE-site task). Drive the user's REAL signed-in Chrome/Edge via the adom-browser-extension so cookies/SSO/saved-logins/captcha-trust all work — no auth to recreate in pup, and it bypasses bot-walls (DigiKey blocks pup). Sub-skills cover one website each. Triggers: search DigiKey/Mouser/SnapEDA/Arrow, source a part, fetch CAD, find a chip, parametric search, chip-fetcher.+---++# chip-sourcing — native-browser-first parts sourcing++When you source parts (chip-fetcher, datasheet hunts, CAD pulls, parametric searches, stock/price+lookups) you are driving websites that gate behind **logins, SSO, and bot-detection**. The old way+was Puppeteer (`pup`) with a cold profile where we tried to recreate the user's auth. **Stop doing+that by default.** The user's own browser is already signed in to every distributor and CAD site —+drive *that* instead.++## The rule: native browser first, always explain why++**Default to the user's real signed-in Chrome/Edge via the `adom-browser-extension`** (the+`native-browser` bridge, `nbrowser_*` verbs through `adom-desktop`). It runs *inside the actual+logged-in profile*, so:++- **Real credentials are already there** — DigiKey/Mouser/SnapEDA/Arrow logins, SSO, saved+  carts, distributor pricing tiers. Nothing to recreate, no secrets to handle.+- **Human-trust passes** — cookies + a real browser fingerprint mean **captcha and bot-walls+  don't fire**. Several sites now **hard-block pup** (DigiKey is the clearest example) but serve the+  native session normally.+- **Multi-profile** — it can drive every signed-in profile the user has (`nbrowser_profiles`).++When you pick a surface, **tell the user which one and why** in one sentence+(e.g. *"Using your signed-in Chrome via the browser extension so DigiKey doesn't bot-block us and+your distributor pricing shows."*). Never silently fall back.++### The decision ladder++1. **Native browser (preferred)** — `native-browser` bridge present + a profile signed in → use it.+2. **pup (fallback)** — extension not installed and the site doesn't block pup. Say you're using a+   cold profile and may hit logins/captcha.+3. **webview (last resort)** — only to *show* the user a result, not to scrape.++### If the extension is NOT installed — encourage it (with the why)++Check first: `adom-desktop bridge_list` → is `native-browser` present and not paused? If absent:++> "I can do this far better if you install the **Adom browser extension** (Chrome + Edge). It lets me+> drive your *already-signed-in* browser, so I use your real DigiKey/Mouser logins and distributor+> pricing, and we skip the bot-walls that block the headless browser (DigiKey blocks it outright).+> One-time install: https://wiki.adom.inc/adom/adom-browser-extension — want me to walk you through it?"++Then fall back to pup for the current task, and re-offer next time.++## How to drive it (verb surface)++The bridge **mirrors the pup verb surface** as `nbrowser_*` (43 verbs): `nbrowser_open_window`,+`nbrowser_navigate`, `nbrowser_eval`, `nbrowser_screenshot`, `nbrowser_open_tab`,+`nbrowser_profiles`, `nbrowser_use_profile`, `nbrowser_profile_block`, … Same JSON-args convention+as `browser_*`.++```bash+adom-desktop bridge_list                                  # is `native-browser` running?+adom-desktop nbrowser_profiles '{}'                       # which signed-in profiles exist+adom-desktop nbrowser_open_window '{"sessionId":"src","url":"https://www.digikey.com/en/products/result?keywords=VL53L"}'+adom-desktop nbrowser_eval '{"sessionId":"src","expr":"document.title"}'+adom-desktop nbrowser_screenshot '{"sessionId":"src","maxWidth":1400}'+```++**Gotchas (learned live):**+- **`--target <name>` when 2+ desktops are connected** (e.g. `winvm` + `AdomLapper`). The native+  browser lives on the user's laptop — pin `--target AdomLapper`. `open_window`/`eval` may auto-route+  but `screenshot` errors `ambiguous_target` without it.+- Windows open in the **background** (focus is not stolen) — screenshot them in place.+- Screenshot returns base64 inside `output` → `json.loads(resp['output'])['base64']`.+- Currently **Windows-only** (macOS is a Kyle fast-follow). On macOS, fall back to pup + explain.++## This is chip-fetcher's default++chip-fetcher's sourcing ladder (Manufacturer → SnapEDA → Mouser → DigiKey → Arrow → Ultra Librarian+→ Component Search Engine) should run through the native browser whenever the bridge is present, and+only drop to pup when it isn't. See the chip-fetcher page: https://wiki.adom.inc/john/chip-fetcher++## Per-website sub-skills — grow coverage for the whole industry++Each popular electronics site gets **one sub-skill** under `skills/<site>/SKILL.md` (NOT a separate+wiki page). A site sub-skill captures: the search/parametric URL patterns, how to extract results+from its DOM, login/cookie notes, whether pup is blocked, and the category-drill for parametric+families. Seeded here: **digikey, mouser, snapeda, manufacturer (ST example)**. To add a site, copy+`skills/_template/SKILL.md`. Build this up until every popular electronics website is covered.++| Sub-skill | Site | pup blocked? |+|---|---|---|+| `skills/digikey` | digikey.com | **Yes** — native browser required |+| `skills/mouser` | mouser.com | Intermittent |+| `skills/snapeda` | snapeda.com | Login-gated (native = already in) |+| `skills/manufacturer` | ST / TI / Nordic / NXP … | Varies; ST datasheet CDN curl-blocks |+| `skills/_template` | (copy to add a site) | — |
install.shadded+13
@@ -0,0 +1,13 @@+#!/usr/bin/env bash+# chip-sourcing-skillpack installer — deploys the root strategy skill + every per-site sub-skill.+set -euo pipefail+DEST="${CLAUDE_SKILLS_DIR:-$HOME/.claude/skills}"+install_one(){ local name="$1" src="$2"; mkdir -p "$DEST/$name"; cp "$src" "$DEST/$name/SKILL.md"; echo "  installed $name"; }+echo "Installing chip-sourcing skillpack -> $DEST"+install_one "chip-sourcing" "SKILL.md"+for d in skills/*/; do+  s="$d/SKILL.md"; [ -f "$s" ] || continue+  base="$(basename "$d")"; [ "$base" = "_template" ] && continue+  install_one "chip-sourcing-$base" "$s"+done+echo "Done. Root skill: chip-sourcing. Add a site by copying skills/_template -> skills/<site> and reinstalling."
skills/_template/SKILL.mdadded+22
@@ -0,0 +1,22 @@+---+name: chip-sourcing-SITE+description: (Template) Source parts from <SITE> via the native signed-in browser. Copy this folder to skills/<site>/ and fill in the search URL, extraction selectors, login/cookie notes, and whether pup is blocked.+---++# <Site Name> (<domain>)++**pup blocked?** <yes/no/intermittent> · **login-gated?** <yes/no>++## Search URL pattern+```+https://<domain>/...?q=<QUERY>+```++## Extract results (DOM selectors)+```js+// return JSON of MPN / stock / price / datasheet-link from the result DOM+```++## Notes+- Detail-page URL shape, facets to narrow by manufacturer, any banners/quirks, download flow.+- Record the date + a proven query when you verify it live.
skills/digikey/SKILL.mdadded+38
@@ -0,0 +1,38 @@+---+name: chip-sourcing-digikey+description: Source parts from DigiKey via the native signed-in browser. DigiKey HARD-BLOCKS pup — the native browser is required. Keyword search, parametric category drill, MPN extraction.+---++# DigiKey (digikey.com)++**DigiKey hard-blocks Puppeteer.** Use the native browser (`nbrowser_*`). A logged-in profile also+surfaces your distributor pricing and stock.++## Keyword search → category landing+```+https://www.digikey.com/en/products/result?keywords=<QUERY>+```+A broad query (e.g. `VL53L`) lands on a **category overview**, not a flat table. The ICs are usually+under **Optical Sensors → Distance Measuring** (eval boards/kits are separate categories). Grab the+category link, then navigate into it:+```js+[...document.querySelectorAll("a")].filter(a=>/distance measuring|optical sensor/i.test(a.textContent))+  .map(a=>a.href).filter(h=>/products\/filter/.test(h))+```++## Parametric category → MPNs+After navigating into a `/products/filter/<cat>/<id>?s=...` page, extract manufacturer part numbers:+```js+(function(){var s=new Set();+ [...document.querySelectorAll("a,td,span,div")].forEach(e=>{+   var m=(e.textContent||"").match(/\bVL53L[0-9][A-Z0-9]+\b/g);  // adapt the regex per family+   if(m)m.forEach(x=>s.add(x));});+ return JSON.stringify([...s].sort());})()+```+Proven 2026-06-22: `VL53L` → 25 MPNs across the VL53L0/1/3/4/5/7/8 ToF families, native session+unblocked (`blocked:false`) where pup is refused.++## Notes+- Detail page: `https://www.digikey.com/en/products/detail/<mfr-slug>/<mpn>/<pid>` — has datasheet+  link, stock, price breaks, ECAD model links (SnapEDA/Ultra Librarian).+- High-volume days show an "ATTENTION … may require an additional business day" banner — harmless.
skills/manufacturer/SKILL.mdadded+23
@@ -0,0 +1,23 @@+---+name: chip-sourcing-manufacturer+description: Source from the chip MANUFACTURER first (ST/TI/Nordic/NXP/...) via the native browser — the authoritative family list, datasheets, and official CAD. Manufacturer-first is the top of chip-fetcher's ladder.+---++# Manufacturer-first (ST / TI / Nordic / NXP / Microchip / …)++The manufacturer is the **authoritative** source for the full family, the latest datasheet, and+official 3D STEP. chip-fetcher's ladder starts here. Native browser matters because several+manufacturer datasheet CDNs **curl-block** but serve a real browser (use `fetch().arrayBuffer()`+inside the page to grab the PDF with the browser's fingerprint).++## ST example — the VL53Lx ToF family+```+https://www.st.com/en/imaging-and-photonics-solutions/proximity-sensors.html+https://www.st.com/en/<series-slug>.html        # e.g. vl53l8.html+```+ST's product-selector table lists every orderable variant + datasheet + STEP. Extract the family:+```js+[...document.querySelectorAll("a,td")].map(e=>e.textContent).join(" ").match(/\bVL53L[0-9][A-Z0-9]+\b/g)+```+Cross-check the manufacturer family against the DigiKey/Mouser parametric pull to catch NRND/new+variants. Then hand each MPN to chip-fetcher for the CAD bundle.
skills/mouser/SKILL.mdadded+20
@@ -0,0 +1,20 @@+---+name: chip-sourcing-mouser+description: Source parts from Mouser via the native signed-in browser. Keyword + manufacturer-filtered search, MPN + stock + price extraction.+---++# Mouser (mouser.com)++Native browser preferred (intermittent pup blocking + your account pricing). ++## Keyword search+```+https://www.mouser.com/c/?q=<QUERY>+https://www.mouser.com/ProductDetail/<mfr>/<mpn>+```+Results render in a table (`#productTable` / rows with `data-...` and a part-number anchor). Extract:+```js+[...document.querySelectorAll("a[href*='/ProductDetail/']")].map(a=>a.textContent.trim()).filter(Boolean)+```+Stock + price live in the row; signed-in shows your negotiated pricing. Manufacturer facet on the+left narrows to e.g. STMicroelectronics for a clean family list.
skills/snapeda/SKILL.mdadded+17
@@ -0,0 +1,17 @@+---+name: chip-sourcing-snapeda+description: Pull symbol/footprint/3D CAD from SnapEDA via the native signed-in browser — login-gated downloads work because the profile is already authenticated.+---++# SnapEDA (snapeda.com)++CAD downloads are **login-gated**. The native browser is already signed in, so downloads + the+"request a part" flow work without re-auth (the core reason native beats pup here).++## Search → part → CAD+```+https://www.snapeda.com/search/?q=<MPN>+```+The part page exposes **Symbol / Footprint / 3D Model** download buttons and the target-EDA selector+(KiCad / EAGLE / Altium / OrCAD / Fusion). Drive the download in the user's profile; the file lands+in their normal Downloads, then `pull_file` it back to the container if chip-fetcher needs it.