Logo di Ecommerce Agent Browser Skill

Ecommerce Agent Browser Skill

Community
81211860
ecommerce-agent-browser-skill

通用电商 Agent 浏览器 Skill。通过持久化浏览器、DOM/accessibility-tree 观察、短 id 页面动作、Playwright 执行、recipe、语义轨迹、可选视觉证据和网络 adapter,帮助 Agent 自主操作电商网页;PDD 商家/消费者流程是当前首个已验证平台适配层。

Panoramica

Pubblicato da81211860
Repositoryecommerce-agent-browser-skill
Nome della skillecommerce-agent-browser-skill
Stelle
35
Fork
2
File inclusi
62
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 62

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da 81211860 su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Ecommerce Agent Browser Skill in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/81211860/ecommerce-agent-browser-skill/tree/main
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/81211860/ecommerce-agent-browser-skill.git \
  .claude/skills/ecommerce-agent-browser-skill
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Ecommerce Agent Browser Skill in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Ecommerce Agent Browser Skill non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Ecommerce Agent Browser Skill non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

电商 Agent 浏览器 Skill

Overview

Operate ecommerce web apps through real browser UI while keeping the model as the decision maker. The runtime uses Playwright with a persistent Chromium profile, not a packet-capture browser extension and not token replay. Prefer DOM/accessibility snapshots and semantic recipes; use screenshots, user clicks, or captured browser traffic only as development fallback when a component cannot be read structurally.

This skill now includes a generic Browser Intelligence layer. PDD workflows are a vertical shell on top of that layer; the browser.* commands are site-neutral and may be used on any webpage. Do not put PDD product/customer/store meaning into the generic layer. The model decides whether a browser observation, coordinate, request, or adapter candidate matches the user goal.

Generic browser commands:

bash
node scripts/pdd-operator.mjs browser.observe-light --url https://example.com --out result.json
node scripts/pdd-operator.mjs browser.tabs --include-text --out tabs.json
node scripts/pdd-operator.mjs browser.select-tab --tab-title "Dashboard" --out selected-tab.json
node scripts/pdd-operator.mjs browser.inspect-point --x 320 --y 580 --out point.json
node scripts/pdd-operator.mjs browser.inspect-region --x 240 --y 420 --w 600 --h 220 --out region.json
node scripts/pdd-operator.mjs browser.inspect-row-or-card --x 320 --y 580 --out row.json
node scripts/pdd-operator.mjs browser.zoom-crop --x 240 --y 420 --w 600 --h 220 --scale 2 --out crop.json
node scripts/pdd-operator.mjs browser.script --mode read --script "return helpers.fields()" --out script.json
node scripts/pdd-operator.mjs browser.network-record --duration 5000 --out network.json
node scripts/pdd-operator.mjs browser.adapter-save --input model-approved-adapter.json --save-as adapter.json
node scripts/pdd-operator.mjs browser.adapter-run --adapter-file adapter.json --params '{"page":1}' --out adapter-run.json
node scripts/pdd-operator.mjs browser.memory --op drop --handle page_12 --summary "short retained memory"

Inside a persistent browser session, prefer the shorter live-page aliases for real workflows:

bash
node scripts/pdd-operator.mjs session observe-light --account shop-a --url https://example.com --out page.json
node scripts/pdd-operator.mjs session inspect-region --account shop-a --x 240 --y 420 --w 600 --h 220 --out region.json
node scripts/pdd-operator.mjs session inspect-region --account shop-a --region '{"x":240,"y":420,"width":600,"height":220}' --out region.json
node scripts/pdd-operator.mjs session zoom-crop --account shop-a --x 240 --y 420 --w 600 --h 220 --scale 2 --out crop.json
node scripts/pdd-operator.mjs session script --account shop-a --mode act --model-approved-script true --script-file fallback.js --out script-act.json

browser.observe-light is handle-first: it returns URL/title, visible text, rows/cards/forms/dialogs, short-id pageView, token estimate, screenshot handle, and artifact handles. It does not inline full DOM/AX/HTML/modelEvidence, coordinates, CSS, XPath, or full action registries. Use browser.inspect-point or browser.inspect-region when screenshots are visually useful but small text, IDs, prices, long titles, or form values require precise DOM text. Use browser.tabs/browser.select-tab to enumerate and mechanically select open tabs by model-chosen index, URL, title, or visible text. Use browser.network-record to capture GET/POST/XHR/fetch traffic and produce a mechanical CLI-adapter draft; the model must decide whether to promote it. browser.adapter-save requires modelApprovedAdapter=true and explicit model-chosen operations/verification. browser.adapter-run reads current browser cookies/tokens from the active profile/CDP session, redacts auth from output, and returns response/verification evidence plus a mechanical verificationSummary; HTTP 200 alone is never task success, and the model still decides task success from business verification and page state.

