$npx -y skills add browserbase/skills --skill ui-testAI-powered adversarial UI testing via the browse CLI. Analyzes git diffs to test only what changed, or explores the full app to find bugs. Tests functional correctness, accessibility, responsive layout, and UX heuristics. Use when the user asks to test UI changes, QA a pull reque
| 1 | # UI Test — Agentic UI Testing Skill |
| 2 | |
| 3 | Test UI changes in a real browser. Your job is to **try to break things**, not confirm they work. |
| 4 | |
| 5 | Three workflows: |
| 6 | - **Diff-driven** — analyze a git diff, test only what changed |
| 7 | - **Exploratory** — navigate the app, find bugs the developer didn't think about |
| 8 | - **Parallel** — fan out independent test groups across multiple Browserbase browsers |
| 9 | |
| 10 | ## How Testing Works |
| 11 | |
| 12 | The main agent **coordinates** — it plans test strategy, delegates to sub-agents, and merges results. Sub-agents do the actual browser testing. |
| 13 | |
| 14 | ### Planning: multiple angles, then execute once |
| 15 | |
| 16 | **You MUST complete all three planning rounds yourself and output them before launching any sub-agents.** Planning happens in your own response — it is NOT delegated to sub-agents. Do not skip ahead to execution. |
| 17 | |
| 18 | **Round 1 — Functional:** What are the core user flows? What should work? Write out each test as: action → expected result. |
| 19 | |
| 20 | **Round 2 — Adversarial:** Re-read Round 1. What did you miss? Think about: different user types/roles, error paths, empty states, race conditions, edge inputs (empty, huge, special chars, rapid clicks). |
| 21 | |
| 22 | **Round 3 — Coverage gaps:** Re-read Rounds 1–2. What about: accessibility (axe-core, keyboard-only), mobile viewports, console errors, visual consistency with the rest of the app? |
| 23 | |
| 24 | **Deduplicate:** Merge all three rounds into one numbered list of tests. Remove overlaps. Assign each test to a group (e.g. Group A, Group B). |
| 25 | |
| 26 | **Then execute once** — launch one sub-agent per group. Each sub-agent receives its specific list of tests to run, nothing more. Sub-agents do not explore or plan — they execute assigned tests and report results. |
| 27 | |
| 28 | Output the three rounds, the merged plan, and the group assignments in your response before calling any Agent tool. |
| 29 | |
| 30 | ### Principles for splitting work |
| 31 | |
| 32 | - **Sub-agents run assigned tests, not open exploration.** The main agent hands each sub-agent a specific numbered list of tests. Sub-agents do not plan, explore, or decide what to test — they execute the list and stop. |
| 33 | - **The bottleneck is the slowest agent** — split work so no single agent has a disproportionate share. Many small agents > few large ones. |
| 34 | - **Size the effort to the change** — a single component fix doesn't need many agents or many steps. A full-page redesign does. Let the scope of the diff drive the plan. |
| 35 | - **No early stopping on failures** — find as many bugs as possible within the assigned tests. |
| 36 | |
| 37 | ### Giving sub-agents a step budget |
| 38 | |
| 39 | **The main agent MUST include an explicit browse step limit in every sub-agent prompt.** Sub-agents do not self-limit — they will run until done unless told otherwise. |
| 40 | |
| 41 | As a rough heuristic: ~25 steps for a few targeted checks, ~40 for a full page with functional + adversarial + a11y, ~75 for multiple pages or a broad category. **Adjust based on what the assigned tests actually require** — these are starting points, not rules. |
| 42 | |
| 43 | As a rough heuristic: ~25 steps for a few targeted checks, ~40 for a full page with functional + adversarial + a11y, ~75 for multiple pages or a broad category. **Adjust based on what the assigned tests actually require** — these are starting points, not rules. |
| 44 | |
| 45 | Every sub-agent prompt must include: |
| 46 | ``` |
| 47 | You have a budget of N browse steps (each `browse` command = 1 step). Count your steps as you go. When you reach N, stop immediately and report: |
| 48 | - STEP_PASS/STEP_FAIL for every test you completed |
| 49 | - STEP_SKIP|<test-id>|budget reached for every test you didn't get to |
| 50 | |
| 51 | Do not retry or continue after hitting the budget. |
| 52 | Run only these tests: [numbered list from the merged plan] |
| 53 | Do not explore beyond the assigned tests. |
| 54 | Do NOT generate an HTML report or write any files. Return only step markers and your findings as text. |
| 55 | ``` |
| 56 | |
| 57 | The main agent should NOT run `browse` commands itself (except to verify the dev server is up). All testing happens in sub-agents. |
| 58 | |
| 59 | **When a sub-agent hits its budget, the main agent accepts the partial results as-is.** Do not re-run or retry the sub-agent. Include SKIPPED tests in the final report so the developer knows what wasn't covered. |
| 60 | |
| 61 | ### Reporting |
| 62 | |
| 63 | **Every sub-agent reports back with:** |
| 64 | ``` |
| 65 | Tests: 8 | Passed: 5 | Failed: 2 | Skipped: 1 | Pages visited: 2 |
| 66 | ``` |
| 67 | |
| 68 | **The main agent merges into a final report with:** |
| 69 | ``` |
| 70 | Tests: 20 | Passed: 14 | |