rockclaver/systemcraft

deterministic-test-harness

Builds deterministic tests for time, randomness, concurrency, external APIs, queues, databases, or eventual consistency. Use when tests are flaky, financial calcs depend on dates/clocks, or workflows need fake, repeatable test behavior.

First seen Jun 11, 2026

Installation

$ npx skills add rockclaver/systemcraft --skill deterministic-test-harness

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from rockclaver/systemcraft · top by installs.

npx skills add rockclaver/systemcraft

Browse all from rockclaver/systemcraft

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,535 B
  • docs SUMMARY.md 270 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 4 installs

SKILL.md

Deterministic Test Harness

Control clocks, randomness, providers, storage, and concurrency for repeatable tests; inject deterministic dependencies at the boundary.

Sources of Nondeterminism

  • Time, time zones, calendars, date cutoffs, settlement windows
  • Random ids, UUIDs, references, sampling, shuffling
  • External providers: payments, market data, bank files, email, SMS, KYC
  • Background jobs, queues, scheduled tasks, retries, polling
  • Database ordering without explicit ORDER BY
  • Parallel writes, locks, optimistic concurrency, race-prone state

Test Controls

Prefer existing patterns, else smallest boundary: frozen-time clock, deterministic id factory, provider fake (success/decline/timeout/duplicate), in-memory queue/sync runner, fixture reset, stable sort. Freeze time, seed ids, drive providers from fakes, assert observable behavior.

Prove Stability

Run repeatedly with the repo's runner:

npm test -- <target>
pytest <target> -q
go test ./... -count=20

Guardrails

  • Do not add sleeps to fix timing, or hit real payment/market-data providers from tests.
  • Do not assert on unordered collections without sorting, use wall-clock dates in expected values, or over-mock internal collaborators.