browser.script is the harness-style escape hatch. Use mode=read for DOM/text extraction and diagnosis; it blocks obvious clicks, form submits, DOM mutation, direct network APIs, cookies, and storage access. Use mode=act after the model has chosen the exact low-risk page-native fallback and passes modelApprovedScript=true; it returns pageChange and blocks direct fetch/XHR/cookie/storage access. Use mode=raw when the user has authorized broad testing and the model needs harness-like direct page JavaScript, including page-local fetch; output is still redacted and pageChange must be reviewed.

browser.observe-light.page exposes task-friendly structural evidence: dialogs include text plus visible clickable short ids, tables include headers/row counts/sample rows, rows include row text plus row-scoped action ids, and formControls include labels/placeholders/current values/short ids. These fields are still evidence only; the model decides target identity, form meaning, platform validation, and final success.

For VLM-capable runs, treat screenshot handles as optional visual evidence for layout, occlusion, modals, canvas, icon-only controls, and coordinate planning. Do not use screenshots as the source of truth for small text or business fields; verify IDs, prices, inventory, sales counts, long titles, and form values with browser.inspect-point, browser.inspect-region, or browser.inspect-row-or-card.

For already-open browser windows, set --cdp-url <http://host:port> or PDD_OPERATOR_CONNECT_CDP_URL to attach through Chrome DevTools Protocol. CDP attach mode is generic, keeps the user-owned browser alive, and can prefer a tab via --tab-url <text>, --tab-title <text>, or --tab-text <text>.

Runtime Dependencies

  • Standalone development mode needs Node.js 18+, npm dependencies from package.json, and Playwright's Chromium browser binary.
  • Productized PDD Agent app mode does not require system Node.js. Use the pdd-operator command on PATH, or the absolute command in PDD_OPERATOR_CLI; the app injects a bundled Node shim and PLAYWRIGHT_BROWSERS_PATH.
  • Network access is only needed for first-time standalone npm install and playwright install chromium. The packaged app should already include its dependencies.

Before operating a store in standalone mode, run:

bash
npm run setup
npm run doctor

If a dependency is missing in standalone mode, the agent should fix it directly by running npm run setup from this skill directory. In packaged app mode, do not assume npm or system node exists; use the app's environment self-check and the pdd-operator command. Browser commands also auto-attempt dependency repair once when the Playwright package or Chromium binary is missing.

Set PDD_OPERATOR_HEADLESS=1 for silent default browser operation. Login and risk verification flows still need a visible browser; override with --headless false for those runs.

