test-quality

Write and review deterministic, behavior-focused tests across unit, integration, and end-to-end layers.

5|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/nuggocto/dotfiles --skill test-quality-nuggocto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-quality
Source: https://github.com/nuggocto/dotfiles/tree/main/opencode/skills/test-quality
Command: npx skills add https://github.com/nuggocto/dotfiles --skill test-quality-nuggocto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Test suites often accumulate flaky, over-mocked, or low-signal tests that fail for the wrong reasons or never fail at all. This Skill provides concrete criteria for writing and reviewing tests that fail when behavior breaks, pass when it works, and stay cheap to maintain. ## Core Features & Use Cases - Behavior-focused test design: Tests target public contracts rather than implementation details, with guidance on assertions, mocking at real seams, and boundary coverage. - Layered test strategy: Distinct rules for unit, integration, end-to-end, property-based, and fuzz testing, including determinism, isolation, and bounded resource requirements. - Flakiness diagnosis and cleanup: Instructions to preserve first intermittent failures, diagnose root causes, and delete redundant or low-signal tests instead of retrying into green. - Use Case: When reviewing a pull request, ask the agent to evaluate the new tests; it will name the behavior each test protects, flag flakiness risks like wall-clock dependence or shared state, and point out missing edge cases. ## Quick Start Ask the agent to review the tests in your current change and identify which ones are flaky, over-mocked, or missing boundary coverage.

Frequently Asked Questions about test-quality

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write deterministic unit tests?

Deterministic unit tests inject time, randomness, and IDs rather than depending on wall clock or seed luck, and avoid shared mutable state between tests. Each test sets up and tears down its own data so execution order and parallelism never affect results.

How to fix a flaky test that fails intermittently?

Preserve the first intermittent failure including inputs, seed, execution order, logs, and environment before changing anything. Diagnose whether the cause is a product race, test nondeterminism, or infrastructure, fix the root cause, and never retry the suite into green.

When should I use integration tests instead of unit tests?

Use integration tests when the risk lives at a real boundary such as database queries, serialization, filesystem behavior, queues, or network protocols. Exercise the real boundary implementation, since replacing it with a mock turns the test into a unit test and can hide schema and lifecycle defects.

What is the difference between property-based testing and fuzzing?

Property-based tests verify invariants over a broad generated input space, while fuzzing targets parsers, protocols, and trust boundaries where generated inputs expose failures humans would not enumerate. Both require bounded campaigns, reproducible seeds, and minimized failing inputs promoted into deterministic regression tests.

When should a test be deleted instead of fixed?

Delete a test when evidence shows it is invalid or redundant and meaningful regression coverage remains, or when it is unreadable, low-signal, or duplicates coverage from boundary analysis. Tests of trivial getters, framework behavior, and restated implementation logic are also deletion candidates.