本文へ移動
cccskills
無料GitHub で公開

yq-stable-tests

Design, review, and diagnose tests and fixtures that can fail nondeterministically under CI concurrency, shared host resources, clocks, process-global state, subprocesses, network listeners, or asynchronous teardown. Use when adding or changing tests with those risks, investigating flaky CI, or reviewing test isolation; use pre-push-checks separately to select outgoing commands.

インストール方法を見る

含まれるファイル(5)

  • SKILL.md9.1 KB
  • LICENSE1.0 KB
  • references/ci-flake-diagnosis.md5.2 KB
  • references/defensive-patterns.md3.2 KB
  • references/testing-principles.md2.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Reliable CI tests

Build tests that remain correct under the repository's real CI topology, not only when run alone on a quiet workstation. This skill owns isolation and reliability decisions; it does not replace the repository's test-tier policy or select every command for a push.

Read the owning rules

  • Use the target repository's testing policy to select unit, coverage, expected-output, snapshot, browser, or real-API evidence.
  • Use the defensive patterns for lifecycle, subprocess, cancellation, and teardown behavior.
  • Read the active Vitest config and GitHub workflow when their worker or job topology affects the test.
  • Use pre-push-checks after the test design is sound to select outgoing validation.

Model the execution topology

Assume these layers can overlap unless the active configuration proves otherwise:

  1. Tests in one Vitest file.
  2. Separate Vitest files or worker processes.
  3. Independent Vitest or repository-gate processes in one job.
  4. Different Actions jobs whose runners share one host.

Process isolation does not isolate host ports, predictable filesystem paths, external services, databases, sockets, or inherited child processes. For every acquired resource, identify its owner, atomic allocation mechanism, observable readiness signal, registered cleanup, and quiescent completion signal.

Do not serialize an entire suite merely because one fixture lacks isolation. Narrow the exclusive scope or change the resource allocation first. A sequential Vitest block cannot protect a host resource from another file, process, job, or runner.

Allocate resources atomically

Use the resource owner's allocator instead of checking availability and claiming it later.

  • Network fixtures bind loopback with listen(0) and read the assigned address only after the server reports that it is listening. Never scan for a free port and bind it later.
  • Create private per-test temporary roots with mkdtemp; do not acquire predictable shared paths.
  • Give shared databases, sockets, sessions, and output locations unique per-test namespaces.
  • Use exclusive creation where a path must not already exist.
  • Keep stable recorded identifiers separate from ephemeral transport addresses. Translate inside the fixture instead of forcing the live resource to use the recorded value.

Literal paths and URLs used only as parser inputs or expected values are not acquired resources. Do not rewrite them merely because they look fixed.

Contain process-global state

Treat process.env, cwd, fake timers, locale and timezone, module mocks, registries, console hooks, globalThis, and global fetch interception as exclusive mutable resources.

Prefer an injected dependency or instance-local adapter. When mutation is required:

  • capture whether the original value was absent or present;
  • restore that exact state;
  • register restoration immediately;
  • use try/finally around the smallest mutation scope;
  • keep an afterEach fallback when failure before the local finally is plausible;
  • intercept the narrowest exact request or call that the fixture owns.

Respect platform-owned semantics

CI runs the same suite on Windows and on POSIX hosts, and a value the operating system owns does not always come back the way a test wrote it.

  • Writing a value back is safe only when the assertion tolerates the write-back failing. Restoring a file's mtime to prove that a fingerprint invalidates anyway holds everywhere; restoring it to prove that a record stays valid assumes a lossless round trip, which NTFS's 100-nanosecond ticks do not give a fractional millisecond. When the assertion depends on the restoration, take the expected value from a fresh read rather than from the remembered one.
  • Windows matches environment variable names case-insensitively, so a fixture seeding http_proxy and HTTP_PROXY as separate keys holds one entry there.
  • Windows releases file handles asynchronously, so a rename or removal that completes at once on a POSIX host needs a bounded retry sized to the observed contention.
  • Windows has no POSIX permission or signal semantics. A case that depends on them takes an explicit platform skip naming the reason, rather than an assertion weakened everywhere.

Prefer an observation that holds on every platform. When a case genuinely cannot, exclude it on that platform explicitly.

Budget timeouts against the lane

A describe or case timeout overrides the runner's --testTimeout instead of yielding to it, so a value below the lane's budget lowers what CI already granted — and the same literal reads as a widening on a host whose default is smaller. A suite bound by process creation takes the lane budget; a tighter value carries the reason it is tighter.

Raise the hook budget with the test budget. Setup and teardown pay the same contention, so lifting only the case budget moves a contended failure into afterEach.

Where a timeout is the subject, keep the outer wait far larger than the timeout under test. A case proving that a 20 ms deadline fires must not race the harness's own wait, or load decides which deadline reports first.

Synchronize on state

A fixed sleep is not evidence that setup completed or cleanup settled.

  • Wait for an explicit readiness event, handshake, state transition, owned promise, or externally observable condition.
  • Use deferred promises or barriers to place a race at a deterministic point and prove the relevant operations overlap.
  • Use a timeout only to bound a wait, never as the condition that makes the assertion correct.
  • Do not assert scheduler-dependent ordering unless that ordering is the product behavior under test.
  • When time itself is the subject, inject or fake the clock and always restore real timers.

Dispose to quiescence

Register cleanup immediately after acquisition so assertion failures also release the resource. Cleanup stops new callbacks or requests, detaches listeners, restores global hooks, terminates owned work, and awaits child exit, server close, worker termination, or the equivalent completion signal.

Calling abort(), close(), or kill() without awaiting the owned completion signal is incomplete teardown. When late completion is possible, prove that disposal prevents it from mutating another test.