Operating Rules

  • Scripts are tools, not judges. Treat monitor/product/material candidates from CLI output as evidence for the model to review, not as final business truth. The model must decide whether a candidate is a real product, header, ad, notice, empty state, or aggregate counter before recording it or acting on it.
  • The generic Browser Intelligence layer is also tools-only. It may capture screenshots, DOM text, element chains, region evidence, coordinates, network requests, handles, and adapter drafts, but it must not decide what object is the target, whether a workflow should use CLI, or whether the task succeeded.
  • Do not ask a script to make semantic decisions that depend on page meaning. Use scripts to gather rich DOM/accessibility/text/row/card evidence and to execute confirmed actions; use the model to choose the path, classify candidates, decide whether experience applies, and explain why.
  • When a command returns modelReviewRequired, read productCandidates, pageEvidence, and modelReview; reject false positives such as table headers (30日销量), navigation, notices, and ads. Do not use products unless they are reviewedProducts from model review or the user explicitly requested a low-level debug run.
  • Product material inputCandidates, productUnderstanding, productUnderstandingGate, and experienceStrategy are evidence only. Candidate price/stock values are not publish inputs until the model or user explicitly confirms them. The script must not classify the product, choose category meaning, infer SKU type, decide which experience applies, or decide experience reuse. The model must review the material evidence and explicitly decide category and experience reuse; set productUnderstandingReviewedByModel / modelApprovedCategory only after choosing the category, and set experienceReviewedByModel / modelApprovedExperienceReuse only together with an explicit modelApprovedExperienceId / experienceReuseId and explicit modelApprovedExperienceReuseParts / experienceReuseParts.
  • Product material publish inputs must use the exact product.publish-material contract: title, categoryPath as an array of category levels, categorySearchText, categoryExpectedText, price.groupPrice, price.singlePrice, price.referencePrice, stock, mainImages, detailImages, video, skuSpecs, skuRows, skuImages/skuPreviewImages, productUnderstandingReviewedByModel, and modelApprovedCategory or categoryUserConfirmed when appropriate. skuImages are raw SKU/spec material; row preview upload needs explicit skuRows[].image/previewImage/skuImage or model-chosen row-order skuPreviewImages. If a SKU spec value input is duplicated/equally matching, retry with skuSpecs[].skuSpecValueInputIndex / modelSelectedSkuSpecValueInputIndex or value-specific skuSpecValueInputIndexes. If a SKU table row or cell control is duplicated/equally matching, the tool returns SKU_TABLE_CONTROL_MODEL_REVIEW_REQUIRED; inspect full evidence and retry with skuRows[].skuTableRowIndex / modelSelectedSkuTableRowIndex or skuRows[].skuTableControlIndex / modelSelectedSkuTableControlIndex. Do not invent aliases such as categoryKeywords, skuPlan, or price.marketPrice; convert those model decisions into the standard fields before running the command.
  • If productUnderstandingGate.modelReviewRequired=true, CATEGORY_SELECTION_UNRESOLVED returns only broad/recent/mismatched visible categories, CATEGORY_CANDIDATE_MODEL_REVIEW_REQUIRED returns multiple matching category candidates, or category evidence is insufficient, treat that as evidence for the model, not a script verdict. The model decides whether to keep searching, retry with categoryCandidateIndex / modelSelectedCategoryCandidateIndex, use a visible category it can justify, adjust the publish input, or ask the user for an external business decision. Set modelApprovedCategory=true only after the model has made that current-category decision; set categoryUserConfirmed=true only when the model actually asked and the user answered in this conversation.
  • Default page evidence belongs to the model, not to scripts. observe and explore expose a light model-facing pageView made of visible text lines plus bracket ids; full modelEvidence with raw visible body text, raw DOM HTML, controls, rows, tables, dialogs, visible text elements, open shadow-root HTML/text, accessibility names, and visual evidence paths stays lossless in evidenceRef/sidecar when --out --evidence-sidecar or the desktop app runtime is used. It is marked redaction: none, truncation: none, and semanticFiltering: none; do not hide evidence from Flash, but do not keep large registry/coordinate/control tables in the main context.
  • Use pageView as the primary DOM action view. Plain text is normal page text; bracket ids such as [a] 批量下架 mark the exact visible element the model can operate. To click it, run session act --target-id a or action JSON { "kind": "click", "target": { "shortId": "a" } }. The tool maps the short id to the live DOM and clicks internally; viewport x/y, actionRegistry, coordinates, and controls are not part of the model-facing default protocol. Ids are shortest-first: one character while possible, then two, then three.
  • Read pageView.scrollState before deciding a target is absent. hasMoreBelow / hasMoreAbove / document height / visible range are mechanical page facts; if the goal might be below, above, or lazy-loaded, the model should run a model-chosen scroll, observe again, then interpret the new evidence.
  • Evidence IDs are mechanical selectors, not business decisions. shortId / actionId / id values like a or a0 come from current pageView; unchanged clickable elements keep their short ids within the same persistent browser session when their mechanical fingerprint is stable. If an action returns ACTION_ID_NOT_FOUND_NEED_OBSERVE or ACTION_ID_AMBIGUOUS_NEED_OBSERVE, observe/explore again and choose a current bracket id. Legacy coordinateId remains a fallback for visual/canvas diagnostics only.
  • Treat large browser evidence as temporary memory. Keep the latest necessary observation and pageChange in active reasoning; drop or summarize stale screenshot/DOM/network handles after comparing them. If an app runner controls the model context, it should inject only active evidence, summaries for dropped/summarized handles, and recoverable handle indexes. If the SDK cannot prune old messages, keep using handle-first commands so large details do not enter the history by default.
  • For CLI adapters, always store at least one model-defined business verification rule when the response body has a success/error code or expected result shape. A status rule such as {type:"status",status:200} proves only transport success; pair it with jsonPathEquals, bodyIncludes, or another explicit rule so browser.adapter-run can surface business failures without deciding the user goal.
  • Use browser.script only after the normal observe/inspect/act path is insufficient, unless the user explicitly asks for harness-like direct testing. Start with mode=read to extract DOM evidence; use mode=act with modelApprovedScript=true for controlled operations; use mode=raw for authorized harness-like direct page JS/fetch. Always review post-script pageChange before declaring success.
  • In Windows Bash, do not use cmd-style %USERPROFILE% or %APPDATA% paths for artifacts; use $PWD, $HOME, $APPDATA, or the injected absolute workspace/material paths.
  • Always inspect the current page before acting. For real task flows, start with scripts/pdd-operator.mjs session observe-light and use session inspect-region / session inspect-point / session zoom-crop for targeted progressive disclosure. Escalate to full session observe or session explore only when light pageView and targeted evidence are insufficient. Use session act so the browser window, page state, focus, and transient confirmation UI stay alive across CLI calls. Use plain observe/act only for short diagnostics, dry isolated tests, or when intentionally closing the browser after the command.
  • Fast-path state-changing flow: session observe-light -> model chooses current short ids/regions -> session act sequence when trigger and confirmation can share one live page -> read pageChange.afterSnapshot.pageView -> targeted inspect/zoom only if uncertain -> one terminal business verification. Do not run heavy scans after every small click unless pageChange is ambiguous or the final business state must be proven.
  • Treat operation as observe/explore -> one action -> read pageChange -> interpret -> next action. act and recipe action steps return pageChange, a generic structural diff across URL, dialogs, controls, visible text, rows, page regions, counters/status text, feedbackSignals, fieldSignals, focus, and scroll. A short-id click uses the previous snapshot as the before baseline instead of re-observing before the click, then captures a fresh afterSnapshot.pageView after the click. pageChange.beforeModelEvidence and pageChange.afterSnapshot.modelEvidence are the full before/after evidence for the model, including screenshot/canvas visual evidence when enabled by the CLI; use them instead of relying on script summaries. After comparing, treat old pageView blocks as stale and keep only the latest pageView plus evidence refs in active reasoning unless you intentionally reread a sidecar. actionSignals and scriptBlockingCandidates are hints only, not final decisions.
  • Transient confirmation UI must stay in the same live browser session. Prefer one session act sequence when the model can choose the trigger and confirmation together. If the first session act already opened a modal/popover/confirm box, read that action's pageChange.afterSnapshot.pageView and click the model-selected fresh confirmation short id because the persistent session keeps the same page alive. Do not use a second plain standalone act command for transient UI; plain act closes the browser context after the command and can lose the dialog.
  • Do not narrow feedback detection to red validation text, toast messages, or known upload counters. Any visible structural change can be the feedback: new text, removed text, disabled/enabled controls, a dialog/drawer/popover, a tab/route change, row changes, counter changes, feedbackSignals, fieldSignals, focus/scroll changes, or a changed page region. If pageChange is empty or ambiguous, run observe or explore again before continuing.
  • When explore returns openIssues, treat each suggestedAction as script-candidate evidence only. The model must choose the repair path from full evidence before changing strategy: upload missing media, fill required text fields with model/user-approved values, use choose for custom dropdowns/comboboxes with exact visible options, or click the page's own "去处理" control. After each repair, observe the returned pageChange before the next action.
  • If visible empty fields are already reported by openIssues/fieldSignals, repairOpenIssues first returns repair candidates for model review. Re-run it with modelApprovedRepair=true only after the model has decided that generic repair is appropriate and supplied exact repairLabels/modelApprovedRepairLabels or values keys for the fields to repair; scripts must not choose repair targets, even when there is only one candidate, and must not choose dropdown options or business values by themselves.
  • Prefer current evidence over stale memory. Role/name/label/placeholder/text selectors remain useful, but for visible DOM controls prefer current pageView bracket ids because they avoid ambiguity without exposing coordinates. Use legacy coordinateClick / clickAt only when the target is genuinely visual/canvas/hotspot and no DOM short id exists. Scripts execute only the model-supplied id or coordinates and must not infer the target meaning.
  • If the model only needs to reveal lower page content, use a scroll action such as session act --account default --action scroll --out scroll.json or {kind:"scroll",deltaY:800}. Do not click arbitrary bracket ids as a substitute for scrolling.
  • For forms, pageView may expose fields as [id] <label> value=<current> placeholder=<hint>. Choose fill targets by the explicit label and current value, not by generic placeholders such as 请输入. If several fields share the same placeholder, use their labels, row text, or targeted inspect evidence before filling.
  • If LOCATOR_MODEL_REVIEW_REQUIRED is returned, inspect returned samples and current pageView / modelEvidence; retry with a unique current short id, row scope, css/xpath+index, or explicit model-selected index. Do not repeat the same ambiguous text/label/placeholder selector.
  • For text entry after a model-selected focus/click, type or fill may use the currently focused editable element when no target is supplied, or when duplicate matching placeholders/labels prevent a unique locator but the focused element matches the model-supplied target constraints. Focus is only reliable inside the same live CLI action/sequence; across separate CLI commands, include target.shortId, target.actionId, target.id, or another exact current selector. Put the intended text in value; text, input, and content are accepted as mechanical aliases for brittle model outputs. If the model supplies exact coordinates on type/fill as a visual fallback, the tool mechanically clicks that point and then types/fills the editable focused by that click in the same live action. This is a coordinate/focus-preserving fallback, not permission for scripts to pick among candidates.
  • Upload targets must be model-scoped. If multiple file inputs match the same section and accept type, upload returns UPLOAD_INPUT_MODEL_REVIEW_REQUIRED; inspect full evidence and retry with target.index or a more specific section/target. If a filechooser route exposes multiple matching upload buttons, it returns UPLOAD_BUTTON_MODEL_REVIEW_REQUIRED; retry with fileChooserButtonIndex/uploadButtonIndex or a more specific section/target. Scripts must not rank-pick a matching upload input or button.
  • Do not pipe JSON command output through head, grep, or other truncating filters when deciding state. Use --out <file>, then read the saved JSON fields such as ok, code, message, goodsId, foundState, failedStep, results, and pageChange.
  • Do not Read very large result JSON files wholesale. Use a JSON parser or node -e to extract the specific non-semantic evidence fields you need, such as ok, code, message, failedStep, availableCategorySamples, suggestedRetry, and modelEvidence. Extraction may reduce transport size, but it must not make the business decision for the model.
  • For product state changes, work from the user's goal first. Recipe aliases and saved experience are accelerators, not rails. Inspect the current page and prefer any semantically correct page-native control whose scope matches the requested records; verify the final state. Use first-class single-record aliases such as product.scan-state, product.down-shelf, product.delete-downshelved, product.delete-draft, product.delete-rejected, and product.resubmit-draft as fallbacks or when the target is one record. If an alias or page-native action fails after a possible state-changing click, scan the affected goods IDs or list state before retrying.
  • Do not stop on ordinary recoverable failures. If login/risk verification is not blocking and the user's intent is clear, diagnose, retry with a safer semantic path, scan final state, and continue until the task is done or a real stop condition below is reached.
  • Treat PDD login, SMS, CAPTCHA, face verification, and other risk controls as handoff points. Do not bypass them.
  • State-changing actions need explicit authorization, but the user's current request counts as that authorization when it clearly names the target and action. Do not ask for a second confirmation in that case; pass the required --confirm <token> and complete the task. Ask only when the target, action, scope, or buyer/store impact is ambiguous.
  • Keep each store account in a separate browser profile. Do not copy cookies or tokens between accounts.
  • Prefer --account <alias> over raw --profile in productized flows. Every command that opens or operates PDD pages (login-check, observe, explore, act, recipes, and product/customer tools) should explicitly include the intended --account <alias>. --account shop-a maps to ~/.pdd-operator/profiles/shop-a by default.
  • In app/productized flows, respect PDD_OPERATOR_HEADLESS=1 and stay silent/headless unless the user explicitly asks to see the browser or PDD requires login/risk verification.
  • Never run two concurrent jobs with the same --account or --profile; the runtime uses an application-level profile lease plus Chromium's own lock as a second guard. Use a distinct account alias for each parallel store.
  • Write artifacts under artifacts/ or a caller-provided output directory. Never log cookies, tokens, SMS codes, passwords, buyer personal data, or payment data.

