webcmd-autofix
Identifies and repairs broken web automation adapters when website DOM or API changes occur.
Install
mkdir -p .claude/skills/webcmd-autofix && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/19460" && unzip -o skill.zip -d .claude/skills/webcmd-autofix && rm skill.zipInstalls to .claude/skills/webcmd-autofix
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Automatically fix broken Webcmd adapters when commands fail. Load this skill when a webcmd command fails; it guides you through collecting a trace artifact, patching the adapter, retrying, and safely reporting reproducible upstream defects. Works with any AI agent.Key capabilities
- →Diagnose failures in webcmd adapters
- →Collect trace artifacts for debugging
- →Patch adapter source code to fix selectors or schema changes
- →Retry failed commands after repairs
- →Draft and submit upstream bug reports to GitHub
How it works
The skill uses trace artifacts to identify the root cause of a webcmd failure, guides the user through patching the adapter, and verifies the fix through retries.
Inputs & outputs
When to use webcmd-autofix
- →Fixing broken scraping selectors
- →Repairing failing automation tasks
- →Updating adapters after site changes
- →Debugging failed web commands
About this skill
Webcmd AutoFix - Automatic Adapter Self-Repair
When a webcmd command fails because a website changed its DOM, API, or response schema, diagnose, fix the adapter, and retry. Do not only report the error when the failure is repairable.
Safety Boundaries
Hard stops before any code change:
- Human-action handoff: if a failure returns
handoff.status === action_required, stop before trace collection or AutoFix. Give the userhandoff.actionand anyWebcmd browser:orhandoff.viewUrllink, then wait. Never request or enter credentials, passwords, or CAPTCHA answers. After the user reports done, runhandoff.verifyCommandwhen present; verification must succeed before retrying. Without a verifier, inspect fresh browser state and verify the intended post-action state before any retry, especially for write commands. AUTH_REQUIRED(exit code 77): if a site login command exists, runwebcmd <site> login, give itsaction_requiredinstructions and any returnedaction_urlorview_urlto the user, and wait. Run the returnedverify_command(normallywebcmd <site> whoami); verification must succeed before retrying the original command. If no site login command exists, stop browser writes, hand the visible browser to the user, and wait. After they report done, take fresh browser state and use an available identity check or verify the intended post-action state before retrying. Their report alone is not verification. Never request, type, echo, store, or automate passwords, OTPs, recovery codes, cookies, or session secrets.BROWSER_CONNECT(exit code 69): stop. Tell the user to runwebcmd doctor.- CAPTCHA / raw-browser user takeover: stop automation. Follow the human-action handoff above when one is returned; otherwise let the user act in the visible browser. Verification must succeed before retrying. With no verifier, take fresh browser state and verify the intended post-action state before any retry. The user's report alone is not verification. CAPTCHA is not an adapter issue.
- Rate limiting / IP block: stop. This is not an adapter issue.
Scope constraint:
- Modify only the file at
adapterSourcePathin the tracesummary.mdfront matter. That path is authoritative and may beclis/<site>/...in the repo orplugins/<site>/...in a plugin repo or~/.webcmd/clis/<site>/...for user-local installs. - Never modify
src/,extension/,tests/,package.json, ortsconfig.jsonduring autofix.
Retry budget: maximum 3 repair rounds per failure. A round is diagnose -> patch -> retry. If 3 rounds do not resolve it, stop and report what was tried.
Prerequisite
webcmd doctor
This verifies extension and daemon connectivity for browser-dependent repairs.
When To Use
Use this skill when webcmd <site> <command> fails with repairable errors:
- SELECTOR: element not found or DOM changed.
- EMPTY_RESULT: no data returned and evidence suggests a schema/API drift.
- API_ERROR / NETWORK: endpoint moved, params changed, or network contract broke.
- PAGE_CHANGED: page structure no longer matches the adapter.
- COMMAND_EXEC: runtime error in adapter logic.
- TIMEOUT: page loads differently or waits for the wrong signal.
Before Repair: Empty Does Not Always Mean Broken
EMPTY_RESULT, and sometimes a structurally valid selector that returns no rows, may be a real platform answer rather than an adapter bug. Rule this out before a repair round:
- Retry with an alternative query or entry point. If
webcmd reddit search "X"returns 0 butwebcmd reddit search "X guide"returns 20, the adapter is likely fine and the first query was too narrow. - Spot-check in a normal browser tab. If the data is visible there but the adapter is empty, the issue may be auth state, soft blocking, or rate limiting; use
webcmd doctoror re-login rather than editing source. - Look for soft 404s. Some platforms return HTTP 200 with an empty payload when an item is hidden, deleted, or temporarily unavailable. A retry after a short wait can distinguish transient hiding from real deletion.
- Treat a successful empty search as an answer. If the adapter reached the endpoint, got HTTP 200, and the platform returned
results: [], report "no matches" instead of patching.
Proceed only when the empty or missing-selector result is reproducible across retries and alternative entry points.
Before Repair: An Error Modal Is Not Always the Site's Verdict
Persistent-session adapters (siteSession: 'persistent') share one tab per site, so error text in the body may be inherited or context-scoped rather than real. Before patching code:
- Check the trace screenshot and
location.href: a modal over a blank page or the wrong URL means the tab carried stale DOM from a previous command, not that the site rejected this request. - Check session-scoped context: sites often scope results to a selected city, date, or account. A "closed" / "unavailable" verdict can simply mean the browser's selected context does not match the request (for example, a seat layout opened while the site's location cookie points at another city).
- Reproduce in a clean tab (
webcmd browser open <url>) before trusting the verdict. If it only fails in the adapter's persistent tab, fix state handling (freshPage: true, dismiss-and-renavigate, context preconditions) instead of selectors.
Step 1: Collect Trace Context
Run the failing command with retained trace:
webcmd <site> <command> [args...] --trace retain-on-failure 2>trace-error.yaml
On failure, stderr contains the normal error envelope plus a trace block:
ok: false
error:
code: SELECTOR
message: "Could not find element: .old-selector"
trace:
schemaVersion: 1
webcmdVersion: "..."
traceId: "..."
dir: "/path/to/.webcmd/profiles/default/traces/..."
summaryPath: "/path/to/.webcmd/profiles/default/traces/.../summary.md"
receiptPath: "/path/to/.webcmd/profiles/default/traces/.../receipt.json"
Read summaryPath first. It is the LLM-oriented entry point and includes:
---
schemaVersion: 1
webcmdVersion: "..."
traceId: "..."
status: failure
site: "example"
command: "example/search"
adapterSourcePath: "/path/to/clis/example/search.js"
errorCode: "SELECTOR"
errorMessage: "Could not find element: .old-selector"
---
Trace artifacts include:
summary.md
receipt.json
trace.jsonl
network.jsonl
console.jsonl
state/
screenshots/
Do not ask the user to rerun with legacy diagnostic environment variables. Trace artifacts are the repair evidence path.
Step 2: Analyze The Failure
Read the trace summary and adapter source. Classify root cause:
| Error code | Likely cause | Repair strategy |
|---|---|---|
| SELECTOR | DOM restructured or class/id changed | Explore current DOM and find a stable selector |
| EMPTY_RESULT | API response schema changed, data moved, or real empty result | Check network and visible page before patching |
| API_ERROR | Endpoint URL changed or new params required | Discover current API through network evidence |
| AUTH_REQUIRED | Login flow changed or cookies expired | Follow the conditional AUTH_REQUIRED policy in Safety Boundaries: use the site login command and its returned verifier when available; otherwise use human handoff plus fresh-state supported verification. |
| TIMEOUT | Page loads differently or lazy-load signal changed | Update wait conditions |
| PAGE_CHANGED | Major redesign | May need full adapter rewrite through webcmd-adapter-author |
Answer these questions:
- What is the adapter trying to do? Read
adapterSourcePath. - What did the page look like when it failed? Read
summary.md, thenstate/if needed. - What network requests happened? Read failed network in
summary.md, thennetwork.jsonlif needed. - What gap exists between adapter expectations and current page reality?
Step 3: Explore The Current Website
Use webcmd browser to inspect the live site. Do not use the broken adapter for exploration.
For DOM changes:
webcmd browser open https://example.com/target-page
webcmd browser state
For API changes:
webcmd browser open https://example.com/target-page
webcmd browser state
webcmd browser click <N>
webcmd browser network
webcmd browser network --filter author,text,likes
webcmd browser network --detail <key>
Use the key field from network output with --detail.
Step 4: Patch The Adapter
Patch only adapterSourcePath.
Common fixes:
// Selector update
document.querySelector('.new-class')
// Endpoint update
fetch('/api/v2/search')
// Response schema update
const items = data.data.items;
// Wait condition update
await page.wait({ selector: '[data-loaded="true"]' });
Rules:
- Make minimal changes; do not refactor unrelated code.
- Keep output structure compatible:
columnsand row keys must remain aligned. - Prefer stable API evidence over brittle DOM scraping when discovered.
- Use only
@agentrhq/webcmd/*imports; do not add third-party packages. - Test after patching.
- Never relax
verify/<cmd>.jsonfixtures to silence a failure. A failingpatterns,notEmpty,mustNotContain, ormustBeTruthyrule usually means adapter output is wrong. Edit a fixture only when the site itself legitimately changed shape, such as a URL format migration, and note the change in~/.webcmd/sites/<site>/notes.md.
Step 5: Verify The Fix
Run:
webcmd <site> <command> [args...]
If it still fails, collect a fresh trace and start another round. Stop after 3 rounds.
Step 6: Report A Reproducible Upstream Defect
Offer to file an upstream issue after either outcome:
- A local adapter repair was verified and should be contributed upstream.
- A Webcmd defect remains reproducible after the three-round retry budget.
Do not file for AUTH_REQUIRED, BROWSER_CONNECT, ARGUMENT, or CONFIG;
CAPTCHA, rate limitin
Content truncated.
When not to use it
- →When the failure is caused by authentication requirements
- →When the site is protected by CAPTCHA or IP blocking
- →When the browser connection is failing
Prerequisites
Limitations
- →Maximum of 3 repair rounds per failure
- →Cannot modify core files outside of the adapter source path
- →Requires manual verification of empty results
How it compares
It provides an automated diagnostic and repair loop for web scraping adapters instead of requiring manual debugging of DOM changes.
Compared to similar skills
webcmd-autofix side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| webcmd-autofix (this skill) | 0 | 14d | Review | Advanced |
| dev-browser | 53 | 4mo | Review | Intermediate |
| chrome-devtools | 41 | 6mo | Review | Intermediate |
| n8n-expression-syntax | 6 | 3mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by agentrhq
View all by agentrhq →You might also like
dev-browser
SawyerHood
Browser automation with persistent page state. Use when users ask to navigate websites, fill forms, take screenshots, extract web data, test web apps, or automate browser workflows. Trigger phrases include "go to [url]", "click on", "fill out the form", "take a screenshot", "scrape", "automate", "test the website", "log into", or any browser interaction request.
chrome-devtools
mrgoonie
Browser automation, debugging, and performance analysis using Puppeteer CLI scripts. Use for automating browsers, taking screenshots, analyzing performance, monitoring network traffic, web scraping, form automation, and JavaScript debugging.
n8n-expression-syntax
czlonkowski
Validate n8n expression syntax and fix common errors. Use when writing n8n expressions, using {{}} syntax, accessing $json/$node variables, troubleshooting expression errors, or working with webhook data in workflows.
simple-fetch
yoloshii
Basic MCP skill demonstrating CLI-based execution pattern for fetching URL content
python-repl
gptme
Interactive Python REPL automation with common helpers and best practices
agent-browser
vercel-labs
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.