Skip to content
Back to skills

Test Discipline

ASecurity

Writes isolated, order-independent tests that assert what the caller sees, not private helpers. Use for tests with shared fixtures, leaked state, run order or platform differences.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 5, 2026
development

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 5, 2026

npx -y skills add niksavis/handily --skill test-discipline --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Test Discipline?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Test Discipline
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/niksavis-test-discipline/badge)](https://www.skillsdirectory.com/skills/niksavis-test-discipline)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: test-discipline
description: Writes isolated, order-independent tests that assert what the caller sees, not private helpers. Use for tests with shared fixtures, leaked state, run order or platform differences.
---
<!-- Generated by `basicly skills-build` from skill.yaml. Do not edit; edit the source. -->

# Test Discipline

Keep a test suite true as it grows. These rules catch a test that passes today and lies,
which no formatter, type checker or test runner can see.

## Rules

- **A test owns its inputs.** Build each fixture it needs and remove it after. A test that
  reads state it did not make is broken, even when it passes.
- **A test passes alone, in any order and in parallel.** Share no mutable state, and do not
  depend on a sibling test that runs first.
- **Assert on behavior, not internals.** Assert on return values, output and visible side
  effects. A test that breaks on a pure refactor tests the implementation.
- **Remove nondeterminism at the source.** Pin the clock, seed randomness, and stub the
  network and the filesystem. Fix or quarantine a flaky test. Never hide it with a retry.
- **Wait for a condition, not a duration. Measure time with a monotonic clock.** Poll the
  predicate with a generous timeout, so that the assertion says that the event happened.
- **Set a wall-clock limit to twice the time on the slowest runner in the CI matrix.** A
  limit set from a local run fails on a slower runner.
- **Watch a regression test fail before the fix.** Then you know that it exercises the
  defect.

## Read when needed

For fixture inputs, regression mutations, absence controls, test seams or platform differences, read [test controls](references/test-controls.md) before editing the test.

Files in this skill

  • SKILL.md1.7 KB
  • references/test-controls.md2.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.