Quick Start

From the skill directory in standalone mode:

bash
npm run setup
node scripts/pdd-operator.mjs accounts init --account shop-a
node scripts/pdd-operator.mjs accounts status --account shop-a
node scripts/pdd-operator.mjs login-check --account shop-a --wait
node scripts/pdd-operator.mjs session start --account shop-a
node scripts/pdd-operator.mjs session observe-light --account shop-a --url https://mms.pinduoduo.com/goods/goods_list
node scripts/pdd-operator.mjs session menus --account shop-a
node scripts/pdd-operator.mjs session stop --account shop-a

When running from another desktop agent with a workspace outside this skill directory, avoid cd ... && ... command chains. In productized PDD Agent app mode, prefer pdd-operator so the bundled runtime works on machines without Node.js. In Windows Bash, use pdd-operator first, then "$PDD_OPERATOR_POSIX_CLI" if the PATH command is unavailable; reserve "$PDD_OPERATOR_CLI" for PowerShell/cmd. Do not paste literal C:\...\pdd-operator.cmd or C:\...\PDD Agent.exe paths; the POSIX shim handles path conversion. In standalone mode, prefer npm --prefix "$PDD_OPERATOR_HOME" or the absolute script path supplied by the calling app so permission allowlists can match stable command prefixes without hard-coding a machine-specific path:

