Token导航 LogoToken导航

Agent Skill · 前端设计

writing-webdriverio-code(编写 webdriverio 代码)

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

writing-webdriverio-code 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 6,501。

总安装 494周安装 21GitHub Stars 4下载 173核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/klamping/webdriverio-skills --skill writing-webdriverio-code

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于辅助文档、README、Markdown 和内容稿件的整理与改写。适合提炼结构、补齐章节、统一术语或检查链接,提升内容可读性。使用时应保留项目已有事实和路径,避免写成确定结论;对外文案需注意语气控制。

安装命令:npx skills add https://github.com/klamping/webdriverio-skills --skill writing-webdriverio-code。支持 Codex、Claude、Cursor、Gemini CLI,通过 GitHub 仓库安装。

来源仓库内路径:skills/writing-webdriverio-code

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

writing-webdriverio-code 怎么安装?

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

writing-webdriverio-code 支持哪些 AI 工具?

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

writing-webdriverio-code 需要什么权限?

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

writing-webdriverio-code 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

writing-webdriverio-code 用的人多吗?

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

writing-webdriverio-code 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

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

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
writing-webdriverio-code

编写 webdriverio 代码 · 本页

4944操作浏览器未明确通过

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

SKILL.md 原文

Writing WebdriverIO Code

Convert scaffold comments into production-ready test code.

This skill can take either:

  • a scaffold created by creating-test-structure, or
  • an existing WebdriverIO spec that needs new tests, refactors, or bug fixes.

In both cases, it produces concrete WebdriverIO implementation that is stable, readable, and debuggable.

When to Use

  • A scaffold exists and needs conversion from pseudo-code to WDIO commands/assertions.
  • An existing test file needs additional scenarios.
  • Existing tests are flaky, brittle, or incorrect and need fixes.

When Not to Use

  • You need full-suite scaffolding from a markdown test plan (use creating-test-structure).
  • You are only reorganizing describe/it hierarchy without code implementation.
  • You need broad test strategy decisions (test pyramid/scope) rather than file-level WDIO code.

Input Contract

  • A scaffolded spec file with pseudo-code comments (optional).
  • Or an existing implemented spec file to extend/fix.
  • Existing page objects, fixtures, and helpers from the project.
  • Project conventions (linting, naming, assertion style).

Project Context Files

Before implementation, read project cache files when available:

  • .webdriverio-skills/project-context.md
  • .webdriverio-skills/project-context.json
  • .webdriverio-skills/custom-rules.md
  • .webdriverio-skills/health-recommendations.md
  • references/website-analysis/<target>/website-analysis.md
  • references/website-analysis/<target>/website-analysis.json

Use these as the default source for conventions, scripts, environment usage, and team overrides.

Use website analysis references for route/component context, expected states, and auth-gated flow awareness.

<target> should resolve to lowercase site host (prefer user URL or project baseUrl host). If unavailable, use unknown-target and proceed with other context sources.

If files are missing or stale, run managing-project-customizations first.

Conversion Workflow

  1. Identify whether the target is scaffold-conversion or direct test enhancement/fix.
  2. Load project context and custom rules, then apply them as hard constraints.
  3. Implement comments in execution order when pseudo-code exists.
  4. Prefer existing page object methods before creating new ones.
  5. Use resilient selectors and explicit expectations.
  6. Remove pseudo-code comments once behavior is clear.
  7. Keep only comments that explain non-obvious intent.

Suite Startup State Hygiene

  • At suite start, reset state that can leak between tests (cookies, local storage, session/auth state).
  • Make startup preconditions idempotent so re-runs produce the same baseline.
  • Prefer explicit setup in hooks over hidden cross-test state.
  • Treat cleanup as required, but do not rely only on after hooks that might not run after crashes.

Deterministic Test Data Setup and Cleanup

  • Create deterministic test data via APIs/fixtures when possible.
  • Name fixtures/data so their purpose is obvious.
  • Keep setup close to the test scope that needs it (beforeEach for strict isolation, before for shared stable state).
  • Always include a cleanup path for created data.
  • Verify test data assumptions in code before acting on them.

Test Structure Rules

  • Keep each test in clear phases: setup, validation, teardown.
  • Keep setup in hooks when shared (before, beforeEach), not copy/pasted into every test.
  • Keep each it(...) focused on one user-observable behavior.
  • Keep tests independent and safe to run in isolation or in parallel.

Framework Rules (Mocha/Jasmine)

  • Match the project's existing style for describe, it, and hooks.
  • Use nested describe blocks to represent user context, not implementation layers.
  • Avoid deeply nested suites when a flatter structure reads better.
  • Use .only / .skip only for local debugging and remove before finalizing.

