Token导航 LogoToken导航

Agent Skill · 研究检索

test-reliability(测试可靠性)

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

test-reliability 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 64,959。

总安装 291周安装 12GitHub Stars 4下载 95核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/petrkindlmann/qa-skills --skill test-reliability

这个 Skill 是做什么的

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

用于辅助测试设计、自动化测试、用例整理和回归验证。适合编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需确认项目测试框架、运行命令和夹具数据,避免修改真实逻辑。涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。安装方式:通过 npx skills add 命令从指定 GitHub 仓库添加。

来源仓库内路径:skills/test-reliability

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

test-reliability 怎么安装?

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

test-reliability 支持哪些 AI 工具?

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

test-reliability 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

test-reliability 是免费的吗?

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

test-reliability 用的人多吗?

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

test-reliability 安全吗?

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

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

值得选的地方

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

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 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调用外部服务未明确有提醒
test-reliability

测试可靠性 · 本页

2914接触敏感数据未明确通过

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

SKILL.md 原文

Before starting: Check for .agents/qa-project-context.md in the project root. It contains known flaky areas, selector strategy, and CI environment details.


Discovery Questions

  1. What is your current flaky test rate? Check CI failure stats over the last 30 days. Below 2% is healthy. 2-5% needs attention. Above 5% is eroding team trust.
  2. Where is the pain concentrated? Is it locator breakage? Timing issues? Test data? Environment instability? If unknown, instrument first (see Flake Classification).
  3. What is your current selector strategy? data-testid everywhere? Mixed CSS and role-based? No strategy (whatever works)?
  4. How do you handle flaky tests today? Retry and hope? Skip and forget? Something structured?
  5. What CI environment runs the tests? Same machine every time or different runners? Consistent resources or variable? How does the CI runner compare to local dev machines?
  6. What is your test data strategy? Shared database? Per-test fixtures? Factory seeding? External services?

Core Principles

  1. Prevention over cure. Writing resilient tests costs 1x. Investigating a flaky test costs 10x. Losing team trust in the suite costs 100x.
  2. Healing must be observable and reviewable. Every automated repair produces evidence: what broke, what was tried, what worked, what the confidence score is. Silent fixes erode trust as fast as silent failures.
  3. Classify before fixing. The fix for a timing issue is completely different from the fix for a data dependency. Wrong diagnosis wastes effort and may make things worse.
  4. Flaky tests are bugs. They are not annoyances to tolerate. A flaky test either has a test bug (fix the test), reveals an app bug (fix the app), or exposes an environment issue (fix the environment).
  5. Track reliability as a metric, not a feeling. Measure flaky rate, mean time to heal, quarantine age, and selector stability. What gets measured gets fixed.
  6. Self-healing is a spectrum. Start with resilient locators (Level 1), add fallback strategies (Level 2), then environment-aware healing (Level 3), then confidence-scored auto-repair (Level 4). Do not jump to Level 4 before mastering Level 1.

Locator Resilience

Multi-Attribute Selectors (Beyond Fallback Chains)

A single locator strategy is a single point of failure. Multi-attribute selectors combine multiple signals for a single element lookup, creating resilience without fallback chain complexity.

The key insight: instead of "try A, then B, then C," use "find element matching A AND B AND C with tolerance for one signal missing."

// Multi-attribute locator: tries combinations from most specific to least
const submitBtn = await multiAttributeLocator(page, {
  testId: 'checkout-submit',              // most stable signal
  role: 'button',                          // semantic signal
  name: /place order/i,                    // accessible name
  nearText: 'Order Summary',              // visual context
});
// Internally: tries testId+role+name first, then testId alone, then role+name,
// then text, then nearText+role. Returns first visible match.
// Unlike fallback chains, it combines signals for higher confidence.

DOM Similarity / Neighbor Context Matching

When a locator fails, the element may still exist but with changed attributes. Use surrounding DOM context to find it through three strategies:

  1. Parent + tag + type: Find the container element (by testId), then locate by tag and type within it
  2. Preceding label: Find sibling text (label), then locate the adjacent input/button
  3. Nearby text context: Find visible text near the target, then locate the element type in the same parent

These strategies are used as repair candidates (scored by the confidence system below), not as runtime fallbacks.

Selector Stability Scoring