bash
PDD_OPERATOR_HOME="/absolute/path/to/pdd-merchant-operator"
pdd-operator menus --account shop-a
"$PDD_OPERATOR_POSIX_CLI" menus --account shop-a
npm --prefix "$PDD_OPERATOR_HOME" run doctor
npm --prefix "$PDD_OPERATOR_HOME" run setup
node "$PDD_OPERATOR_HOME/scripts/pdd-operator.mjs" menus --account shop-a

If Reasonix also has a global copy under ~/.reasonix/skills/pdd-merchant-operator, make sure it is synchronized with this source-of-truth directory or configured as a thin pointer to it; stale global copies are a common cause of missing recipes. When validating with Reasonix, require a transcript that contains real tool_start and tool entries with command output. Plain reasonix run without tool execution can emit command-looking text that was not actually run; do not treat that as proof.

For a known workflow, run a recipe:

bash
node scripts/pdd-operator.mjs run-recipe \
  --account shop-a \
  --recipe recipes/product.create-basic.recipe.json \
  --input /absolute/path/product.json

Add --confirm publish when the user's current request explicitly asks to publish/list the item. Use --dry-run to validate recipe structure, input, and confirmation gates without opening the browser or changing store state.

Common recipe aliases are also exposed as first-class CLI commands so external agents can use intuitive names without remembering run-recipe paths:

bash
node scripts/pdd-operator.mjs product.scan-state --account shop-a --goodsId 123 --soft-fail
node scripts/pdd-operator.mjs product.resubmit-draft --account shop-a --goodsId 123 --confirm publish
node scripts/pdd-operator.mjs product.publish-material --account shop-a --input /absolute/path/product.json --confirm publish
node scripts/pdd-operator.mjs product.delete-draft --account shop-a --goodsId 123 --confirm deleteDraft
node scripts/pdd-operator.mjs product.delete-rejected --account shop-a --goodsId 123 --confirm deleteDraft
node scripts/pdd-operator.mjs customer-service.reply --account shop-a --conversationText "买家原话" --message "回复内容" --confirm sendMessage

