AGENT SKILL

webapp-testing

Verify a local web app actually renders and behaves in a real browser via Playwright — start the dev server, drive a headless browser, assert on DOM/visible text/navigation, check console errors, capture screenshots. Use as the task_complete gate for any UI change, or to debug 'it compiles but the page is broken'.

使用场景测试与质量
License 许可
MIT
所属仓库
muratovv/ai-hats
最近更新
2026-11-05
Stars
★ 3
Forks
1

01 前言 Front Matter

name
webapp-testing
license
MIT
description
Verify a local web app actually renders and behaves in a real browser via Playwright — start the dev server, drive a headless browser, assert on DOM/visible text/navigation, check console errors, capture screenshots. Use as the task_complete gate for any UI change, or to debug 'it compiles but the page is broken'.

02 资源文件 1

03 SKILL.md 正文

Webapp Testing

Confirm a web app renders and behaves in a real browser before calling a UI change done. Compiling is not working. This is the frontend analog of go test -race: an objective "the app loads and the happy path works" signal.

When to Use

Use as the task_complete gate for any UI change, or to debug integration-level breakage that unit tests miss — routing, event handlers, hydration, layout, console errors. Skip for non-UI code, or when a headless unit/integration test already exercises the exact behavior. This verifies correctness (does it work); for UI quality (is it usable/clear) use ui-ux-review.

Procedure (recon → act → assert)

  1. Start the app — bring up the dev/preview server. Poll the URL until it answers; do not blind-sleep. Tear it down in a finally/cleanup block.
  2. Recon — load the page headless; screenshot + dump the rendered DOM. Identify stable selectors (role / accessible label / data-testid), not brittle CSS paths.
  3. Act — drive the discovered selectors (click, type, navigate) to exercise the happy path plus at least one error/edge path.
  4. Assert — visible text, DOM state, URL after navigation, and key network responses. Await locators; never assert on a guessed timing.
  5. Check console — fail on uncaught errors and unexpected warnings (hydration mismatches, failed requests / 404s).
  6. Capture evidence — screenshot key states for the record.

Completion (task_complete gate)

  • Dev server boots and the target route returns 200 + renders.
  • Happy-path interaction asserted green; one error path checked.
  • No uncaught console errors.
  • Server torn down — no orphan process left running.

Anti-Patterns

  • Asserting on brittle CSS selectors instead of role / label / data-testid.
  • sleep N instead of polling for readiness / awaiting locators.
  • Leaving the dev server running after the run.
  • Treating a successful build or passing unit tests as proof the page works.

Attribution

Distilled from anthropics/skills skills/webapp-testing (Apache-2.0). Procedure-only — upstream Playwright helper scripts are not vendored. Provenance in metadata.yaml under upstream:.

04 同仓库更多 Skills

muratovv
muratovv/ai-hats

tool-evaluation-protocol

Time-bounded protocol for evaluating new tools, libraries, or methodologies before adoption. Use when evaluating a candidate dependency for the project, researching a methodology (e.g. ML/LLM frameworks, testing approaches), or following up on a hype-driven recommendation.

★ 3
muratovv
muratovv/ai-hats

systematic-debugging

4-phase bug-fix protocol (evidence, pattern, hypothesis, verify). Use when investigating any error, failure, or unexpected behavior, handling bug reports from users or monitoring, or diagnosing test failures with non-obvious causes.

★ 3
muratovv
muratovv/ai-hats

skill-template

Canonical template and validation guide for ai-hats skills. Use when creating a new skill, reviewing an existing one for structural compliance, or deciding which pattern fits a new behavior.

Skill与智能体开发
★ 3
muratovv
muratovv/ai-hats

skill-optimization

Audit and refactor library components to eliminate redundancy and staleness. Use during periodic library maintenance, after adding multiple new skills or rules, when a role's token budget is too high, or after retrospectives identify component issues.

Skill与智能体开发
★ 3
muratovv
muratovv/ai-hats

silent-fallback-gate

PreToolUse hook — refuses an Edit or Write that adds an inert broad except. Use when a Python edit was blocked for a silent fallback.

★ 3
muratovv
muratovv/ai-hats

retro-to-framework

Convert an observation about agent behavior — from a retrospective or from a single incident — into a framework-level change (hook, rule, skill, skill update). Use after a retrospective identifies problems that are not project-specific, after an incident where an agent misapplied a component it had read, when CLAUDE.md band-aids accumulate (more than 3 per-project rules that could be generic), or when the same problem recurs across multiple projects.

Skill与智能体开发
★ 3