Rate every selector on a 0-5 scale to prioritize refactoring.

ScoreStrategySurvives
5getByTestId('submit-order')CSS, text, and structural changes
4getByRole('button', {name: 'Submit'})CSS and structural changes
3getByLabel('Email')CSS changes; breaks on label rewording
2getByText('Submit Order')Breaks on any copy change
1locator('.btn-primary.submit')Breaks on CSS or structural change
0locator('//div[3]/button[1]')Breaks on any DOM change

Target: Average score of 3.5+ across the test suite. Audit monthly. Prioritize fixing score-0 and score-1 selectors.


Flake Classification Framework

Every flaky test has a root cause category. Classifying correctly determines the fix.

Categories

CategorySignalRoot CauseFix Direction
TimingTimeout errors, passes on retry, worse in CIRace condition, animation, async operationWait for condition, not time
Data dependencyFails with other tests, passes aloneShared state, missing cleanupIsolate per-test, fixture cleanup
EnvironmentFails on specific runner, correlates with loadResource contention, network latencyMock externals, increase resources
Order dependencyFails with --shard or fullyParallelTest depends on another test's side effectSelf-contained setup
Time sensitivityFails at specific times (midnight, month-end)Uses real clock, date boundaryMock clock, relative comparisons
Visual renderingScreenshot diff flickers, subpixel differencesFont rendering, antialiasing, animation frameIncrease threshold, mask dynamic regions
External serviceCorrelates with third-party statusReal HTTP calls in testsMock external APIs

Classification Decision Tree

Test is flaky
│
├── Does it pass when run alone?
│   ├── YES → ORDER DEPENDENCY or DATA DEPENDENCY
│   │   ├── Does another test create/modify data it needs? → ORDER DEPENDENCY
│   │   └── Does it share a database/file/cache? → DATA DEPENDENCY
│   │
│   └── NO → Not order/data dependent. Continue below.
│
├── Does it fail more often in CI than locally?
│   ├── YES → TIMING or ENVIRONMENT
│   │   ├── Timeout errors? → TIMING (CI is slower)
│   │   ├── Connection errors? → ENVIRONMENT (network/service)
│   │   └── Resource errors (OOM, disk)? → ENVIRONMENT (resources)
│   │
│   └── NO → Same rate locally and CI. Continue below.
│
├── Does it fail at specific times?
│   ├── YES → TIME SENSITIVITY
│   │   ├── Near midnight? → Date boundary issue
│   │   ├── Near month/year end? → Calendar calculation
│   │   └── Specific hour? → Timezone issue
│   │
│   └── NO → Continue below.
│
├── Does it involve screenshots or visual comparison?
│   ├── YES → VISUAL RENDERING
│   │
│   └── NO → Continue below.
│
├── Does it call external HTTP APIs?
│   ├── YES → EXTERNAL SERVICE
│   │
│   └── NO → TIMING (most likely — default classification)
│       └── Investigate: what async operation is not being awaited?

Environment-Aware Healing

Not all test failures are test problems. Some are environment problems. Environment-aware healing distinguishes between the two and adapts.

Slow Backend vs True UI Failure

When an action fails, check backend health before blaming the test:

  1. Action fails -> Hit /api/health endpoint
  2. Backend unhealthy (5xx or timeout) -> Retry with exponential backoff. Diagnose as backend_down. This is not a UI bug.
  3. Backend healthy (2xx) -> This is a real UI/test failure. Do not retry.

Return a structured diagnosis: {success: boolean; diagnosis: 'backend_down' | 'ui_failure' | 'backend_slow_recovered'}. This diagnosis feeds into flake classification -- backend issues are environment issues, not test bugs.

Resource Contention Detection

Before declaring test failure in CI, check for resource contention:

  • Browser health: Load about:blank. If it takes > 2s (baseline: < 500ms), the runner is overloaded.
  • API health: Hit /api/health. If it takes > 5s (baseline: < 1s), the backend is under pressure.
  • Diagnosis: If either check fails, classify as environment issue and annotate the test result. Do not count resource contention failures toward flaky test rates.

Data Healing

Test data expires, gets cleaned up, or becomes invalid. Data healing detects and regenerates stale test data.

Common Data Failure Patterns