Workflow

  1. Check login with login-check. If login is required, open the headed browser and ask the user to finish login.
  2. Read guides/index.md, then load only the one module guide matching the requested operation.
  3. Observe the page with observe or menus; read the returned JSON, not the screenshot, when deciding next action.
  4. Use an existing recipe if available. For new features, use act steps against observed component IDs or semantic targets, then interpret the returned pageChange before the next action.
  5. For record pages, scope actions to a stable row identifier such as goodsId, orderId, aftersaleId, or visible conversation text using target.rowText before clicking row actions.
  6. If a component cannot be found structurally, use visual/manual assistance once with record-trace, then normalize the raw trace into a recipe.
  7. Verify the final state with a recipe assertion/extract step. For product publishing, first interpret the submit action's pageChange on the current page, then verify the product list state (在售中, 发布中, 已驳回) rather than trusting the success page.
  8. After a previously unknown path succeeds, update the matching guide and add a recipe so future runs can load it progressively instead of rediscovering it.

Autonomy And Learning Contract

When a recipe fails, a selector is missing, or a page differs from the guide, the agent must keep working without asking the user to say "continue" again. Follow references/failure-recovery.md, then guides/path-capture.md: observe/explore, try one low-risk semantic action, observe again, and loop until the path is proven or a real stop condition is reached. Preserve any created record IDs for resume or cleanup.

Stop and ask the user only for: login/SMS/CAPTCHA/face/risk verification, genuinely ambiguous target/action/scope, missing business facts that cannot be inferred safely such as real price or stock, legal/qualification decisions, or an operation whose buyer/store impact is unclear. Do not treat selector drift, hidden file inputs, failed first scans, slow page loads, or unreadable widgets as user blockers. For authorized MVP/test operations, use the required --confirm token and proceed.

Whenever a new workaround or route succeeds, save the reusable notes or draft recipe under artifacts/candidates/, promote stable steps to recipes/ when replayed, and update exactly one relevant guide under guides/. A successful one-off fix that is not written back into the skill is incomplete.

Progressive Guides

Start with guides/index.md. It maps business modules to focused guides:

  • guides/product-management.md
  • guides/shipping-management.md
  • guides/aftersales-management.md
  • guides/customer-service.md
  • guides/shop-management.md
  • guides/marketing-promotion.md
  • guides/data-center.md
  • guides/finance-risk.md
  • guides/auxiliary-modules.md
  • guides/account-session.md
  • guides/navigation-and-coverage.md
  • guides/path-capture.md
  • guides/product-material-package.md

Keep SKILL.md as the thin entrypoint. Put durable selectors, routes, blockers, and proven recipes in the relevant guide. Do not bulk-load every guide for a single task.

Account Switching and Parallel Work

Login state is stored locally in the browser profile directory for each account alias:

text
~/.pdd-operator/profiles/<account-alias>

This profile directory contains browser cookies/localStorage/session state and is not part of the skill. Keep it outside the skill so the skill can be copied safely without copying credentials. Set PDD_OPERATOR_PROFILE_ROOT=/some/path to choose another portable per-machine location.

Use separate aliases for separate stores:

bash
node scripts/pdd-operator.mjs accounts init --account store-a
node scripts/pdd-operator.mjs accounts init --account store-b
node scripts/pdd-operator.mjs login-check --account store-a --wait
node scripts/pdd-operator.mjs login-check --account store-b --wait

After both accounts are logged in, switching is just choosing the alias:

bash
node scripts/pdd-operator.mjs menus --account store-a
node scripts/pdd-operator.mjs menus --account store-b

Parallel jobs are allowed only when each job uses a different alias/profile and separate artifact paths. The runtime does not copy cookies, tokens, or profile files between accounts.

accounts status --account <alias> shows the local profile path, operator lock state, last login-check result, and any visible store identity captured from the merchant page. This metadata is for operator safety only; it must not include cookies, tokens, passwords, SMS codes, buyer personal data, or payment data.

