Universal web adaptation

From gabrielmoreira/agent-skills-mirror · View interactive version

Universal web adaptation is an AI agent skill from the GitHub repository gabrielmoreira/agent-skills-mirror. Use this skill when asked to work with an unfamiliar public website and the goal is to make progress generically before writing site-specific rules. It teaches Copilot how to probe controls, classify UI patterns, try multiple search and navigation strategies, follow popups, and only create a site pr

How to use this skill

Skill file

Universal web adaptation skill

Use this skill when the user wants a general solution across many websites, not a one-by-one manual integration first.

This skill is especially suitable for:

For the 99idea Playwright project, this skill should work together with:

Core principle

Always try this order:

  1. Capability discovery — check if opencli already supports the site (opencli list)
  2. Auth cascade — classify: PUBLIC → COOKIE/SESSION → HEADER → LOGIN-GATED
  3. Generic adaptation — probe UI controls and try heuristic strategies
  4. Temporary scenario tuning — adjust runtime before assuming selectors are wrong
  5. Popup / opener / alternate-submit handling
  6. Site profile only if generic adaptation still fails

The goal is to minimize per-site handwork.

Execution path decision (inspired by opencli)

Before touching the DOM, first determine which execution layer to use:

if opencli has an adapter for this site:
    use opencli (zero LLM cost, deterministic)
elif the site has a public API:
    use fetch (structured data, no rendering)
elif the site renders server-side (SSR):
    use web_fetch or Playwright (metadata extraction)
else:
    use Browser Agent with login-state or mark blocked

This avoids wasting time on SPA shells that will never yield results via scraping.

What “generic adaptation” means

When facing a new site, do not immediately create a profile. First try to discover:

Standard workflow

1. Probe the page

Collect candidates for:

Prefer candidates whose metadata includes:

For each candidate, record:

2. Classify the site UI

Put the site into one of these buckets:

Auth cascade classification (from opencli)

Also classify the site's auth requirements:

3. Try generic action strategies

Try these in order:

  1. fill visible search input + press Enter
  2. fill visible search input + click nearest likely submit
  3. if search is hidden, click likely opener then retry 1 and 2
  4. if click or Enter opens a popup, switch to the popup and continue there
  5. verify success by:

Prefer URL verification whenever available.

4. Use temporary runtime tuning before giving up

If the page is heavy or slow:

Do not assume selectors are wrong if the real problem is heavy page load behavior.

5. Decide whether to keep it generic or create a profile

Stay generic if:

Create a dedicated profile only if:

Failure classification rules

Strict mode violation

Meaning:

Response:

Timeout waiting for visible/editable

Meaning:

Response:

Enter does nothing

Meaning:

Response:

Search opens a new tab/popup

Meaning:

Response:

Login / anti-bot / rate-limit

Meaning:

Response:

Output expectations

When using this skill, the agent should produce:

  1. execution path recommendation: opencli / fetch / browser — and why
  2. auth cascade classification: PUBLIC / COOKIE / HEADER / LOGIN-GATED
  3. the site UI classification
  4. the generic strategy attempted
  5. whether generic adaptation succeeded
  6. whether a site profile is actually needed
  7. the final stable selectors or blocker reason

Also include explicit evidence lines when possible:

Proven lessons from this environment

When to combine with other skills

Practical rule of thumb

If a new site can be made to work by:

then keep it in the generic path first.

If success depends on an exact remembered selector or a unique UI ritual, then promote it into a site profile.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.