PatternSignalFix
Expired auth token401 response during testRegenerate token in fixture
Deleted test record404 when accessing seeded dataRe-seed before test
Uniqueness violation409 or constraint errorGenerate unique identifiers per run
Stale cacheWrong data returnedClear cache in setup
Exceeded quota429 or rate limit errorReset quotas or use dedicated test account

Self-Healing Test Data Fixture Pattern

Build fixtures that verify data exists and regenerate if stale:

// Pattern: verify → heal → use → cleanup
testUser: async ({ request }, use, testInfo) => {
  // 1. Try to find existing test user by deterministic email
  // 2. Verify auth token is still valid (GET /api/me)
  // 3. If token expired → refresh it (POST /refresh-token), mark as healed
  // 4. If user missing → create new one, mark as healed
  // 5. If healed → annotate testInfo for observability
  // 6. use(user) → run the test
  // 7. Cleanup: delete test user (guaranteed by fixture, even on failure)
}

Key patterns:

  • Use testInfo.testId in email/identifiers for per-test uniqueness
  • Annotate testInfo.annotations when healing occurs for observability
  • Always clean up in the fixture's post-use block, not in afterEach

Observable Repair Workflow

Core guardrail: Healing must be observable and reviewable. Every repair follows this flow:

Failure Detected
  │
  ▼
Candidate Repair Generated
  │
  ▼
Confidence Score Computed (0.0 - 1.0)
  │
  ▼
Evidence Diff Produced (what changed, what was tried)
  │
  ▼
Approval Policy Applied
  │ ├── Score >= 0.9 → Auto-apply, log for review
  │ ├── Score 0.7-0.9 → Apply in quarantine, flag for review
  │ └── Score < 0.7 → Do NOT apply, create investigation ticket
  │
  ▼
Intent Fidelity Check (does repaired test still test the same thing?)
  │
  ▼
Rollback if intent fidelity drops

Confidence Scoring

Score each repair candidate on six dimensions (weighted sum, 0.0-1.0):

DimensionWeightScoring
Match specificity0.30testId=1.0, role=0.9, text=0.7, context=0.5, CSS=0.3
Element visible0.151.0 if visible, 0.0 if not
Same parent container0.151.0 if same container, 0.0 if different
Same element type0.151.0 if same tag+role, 0.0 if different
Text similarity0.150.0-1.0 (Levenshtein ratio of accessible name)
Attribute overlap0.100.0-1.0 (Jaccard of shared attributes)

Score thresholds:

  • = 0.9: Auto-apply, log for batch review
  • 0.7-0.89: Apply in quarantine, flag for individual review
  • 0.5-0.69: Do not apply, create PR with evidence
  • < 0.5: Discard, manual investigation required

Repair Evidence

Every repair produces an evidence record containing: test file, test name, failure type, original locator, candidate replacements (each with confidence, evidence string, and intent-preserved flag), which candidate was selected, timestamp, approval path, and rollback trigger.

Intent Fidelity Checking

After applying a repair, verify the test still exercises the same user intent:

  • Element type changed (e.g., button -> a) -- intent NOT preserved, rollback
  • ARIA role changed (e.g., button -> link) -- intent NOT preserved, rollback
  • Form action changed (targets different endpoint) -- intent NOT preserved, rollback
  • Same tag, role, and form action -- intent preserved, keep repair

A repair that changes WHAT the test verifies (not just HOW it finds elements) must be rolled back.


Quarantine Management

Quarantine isolates flaky tests so they run but do not block CI.

Setup

// Tag the flaky test
test('intermittent WebSocket reconnect', {
  tag: ['@quarantine'],
  annotation: {
    type: 'quarantine',
    description: 'Flaky since 2026-03-15. Race condition in WebSocket handler. Ticket: BUG-1234.',
  },
}, async ({ page }) => { /* ... */ });
// playwright.config.ts — separate projects
projects: [
  {
    name: 'stable',
    testMatch: /.*\.spec\.ts/,
    grep: /^(?!.*@quarantine)/,  // exclude quarantine
  },
  {
    name: 'quarantine',
    grep: /@quarantine/,
    retries: 3,
  },
],
# CI: quarantine runs separately, does not block
- name: Run stable tests
  run: npx playwright test --project=stable

- name: Run quarantine tests
  run: npx playwright test --project=quarantine
  continue-on-error: true