Core Commands

  • login-check: open the merchant backend and report whether the account is logged in.
  • accounts: list, initialize, inspect status, or print the local profile path for account aliases.
  • session: start/reuse/stop a persistent browser daemon and proxy page commands through it. Use session observe-light, targeted session inspect-*/session zoom-crop, session act, session run-recipe, and recipe aliases for real workflows so one browser page survives until session stop, task completion, or user stop. Use full session observe/session explore only when light evidence is insufficient. The proxy does not make business decisions; it only keeps the live page and executes the same model-selected commands. session navigate --url / session goto --url are mechanical navigation aliases for model-selected URLs.
  • observe: emit structured page JSON plus pageView and full modelEvidence: raw visible body text, raw DOM HTML, controls, rows, tables, dialogs, visible text elements, open shadow-root HTML/text, screenshot/canvas visual evidence paths, and optional raw accessibility-tree nodes with no redaction, truncation, or semantic filtering. Use --wait-text or --settle-ms when the main content loads after the shell.
  • explore: emit a structured unknown-path exploration pack plus model-facing pageView, lossless modelEvidence/evidenceRef, recordListAffordances, action templates, and a candidate recipe skeleton. It does not expose model-facing actionRegistry, coordinates, controls, or suggestedTargets; choose visible controls from pageView ids. recordListAffordances, goalActionHints, and batch actionTemplates are evidence/templates only and require model review of row scope and toolbar semantics before acting. Use --wait-text <record id/text> on list pages so visible lines are captured after data loads. Only use explicit --limit, --row-limit, or --issue-limit for human-requested small diagnostics.
  • If observe or explore lands on a login or verification page, the command returns LOGIN_REQUIRED / CAPTCHA_REQUIRED and still includes the full snapshot.modelEvidence or exploration modelEvidence. Treat that as a page-state signal, not a business decision; ask the user to complete login in a visible browser before retrying the current goal.
  • menus: discover visible sidebar/top navigation links and produce candidate feature IDs.
  • act: run one semantic or coordinate action such as click, coordinateClick, clickAt, doubleClick, rightClick, check, focus, blur, clear, hover, press, scroll, drag, mouse, selectRows, sequence, fill, type, setValue, select, choose, repairOpenIssues, upload, waitFor, assert, openMenu, or goto. Prefer current pageView short ids for DOM controls: session act --target-id a or { "kind": "click", "target": { "shortId": "a" } }. Use coordinateClick / clickAt only when the model has chosen exact viewport x/y for a visual/canvas fallback; coordinate aliases on click such as target.position, target.center, or target.action are accepted only as mechanical x/y normalization. session act --target <json>, --target-id <id>, --action-id <id>, --short-id <id>, --coordinate-id <id>, and action files shaped as {actions:[...]} are also mechanically normalized into the same model-selected click/coordinateClick/sequence protocol. Use setValue when the model has chosen one exact target component and one exact value for native inputs, range/color/date/time fields, selects, multi-selects, contenteditable fields, or value-like custom elements; it sets only the supplied value and returns an error instead of inventing missing values or choosing fallback options. Native select uses the same model-reviewed exact option semantics as setValue; duplicate exact options return SET_VALUE_OPTION_AMBIGUOUS until the model supplies optionIndex, modelSelectedOptionIndex, or optionCandidateNumber. For choose, if the same exact visible option appears more than once, the tool returns CHOICE_OPTION_MODEL_REVIEW_REQUIRED; the model must retry with optionTarget, zero-based optionIndex/modelSelectedOptionIndex, one-based optionCandidateNumber, or a more specific exact option. Use sequence when multiple page-native steps must share one live page state, such as select rows -> click toolbar action -> confirm. An action-file whose top-level JSON is an array is treated as that same sequence shape. Real child action steps return pageChange with full before/after modelEvidence, including visual evidence paths by default in CLI mode, so the model can understand what changed after each action. The sequence container itself does not duplicate a full extra pageChange unless traceChange:true is set on the sequence. In a sequence, later child steps may use beforeModelEvidenceRef pointing to the previous child afterSnapshot.modelEvidence; this is a lossless in-result reference, not truncation or filtering.
  • For long real flows, pass --evidence-sidecar together with --out. In the desktop App, PDD_OPERATOR_AUTO_EVIDENCE_SIDECAR=1 enables the same lossless sidecar behavior automatically for --out results. Large modelEvidence blocks are then written as complete JSON files beside the result and replaced by evidenceRef objects containing path, SHA256, byte count, and source pointer. This is a lossless storage optimization only; before making semantic or business decisions, read the referenced evidence file and use its modelEvidence.
  • evidence.read: read and verify a complete modelEvidence sidecar without opening a browser. Use evidence.read --path <evidenceRef.path> --sha256 <evidenceRef.sha256> when the next decision depends on the full page evidence. You can also resolve from the main result with evidence.read --result <result.json> --source-pointer <evidenceRef.sourcePointer>. Use --metadata-only only for integrity checks; semantic decisions require the full returned modelEvidence.
  • Ambiguous targets such as repeated text: "删除", role: "button", name: "删除", broad css, or broad xpath return LOCATOR_MODEL_REVIEW_REQUIRED instead of clicking the first match. If rowText/withinText itself matches multiple rows, the command returns ROW_SCOPE_MODEL_REVIEW_REQUIRED. Inspect full modelEvidence and retry with unique rowText, withinText, id, css, xpath, model-selected index, or model-selected rowIndex.
  • run-recipe: execute a JSON recipe with templated input. Each action-like step includes pageChange; inspect failed and post-submit step changes before routing recovery.
  • run-recipe --dry-run: validate a recipe/input and print planned steps without opening the browser.
  • Product material publishing: product.publish-material uses only the current input JSON as authoritative data; it does not read sibling recipe-input.json, draft-input.json, or create-input.json files to fill missing fields. It defaults to the create-basic flow for normal material folders, treats sourceGoodsId as a template route only when explicitly requested by publishStrategy/useSourceGoodsId, searches/selects the model-approved leaf category instead of broad recent categories, returns CATEGORY_SELECTION_UNRESOLVED with visible alternatives and attempts when the leaf is unavailable, uploads section-scoped main/detail media, keeps loose specImages/skuImages as raw material evidence unless the model maps them to SKU rows or explicitly approves detail-image merge, verifies submit feedback, scans the final list state, records successful category/upload/repair experience under the operator experience store, and offers same-leaf experience evidence on later product.publish-material runs without letting it decide the current category. It uses product.publish-similar only as an optional template route.
  • Recipe commands: product.scan-state, product.publish-similar, product.resubmit-draft, product.down-shelf, product.delete-draft, product.delete-rejected, product.delete-downshelved, and customer-service.reply dispatch to matching single-record recipes and accept either --input <json> or direct flags such as --goodsId. For multi-record goals, discover and execute page-native batch controls through observe/explore/act instead of relying on a synthetic all-items shortcut.
  • record-trace: let a human or visual agent operate once while the runtime records semantic click/fill events.
  • normalize-trace: convert a raw trace into reusable semantic recipe steps.
  • diagnose: capture URL, DOM summary, accessibility snapshot, screenshot, and recent console errors for debugging.

