External site profile learning

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

External site profile learning is an AI agent skill from the GitHub repository gabrielmoreira/agent-skills-mirror. Use this skill when investigating, adding, validating, or debugging external website profiles for the 99idea Playwright browser demo. It teaches how to probe selectors, classify failure modes, add config-driven profiles, and validate both heuristic and Gemini flows.

How to use this skill

Skill file

External site profile learning skill

Use this skill when working on the target Playwright browser project (for example, the 99idea demo project).

This project is a Playwright-based browser demo that supports config-driven external site profiles through:

What this skill is for

Use this skill when the task involves any of the following:

Core rules

  1. Prefer URL or title verification for external sites whenever possible.
  2. Prefer stable, unique selectors over generic selectors like button or [name="q"].
  3. If a site profile exists, the final plan should use the profile's exact searchInputSelector and submitSelector.
  4. Keep GitHub out of the default regression matrix. It works, but repeated probing can trigger rate limits.
  5. Classify the site's execution tier before writing a browser profile:
  1. Treat these as different failure classes:

Dual-engine awareness (inspired by opencli)

When stabilizing a site, consider whether the profile should be:

A good profile should record not just how to interact with the UI, but also what the best execution path is.

Standard workflow

1. Probe the site

Open the homepage in Playwright and inspect:

Record:

2. Classify the site

Use this decision process:

3. Add the profile

When the site is a good fit, add a data-only profile to scenarios\site-profiles.json with:

Keep the behavior in code and the site data in JSON.

Recommended profile-writing rules:

4. Validate both planning modes

Validate in this order:

  1. Heuristic run
  2. Gemini / LLM run

Use commands like:

npm run validate:external:core
npm run validate:external:popup
npm run validate:external:heavy
npm run validate:external
npm run validate:external:llm:core
npm run validate:external:llm:popup
npm run validate:external:llm:heavy
npm run validate:external:llm
node src\run-demo.js --allow-external --url "https://example.com/" --goal "Search Example for AI and verify that the URL includes q=AI."
node src\run-demo.js --scenario <temp-scenario.json> --planner llm

Before Gemini validation, ensure:

If the site hangs on full load, use a temporary scenario with:

5. Record the failure mode if it does not fit

Use these interpretations:

The selector is too broad. Add a stronger container-qualified selector.

The control is hidden, disabled, off-screen, or not opened yet.

The site likely needs a specific submit control instead of Enter.

Consider a special scenario instead of a default profile.

Do not force it into the stable regression matrix.

Known good profiles

These are already proven patterns in this project:

Wikipedia

Python.org

arXiv

YouTube

CNN

Bilibili

Special case

GitHub

GitHub works through the search palette, but repeated probing can trigger secondary rate limits.

Recommended pattern:

  1. click button[aria-label="Search or jump to…"]
  2. type into #query-builder-test
  3. press Enter
  4. verify URL contains q={searchTerm}

Do not treat GitHub as a normal default regression target.

Blocked or incomplete sites

BBC

Tencent News

Zhihu

Implementation notes for future agents

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.