Agent Skills › uw-syfi/vibesys › testing

testing

GitHub

提供跨语言编写高质量测试的规范,强调仅测试公共API、禁止打补丁或模拟、使用Fake集成、偏好属性测试及避免测试不稳定。

.agents/skills/testing/SKILL.md uw-syfi/vibesys

Trigger Scenarios

编写或修改测试代码 添加回归测试 诊断不稳定的测试 使用Fake替代Mock

Install

npx skills add uw-syfi/vibesys --skill testing -g -y
More Options

Non-standard path

npx skills add https://github.com/uw-syfi/vibesys/tree/main/.agents/skills/testing -g -y

Use without installing

npx skills use uw-syfi/vibesys@testing

指定 Agent (Claude Code)

npx skills add uw-syfi/vibesys --skill testing -a claude-code -g -y

安装 repo 全部 skill

npx skills add uw-syfi/vibesys --all -g -y

预览 repo 内 skill

npx skills add uw-syfi/vibesys --list

SKILL.md

Frontmatter
{
    "name": "testing",
    "description": "Write, change, review, or fix tests in any language in this repository. Use when adding or editing any test, fixing a bug (regression test), tempted to patch or mock, adding or changing a Fake, writing property-based or golden-fixture tests, or diagnosing a flaky test."
}

Testing

Write high-value tests: tests that keep passing through refactors and fail only when observable behavior changes. A test is low value if renaming a private function, splitting a module, or swapping an implementation detail breaks it.

These rules are language-independent. Tool names, commands, and syntax live in a per-language reference; read the one for the language you are editing:

Rules

  1. Test the public API only. The public API is the surface other packages or modules are already allowed to depend on: a library's api entry point, the module API that sibling modules use inside a package, and the application's facade or serialized events at the top. Do not import private modules or assert on private state. The one exception is a test whose point is a tricky implementation detail; mark that site test-isolation: <specific reason> in a comment.
  2. No patching or mocking. Do not replace code at runtime (monkeypatching attributes, module mocking, spies, mock frameworks). It couples the test to how the code is written. Setting inputs is fine: environment variables, working directory, temp directories. If a test seems to need a patch, the code is missing a seam: add an injectable port (constructor argument or parameter) and pass a Fake.
  3. Integrate modules with Fakes. A Fake is an in-memory, faithful implementation of the same API, not a stub with canned answers. Whoever changes the real behavior owns the Fake and its contract test in the same PR. See references/fakes-and-contracts.md.
  4. Test properties, not instances. Default to property-based tests and fuzzing for parsers, serializers, validators, pure logic, and state machines. Use single examples only for a named scenario or a regression. Use golden fixtures where behavior reduces to a deterministic state snapshot. See references/properties-and-goldens.md.
  5. No flaky tests. Never depend on timeouts, sleeps, wall-clock time, scheduling order, or shared state. Inject clocks and simulate timeouts; do not wait for them. Never add retries. See references/flakiness.md.
  6. Bug fixes. Add a regression test at the lowest layer that reproduces the symptom, through the public API, that fails at the merge base. Then add a property test that generalizes the pattern, so the whole class of bug is covered and not just the reported instance.

Before handing back

  • Run the narrowest test target first, then broaden (commands per language).
  • Run the language's test-isolation check if one exists (see its reference). It is a shrink-only ratchet: existing violations are baselined, new ones fail, and removing sites from a baselined file means lowering its recorded counts.
  • Do not migrate unrelated tests to these rules. Apply them to new tests and to the tests you are already changing.
  • A test involving threads, processes, async work, or time must pass 20 consecutive runs and a parallel run before you hand it back.

Version History

  • 21be1ce Current 2026-09-27 15:19

Same Skill Collection

.agents/skills/create-issue/SKILL.md
.agents/skills/open-pr/SKILL.md
.agents/skills/review-pr/SKILL.md
.agents/skills/software-design/SKILL.md
.agents/skills/vs-init/SKILL.md
resources/skills/microservice-optimization/SKILL.md
resources/skills/neuron-agentic-development/skills/neuron-nki-debugging/SKILL.md
resources/skills/neuron-agentic-development/skills/neuron-nki-docs/SKILL.md
resources/skills/neuron-agentic-development/skills/neuron-nki-profiling/SKILL.md
resources/skills/serving-systems/SKILL.md
.agents/skills/triage-prs/SKILL.md
.agents/skills/tui-bug-hunt/SKILL.md
.agents/skills/vs-meta-opt/SKILL.md
resources/skills/neuron-agentic-development/skills/neuron-nki-profile-querying/SKILL.md
resources/skills/neuron-agentic-development/skills/neuron-nki-writing/SKILL.md

Metadata

Files
0
Version
21be1ce
Hash
b0a7a84b
Indexed
2026-09-27 15:19

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-27 16:38
浙ICP备14020137号-1