Unknown Path Protocol

When no recipe exists, a recipe is narrower than the user's goal, or the page exposes a better matching control, do not guess from memory and do not stop at the first failure. Start with session observe-light, read the compact pageView first, and use session inspect-region / session inspect-point / session zoom-crop when the model needs more detail. Escalate to session explore --goal "<operation>" only when the light view and targeted inspections are insufficient. Execute one low-risk session act step or a model-approved sequence using the selected current short id/selector, interpret its pageChange, and keep looping in that same persistent session until the path is proven or a stop condition is reached. Scripts are eyes and hands only: they may collect DOM/accessibility/action evidence, but the model decides what the page means, which controls match the user's intent, and whether a candidate is real data or just a label such as 30日销量. Prefer page-native bulk controls for multi-record goals when their text and selected scope match the request; otherwise use single-record recipe aliases in a serialized fallback. If pageChange is empty, too broad, ambiguous, or returns ACTION_ID_NOT_FOUND_NEED_OBSERVE, run session observe-light first and only escalate to full session observe/session explore if needed. If structural data is insufficient, use visual/manual trace as a learning tool for selectors, not as a reason to wait for user permission. Use rowText for record actions and assertValue after critical fills. For product flows, reserve product.scan-state or a scanProductState step for precondition checks that affect the route, possible state-changing failures, or terminal verification instead of running it after every small click. If product.publish-similar returns PRODUCT_STATE_MISMATCH with foundState: "草稿箱" and row text 编辑中, use product.resubmit-draft --goodsId <id> --confirm publish instead of rerunning publish from the source product. For product deletions, trust only the post-delete scanProductState "absent": true result; raw notText can pass while a table is still loading. If a write recipe fails after creating a record, inspect returned vars such as goodsId, run login-check --wait if needed, then resume with a scan/cleanup recipe instead of restarting. When the path succeeds, save a candidate recipe under artifacts/candidates/, replay it, then promote it to recipes/ and update the module guide.

References

  • Read references/architecture.md before changing the runtime design.
  • Read guides/index.md before choosing module-specific instructions.
  • Read references/coverage-plan.md before expanding module coverage.
  • Read references/recipe-authoring.md before adding or editing recipes.
  • Read references/trace-format.md when converting visual/manual operations into reusable steps.
  • Read references/failure-recovery.md when handling login expiry, CAPTCHA, page changes, or missing selectors.

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

e 2 file in più.

Domande frequenti

Cosa fa la skill IA Ecommerce Agent Browser Skill?

通用电商 Agent 浏览器 Skill。通过持久化浏览器、DOM/accessibility-tree 观察、短 id 页面动作、Playwright 执行、recipe、语义轨迹、可选视觉证据和网络 adapter,帮助 Agent 自主操作电商网页;PDD 商家/消费者流程是当前首个已验证平台适配层。

Perché usare Ecommerce Agent Browser Skill su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Ecommerce Agent Browser Skill è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Ecommerce Agent Browser Skill in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/81211860/ecommerce-agent-browser-skill/tree/main. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Ecommerce Agent Browser Skill?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Ecommerce Agent Browser Skill?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Ecommerce Agent Browser Skill: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Ecommerce Agent Browser Skill è gratuita?

È pubblicata su GitHub da 81211860. Consulta il repository per i termini di licenza. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