Quarantine Lifecycle

1. DETECT    — Test identified as flaky (by CI reporter or manual triage)
2. TAG       — Add @quarantine annotation with ticket link and date
3. ISOLATE   — Quarantine project runs separately, does not block
4. DIAGNOSE  — Follow flaky test runbook (references/flaky-test-runbook.md)
5. FIX       — Apply fix pattern per category
6. VERIFY    — Run 50x with --repeat-each, zero failures required
7. RELEASE   — Remove @quarantine tag, add annotation documenting fix

Quarantine Hygiene Rules

  • Maximum quarantine age: 14 days. After 14 days, either fix it or delete it. Permanent quarantine is permanent rot.
  • Every quarantine entry has a ticket link. No anonymous quarantines.
  • Weekly review. Check quarantine list every sprint. Aging quarantines get escalated.
  • Track quarantine size. More than 5% of tests in quarantine = systemic problem requiring process change, not just test fixes.

Flaky Test Runbook

See references/flaky-test-runbook.md for the complete step-by-step runbook. Summary:

1. REPRODUCE     — Run with --repeat-each=20 --workers=4 --trace=on
2. CORRELATE     — Check CI history: when did it start? What changed?
3. CLASSIFY      — Use the classification decision tree above
4. FIX           — Apply fix pattern for the specific category
5. VERIFY        — Run with --repeat-each=50, zero failures required
6. RELEASE       — Remove quarantine tag, document fix

Anti-Patterns

1. Silent Selector Replacement

Automatically replacing a broken selector without logging, review, or confidence scoring. The repaired test may now verify a different element entirely. Every repair must produce evidence.

2. "Just Retry It" as a Fix

Retries are a detection mechanism, not a fix. A test that needs retry 2 of 3 times will eventually fail 3 of 3 during your most critical release.

3. Disabling Flaky Tests Permanently

test.skip('flaky, will fix later') -- "later" never comes. Either quarantine with tracking or delete entirely. Skipped tests with no ticket are dead code.

4. Treating All Flakiness the Same

Timing issues and data dependencies need completely different fixes. Adding waitForTimeout(5000) to a data dependency problem makes the test slower and still flaky.

5. waitForTimeout as a Stability Fix

// NEVER the right fix
await page.waitForTimeout(5000);

// Wait for the actual condition
await expect(page.getByRole('table')).toBeVisible();
await page.waitForResponse(resp => resp.url().includes('/api/data') && resp.status() === 200);

6. Healing Without Observability

Auto-repair that does not produce logs, evidence, or confidence scores. You cannot improve what you cannot measure. You cannot trust what you cannot review.

7. Over-Engineering Healing Before Writing Stable Tests

Building a complex self-healing framework before adopting basic resilient locator patterns. Start with multi-attribute selectors and proper waits. Add healing infrastructure only when you have data showing where breakage occurs.

8. No Quarantine Expiry

Tests sit in quarantine for months. Quarantine is a temporary state, not a permanent home. Enforce a 14-day maximum.


Done When

  • All flaky tests identified and categorized by root cause (timing, data dependency, environment, etc.)
  • Each flaky test quarantined or fixed — no test silently retried without a documented plan and ticket reference
  • Locator stability scores documented for the test suite with a target average of 3.5+
  • Flakiness rate tracked in CI dashboard and visible to the team
  • Repair actions tracked with ticket references and quarantine expiry dates set

Related Skills

  • playwright-automation — Full Playwright setup, Page Object Model, fixtures, and CI integration.
  • ci-cd-integration — Pipeline configuration, parallel execution, test reporting, and failure handling.
  • qa-metrics — Tracking flaky test rates, selector stability scores, quarantine size, and suite health.
  • ai-bug-triage — When flake investigation reveals an app bug, use the triage pipeline to classify and report it.
  • ai-test-generation — Generate reliable tests from the start using the staged pipeline.

References

  • references/flaky-test-runbook.md — Step-by-step runbook for triaging flaky tests: root cause decision tree, fix patterns per category, confidence scoring methodology.

平台分布

Codex

34.6%
按下载量换算33

Claude

29.66%
按下载量换算28

Cursor

16.63%
按下载量换算16

Gemini CLI

10.15%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

继续浏览同类 Skills