Prove the intended regression

  • Observe an ordinary regression fail before the fix when practical.
  • For a new static or corpus guard, temporarily introduce the rejected case and observe the intended failure.
  • For a race, use barriers to prove overlap; repeated execution alone is not a race test.
  • For ports, sockets, shared paths, subprocesses, or other host resources, run independent test processes concurrently when cross-process isolation is part of the fix.
  • Where a fixture spawns with its own deadline, assert that no signal or timeout ended the child before asserting its exit status, so a killed child reports as a timeout instead of as a status mismatch.
  • Verify external state, events, files, logs, exits, or disposal instead of trusting the component's self-report.

Stress runs supplement a deterministic regression; they do not replace one.

Reject flake-masking fixes

Do not present these as root-cause fixes for deterministic local tests:

  • increasing a timeout without identifying the awaited state;
  • adding retries;
  • making all files serial;
  • swallowing an error or unhandled rejection;
  • weakening an assertion;
  • normalizing away unstable behavior;
  • adding a sleep before cleanup or assertion.

Retries remain valid for documented transient external-provider tests under the real-API policy. Keep that exception at the external boundary.

Restoring a budget is not masking. Raising a suite to the lane budget it already had, or sizing a bounded retry to the contention actually measured on the runner, names the awaited work and returns what the lane granted; neither invents headroom around an unexamined wait.

Diagnose existing flakes

For an existing probabilistic CI failure, read the CI flake diagnosis workflow. A diagnosis-only request remains read-only: report the cause and evidence unless the user also asks for a fix.

Validate and report

Run the smallest focused regression for the affected behavior. Add topology-specific evidence only when the change owns that risk:

  • global mutation needs restoration evidence;
  • lifecycle or subprocess work needs quiescent teardown evidence;
  • ports, sockets, or shared paths need concurrent independent-process evidence;
  • a new guard needs a negative control.

Before a push, use pre-push-checks. Report exact commands and observed results; do not describe retries, skipped tests, or pending CI as passing.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

使用 AACT (Aggregate Analysis of ClinicalTrials.gov) PostgreSQL 数据仓库进行批量、历史、聚合性临床试验数据挖掘。Use this skill when the user requests bulk SQL analysis over the full clinical trials data warehouse — historical trial trends, disease landscapes, similar-design matching, or multi-year aggregations across hundreds of thousands of NCT records. 触发场景包括:AACT 查询、临床试验批量分析、PostgreSQL 试验数据、全量 NCT 检索、试验数据挖掘、历史试验分析、clinical trials data warehouse、SQL trials、bulk trial analysis、disease landscape、试验设计相似性匹配、跨年度聚合、sponsor/phase/country 多维统计。**与 clinical-trials-v2 差异**:本 skill 走批量 SQL · 离线大数据(PostgreSQL);v2 走实时 API · 单查询。两者互补:单条 NCT 实时状态用 v2,百万级历史挖掘用本 skill。支持云端公共 PostgreSQL(aact-db.ctti-clinicaltrials.org · 零部署)和每日 dump 本地还原(高性能 · 离线)两种连接方式,自动检测优先用本地。跨平台(macOS/Linux/Windows)参数化 SQL 防注入,read-only 强制保护。

日本語の概要は準備中です。原文の説明を表示しています。

EthanYoQ/Skill-hub112026年10月5日 更新

使用 AACT (Aggregate Analysis of ClinicalTrials.gov) PostgreSQL 数据库进行大批量临床试验历史分析与数据挖掘。触发场景包括:AACT 查询、临床试验批量分析、PostgreSQL 试验数据、全量 NCT 检索、试验数据挖掘、clinical trials data warehouse、疾病领域全景分析、设计相似试验匹配、跨年度试验趋势聚合。本 skill 通过 SQL 接口处理百万级试验记录,支持云端公共 PostgreSQL 服务(aact-db.ctti-clinicaltrials.org)和每日 dump 本地还原两种连接方式,自动检测并优先使用本地高性能模式。

日本語の概要は準備中です。原文の説明を表示しています。

EthanYoQ/Skill-hub112026年10月5日 更新

Use when work produces a deliverable, factual claim, dataset, code change, decision, publication, deployment, automation, or irreversible action whose failure would matter; when the user asks for a quality gate, acceptance criteria, QA, completeness, validation, audit, evidence, preflight, release readiness, or a definition of done; or before claiming completion on medium- or high-risk work. Automatically decide whether a formal gate is warranted, derive task-specific pass/fail criteria, gather evidence, and block unsupported completion. Make sure to use this skill even when the user does not say "quality gate" if consequential work needs acceptance criteria or completion evidence. Skip formal gating for trivial, reversible, low-impact requests.

日本語の概要は準備中です。原文の説明を表示しています。

EthanYoQ/Skill-hub112026年10月5日 更新

Create a changeset file in .changeset/ that describes a user-facing change for the release notes

日本語の概要は準備中です。原文の説明を表示しています。

EthanYoQ/Skill-hub112026年10月5日 更新

Add a new competitor to the AI Visibility Tool Directory — researches the tool, generates data, takes a screenshot, and inserts into the codebase

日本語の概要は準備中です。原文の説明を表示しています。

EthanYoQ/Skill-hub112026年10月5日 更新

add-lang

無料

Add tree-sitter language support to codegraph end-to-end — wire the grammar + extractor, write tests, then benchmark extraction quality and retrieval value on 3 popular real-world repos. Use when the user runs /add-lang <language> or asks to add/support a new language (e.g. Lua, Elixir, Zig, OCaml) in codegraph.

日本語の概要は準備中です。原文の説明を表示しています。

EthanYoQ/Skill-hub112026年10月5日 更新

EthanYoQ のスキルをすべて見る

このスキルの問題を報告する