Page Object Rules

  • Keep selectors and page-specific actions in page objects/components.
  • Keep specs focused on behavior and assertions.
  • Reuse existing page object methods before adding new abstractions.
  • Add small, purpose-specific page object methods; avoid generic do-everything helpers.

Efficient Element Querying

  • Scope queries to meaningful containers before selecting child elements.
  • Reuse located elements within a test step instead of re-querying the same selector repeatedly.
  • Prefer unique semantic selectors over index-based lookups.
  • Use index-based selection only when the UI contract is explicitly positional.

Selector Rules

  • Prefer user-facing selectors: button=..., aria/....
  • Use data-testid when text/ARIA is unstable.
  • Avoid brittle class-chain and layout-coupled selectors.
  • Scope element queries to reduce collisions.

Waiting Rules

  • Rely on auto-wait for interactions (click, setValue) when possible.
  • Use explicit waits for meaningful UI state transitions (waitForDisplayed, waitForClickable, waitUntil).
  • Prefer waiting on user-visible outcomes over internal implementation details.
  • Do not use browser.pause as a synchronization strategy.
  • Small hard waits are allowed only when tied to known UI constraints (e.g., unavoidable animation timing) and should be rare and documented.
  • Keep implicit timeouts at default unless there is a documented reason.

Waiting Decision Guide

SituationPreferred approachAvoid
Element interactionWDIO auto-wait + interactpre-emptive pause
Async UI update after actionassertion retry or waitFor...fixed sleep
Non-element conditionbrowser.waitUntil(...) with clear conditionpolling with manual loops
Known animation delaytiny documented pause only if no stable signal existslarge blanket pauses

Avoid Third-Party Dependency Assertions

  • Test behavior your application owns, not external provider internals.
  • Stub/mock third-party integrations where feasible to avoid external flake.
  • Validate your contract with external services (request/response handling), not vendor uptime or UI.
  • Keep a very small set of smoke checks for external integration paths only when needed.

Assertion Rules

  • Assert user-visible outcomes and critical state.
  • Use expect-webdriverio matchers (toHaveText, toBeDisplayed, toHaveUrlContaining).
  • Prefer meaningful failure messages via clear assertion targets.
  • Assert list counts/order explicitly when behavior depends on ordering.
  • Verify only behavior that matters for the scenario; avoid noisy over-assertion.

Test Naming Rules

  • Test names should read as clear behavior statements.
  • Use domain language users and developers recognize.
  • Avoid vague names (should work, happy path test).
  • Name tests by expected outcome, not implementation steps.

Security Rules

  • Never hardcode secrets.
  • Mask sensitive values when entering credentials (setValue(..., {mask: true}) where supported).
  • Avoid leaking tokens or credentials in logs.

Write Tests for Fast Debugging

  • Keep test steps readable in execution order.
  • Use assertion targets that reveal what failed without extra digging.
  • Add concise step-level logs for complex journeys.
  • Keep abstraction shallow in specs so failures map back to intent quickly.

Flaky Test Triage Playbook

  1. Reproduce the failure reliably (single test, then repeated runs).
  2. Isolate the flaky step (selector, wait, data, environment, or shared state).
  3. Classify root cause (timing, state leakage, brittle locator, test-data drift, external dependency).
  4. Fix the root cause (do not hide with sleeps/retries).
  5. Re-run multiple times to verify stability before closing.

Quick Reference

Test intentTypical WDIO implementation
Navigate to a pageawait browser.url('/path')
Interact with a controlawait el.click() / await el.setValue(...)
Validate visible outcomeawait expect(el).toBeDisplayed()
Validate content/stateawait expect(el).toHaveText(...) / toHaveValue(...)
Wait for async state changeawait el.waitForDisplayed() or browser.waitUntil(...)

Common Mistakes

  • Assuming a scaffold is always required.
  • Leaving pseudo-code comments unimplemented.
  • Converting comments to brittle selectors.
  • Using browser.pause instead of waiting for a condition.
  • Overusing helper abstractions that hide test intent.
  • Coupling tests to execution order.
  • Treating retries as a substitute for root-cause fixes.

Example

it('should default to showing the global feed', async function () {
  const activeTabs = await $$('.feed-toggle .nav-link.active');
  await expect(activeTabs).toBeElementsArrayOfSize(1);
  await expect(activeTabs[0]).toHaveText('Global Feed');
});

Done means all pseudo-code comments are converted into maintainable WDIO code or intentionally retained only for non-obvious context.

平台分布

Codex

36.52%
按下载量换算63

Claude

26.54%
按下载量换算46

Cursor

18.03%
按下载量换算31

Gemini CLI

9.21%
按下载量换算16

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills