Token导航 LogoToken导航

Agent Skill · 研究检索

frontend-testing(前端测试)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

frontend-testing 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证为 MIT,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 52,401。

总安装 559周安装 24GitHub Stars 35下载 196核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:frontend-testing(前端测试)
来源仓库:https://github.com/chongdashu/phaserjs-tinyswords
仓库路径:skills/frontend-testing
安装命令:
npx skills add https://github.com/chongdashu/phaserjs-tinyswords --skill frontend-testing
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/chongdashu/phaserjs-tinyswords --skill frontend-testing

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

解锁快速可靠的信心保障机制,通过精准测试层选择与去随机化提升失败可诊断性。测试失败应为真实问题暴露,而非“测试说谎”,最大化信号与最小化噪声。覆盖用户核心风险场景,如崩溃、数据丢失与认证失效,确保产品稳定性。适用于任何前端项目,需结合项目框架(如 React、Vue)定制夹具与断言逻辑。

frontend-testing 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/frontend-testing

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/chongdashu/phaserjs-tinyswords --skill fronten…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

frontend-testing 怎么安装?

在终端执行 npx skills add https://github.com/chongdashu/phaserjs-tinyswords --skill frontend-testing。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

frontend-testing 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

frontend-testing 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

frontend-testing 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

frontend-testing 用的人多吗?

公开数据是累计安装 559 次,近一周安装 24 次,下载 196 次,GitHub 35 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

frontend-testing 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
frontend-testing

前端测试 · 本页

55935操作浏览器MIT有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Frontend Testing

Unlock reliable confidence fast: enable safe refactors by choosing the right test layer, making the app observable, and eliminating nondeterminism so failures are actionable.

Philosophy: Confidence Per Minute

Frontend tests fail for two reasons: the product is broken, or the test is lying. Your job is to maximize signal and minimize “test is lying”.

Before writing a test, ask:

  • What user risk am I covering (money, progression, auth, data loss, “can’t start” crashes)?
  • What’s the narrowest layer that catches this bug class (pure logic vs UI vs full browser)?
  • What nondeterminism exists (time, RNG, async loading, network, animations, fonts, GPU)?
  • What “ready” signal can I wait on besides setTimeout?
  • What should a failure print/screenshot so it’s diagnosable in CI?

Core principles:

  1. Test the contract, not the implementation: assert stable user-meaningful outcomes and public seams.
  2. Prefer determinism over retries: make time/RNG/network controllable; remove flake at the source.
  3. Observe like a debugger: console errors, network failures, screenshots, and state dumps on failure.
  4. One critical flow first: a reliable smoke test beats 50 flaky tests.

Workflow Decision Tree

Pick the test type by the cheapest layer that provides the needed confidence:

  • Unit tests (fastest): pure functions, reducers, validators, math, pathfinding, deterministic simulation steps.
  • Component/integration tests (medium): UI behavior with mocked IO (React Testing Library / Vue Testing Library / Testing Library DOM).
  • E2E tests (slowest, highest confidence): critical user flows across routing, storage, real bundling/runtime.
  • Visual regression (specialized): layout/pixel regressions; for canvas/WebGL, only after locking determinism.
  • A11y checks: great for DOM UIs; limited value for pure canvas unless you expose accessible DOM overlays.

Quick Start (Any Project)

  1. Define 1 smoke flow: “page loads → user can start → one key action works”.
  2. Choose runner:

- Prefer Playwright for browser E2E + screenshots. - Prefer Testing Library for DOM component behavior. - Prefer unit tests for logic you can run without a browser.

  1. Add a “ready” signal in the app (DOM marker, window flag, or game event) and wait on that.
  2. Fail loudly: treat console errors and failed requests as test failures.
  3. Stabilize: seed RNG, freeze time, fix viewport/DPR, disable animations, and remove network variability.

Playwright Patterns (Especially Useful For Games)

Use Playwright when you need “real browser” confidence:

  • Drive input via mouse/keyboard/touch; treat the canvas like the user does.
  • Add a test seam: expose a small, stable test API on window (read-only state + a few commands).
  • Prefer waitForFunction-style readiness over sleep; gate on “scene ready” / “assets loaded” / “first frame rendered”.
  • For screenshots: lock viewport, device scale factor, fonts, and animation timing.
  • For 9-slice / canvas UI regressions: add a dedicated UI harness scene/page and assert via targeted screenshots (see references/phaser-canvas-testing.md).

If using the Playwright MCP tools (browser automation inside Codex), follow the same mindset:

  • Use browser_console_messages and browser_network_requests to catch silent failures.
  • Use browser_evaluate to assert window.__TEST__ state and to set up deterministic mode.
  • Use browser_take_screenshot for visual assertions after determinism is enforced.

Reconnaissance-Then-Action (Borrowed From Real Debugging)

When a UI is dynamic, don’t guess selectors—recon first, then act:

Quick decision guide:

Task → Is it static HTML (no JS runtime needed)?
  ├─ Yes → read the HTML to find stable selectors/content, then automate
  └─ No  → treat as dynamic: run the app, wait for readiness, then inspect rendered state
  1. Navigate and wait for readiness:

- For many webapps: wait for a meaningful “loaded” element (preferred). - networkidle can help for SPAs, but avoid it if the app uses websockets/polling.

  1. Capture evidence (what the user actually sees):

- screenshot (full page for DOM; targeted for canvas) - console errors + failed requests

  1. Discover selectors from the rendered state:

- prefer role/text/label selectors over brittle CSS

  1. Execute actions using discovered selectors and re-check state.

Common pitfall: ❌ Inspect/interact before the app is ready. ✅ Wait on an explicit ready signal (DOM marker or window.__TEST__.ready), not a sleep.

Server Lifecycle Helper (Playwright E2E)

When the dev server isn’t already running, use the bundled helper as a black box:

  • Run python scripts/with_server.py --help first.
  • Start one (or multiple) servers, wait for their ports, then run your test command.

Example:

python scripts/with_server.py --server "npm run dev" --port 5173 -- npm test

Flake Reduction Checklist

  • Replace sleeps with explicit readiness conditions.
  • Control time (Date.now, timers), RNG, and animation loops.
  • Make network deterministic (mock, record/replay, or run against a seeded local backend).
  • Eliminate “first-run” differences (asset caches, fonts) or warm them explicitly.
  • Lock environment: viewport, DPR, locale/timezone, and rendering settings.

Anti-Patterns to Avoid

❌ Testing the wrong layer: E2E tests for pure logic. Better: unit tests for logic; reserve E2E for integration contracts.

❌ Testing implementation details: asserting DOM structure/classnames or internal engine objects. Better: assert user-meaningful outputs (text, navigation, score/HP changes) or a small stable test seam.

❌ Sleep-driven tests: wait 2s then click. Better: wait on explicit readiness (DOM marker, event, window flag).

❌ Uncontrolled randomness: RNG/time-based behaviors in assertions. Better: seed RNG, freeze time, and assert stable invariants.

❌ Pixel snapshots without determinism (especially canvas/WebGL). Better: add deterministic mode first; then screenshot selectively.

❌ Snapshot explosion: hundreds of snapshots that no one can interpret. Better: keep snapshots targeted (critical screens); prefer specific assertions for behavior.

❌ Retries as a strategy: “just bump retries in CI”. Better: fix readiness and determinism; use retries only as temporary guardrails.

Variation Guidance (Prevent One-Size-Fits-All)

Vary the approach based on:

  • UI type: DOM app vs canvas/WebGL game vs hybrid.
  • Risk: core revenue/progression flows get E2E first; edge UI polish gets component tests.
  • CI constraints: headless-only, limited GPU, slow CPUs, no audio devices.
  • Test seam availability: if you can add a stable window.__TEST__ API, assert state; if not, stick to black-box input/output.

Remember

You can make almost any frontend (including canvas/WebGL games) testable by adding a tiny, stable seam for readiness + state. This skill is meant to empower creative, high-signal testing rather than cargo-cult checklists. Aim for tests that are boring to maintain: deterministic, explicit about readiness, and rich in failure evidence. One reliable smoke test is the foundation; everything else compounds from there.

Bundled Resources

Read these only when needed:

  • references/playwright-mcp-cheatsheet.md: patterns for using Playwright MCP tools for assertions, waiting, and diagnostics.
  • references/phaser-canvas-testing.md: deterministic mode + hooks for Phaser/canvas/WebGL games.
  • references/flake-reduction.md: deeper flake triage and stabilization tactics.

Use these scripts as black boxes (run --help first; don’t read source unless you must):

  • scripts/with_server.py: start/wait/stop one or more dev servers around a test command.
  • scripts/imgdiff.py: lightweight screenshot diff helper (requires pip install pillow).

平台分布

Codex

24.98%
按下载量换算49

Claude Code

23.44%
按下载量换算46

OpenCode

16.22%
按下载量换算32

Gemini CLI

12.59%
按下载量换算25

windsurf

8.1%
按下载量换算16

Cursor

3.26%
按下载量换算6

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills