deterministic-tests
Use when a test fails and then passes on a rerun, when a test is flaky or timing-dependent, when a test would assert elapsed time, a timeout, or performance…
Skill by futex-ai
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/futex-ai-deterministic-tests
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/deterministic-tests
What's inside
- Skill name
deterministic-tests- Description
- Use when a test fails and then passes on a rerun, when a test is flaky or timing-dependent, when a test would assert elapsed time, a timeout, or performance, when you want to add a sleep, a retry, or a longer time limit to a test, when you choose between a real and a fake clock, and when a review finding concerns a flaky, slow, or low-value test, gate, or check.
- License
- MIT
- Instructions
- 91 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- eslint-guard.md · references/
SKILL.md (first lines)
# Deterministic tests Required tests check correctness without depending on machine speed. A test that passes on a fast machine and fails on a slow one is a bug in the test. ## Assertion rule - Tests must not assert elapsed wall-clock time as an upper or lower bound. "Finishes within N ms" and "takes at least N ms" are both forbidden. Keep the correctness assertions when you replace either form. - Unit tests must not use real disk IO, databases, Docker, subprocesses, clocks, or network calls. Mock those boundaries. Integration tests may use real implementations for end-to-end behaviour. - Report a duration only as text, through a diagnostic or an annotation. A reported duration must never decide whether the test passes. ## Evidence methods Use these instead of elapsed-time assertions. - **Operation counts** for scale. Run the same operation at two input sizes in a 1:4 ratio and count the calls (file system reads, path resolution, sorts, glob compilation). Every asserted count at the smaller size must be greater than zero, so that a missed interception fails. Counts for once-per-run work must be equal at both sizes. Each scaled total at the larger size must be at most 4.5 times the smaller total: linear work grows about 4 times, quadratic about 16. Keep the result assertions beside the count assertions. - **Captured inputs** for watch targets and similar. Capture what the code passes to its collaborator and assert on it: the required targets are present and the excluded ones are absent. - **Event order** for non-blocking behaviour. Assert that the fast response settles while the slow job is still pending, and check the response's result. Do not infer the order from a short time limit. - **Fake clocks** for timeout durations. Install the fake clock before the request starts. Assert the request is still pending just before the boundary, advance to the boundary, and assert the documented timeout result. ## Allowed clock uses - Test-runner timeouts that stop hung tests. Keep one at least three times the test's typical duration. It is a hang guard, not a speed contract. - Polling deadlines that wait for an expected state. Allow at least 10 seconds, including product timeout options the test supplies when it expects success. - Timestamps used as test data, for example `new Date(Date.now() - 10_000)`. - A timeout the test expects to expire can stay short when the test makes no elapsed-time assertion. It tests the timeout outcome, not speed. - Opt-in benchmarks outside the test tree are outside this rule. A lint can enforce the assertion rule in JavaScript and TypeScript test trees; see [references/eslint-guard.md](references/eslint-guard.md). ## Flaky-test rule A flaky test that the diff adds or changes may be fixed without asking only when all of these hold: 1. Reproduce the flake by repeating the test. Record the pass counts before and after the fix under `.context/`. 2. Name the nondeterminism source: real timers, real signals, watcher readiness, port or path reuse, async ordering, shared fixture state, or locale and platform differences. 3. Make the test deterministic with the methods above: a fake clock, event order, captured inputs, operation counts, an explicit readiness signal, or isolated state. 4. Keep every existing assertion. 5. Add no retry, sleep, repeat, skip, quarantine, or longer time limit. If the source is in product code, it is a product bug: add the failing test first, then fix it. An unreproducible failure, an unknown source, or a proposed removal stays `Auto-fix: no`. ## Unrelated flaky tests A flaky test that the diff does not touch is an unrelated flaky test. Do not fix it in this branch, so that one fix in a separate branch reaches every open branch quickly. The implementation review lists it under `Outside the scope`, not as a finding. Report it in the final message and, when a plan exists, as one line under the plan's review TODO, in the shape that the `plans` skill gives. Add the test name, the failure text, the rerun outcome, and the suspected source. ## Slow and low-value tests Slow, custom, or low-value tests, gates, lints, and checks stay `Auto-fix: no`. Ask the user whether to fix or remove each one, and state what it protects and how long it runs.
From futex-ai/skills, MIT.
More from futex-ai/skills
- 0.592score
writing-skills
futex-ai
Use when you create or edit a skill, write or change a skill description, or when an agent skipped a rule, did not load a skill, or loaded the wrong one.
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
git-commit
futex-ai
Use before you commit and directly after, when you write a commit message or a pull request title and description, when you squash, when the diff against…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
implementation-review
futex-ai
Use after you push a branch and the work needs a review, before you run a review or apply its findings, when a plan's review TODO is reached, when the user…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
rust
futex-ai
Use before you write or change Rust code, add a crate or a dependency to a Cargo workspace, write or move a Rust test, define or map an error type, or add a…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
shared-types
futex-ai
Use when a Rust backend and a TypeScript or JavaScript frontend exchange data, before you add or change a request, response, query, event, message, or error…
SkillAFreshness: A★ 1Claude Code +9 - 0.589score
git-merge
futex-ai
Use before you merge or rebase a branch, when origin/main has moved ahead of your branch, when you resolve merge conflicts, directly after you commit a merge…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
mockups
futex-ai
Use before you create or change a mockup under docs/mockups, a screen component, a user flow, or a Mokly entry, component, or configuration, when a plan has a…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
product-ui
futex-ai
Use before you implement or change a screen, a component, a view, or a mockup, when you write or edit user-facing text such as a status, helper, label, or…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
decisions-and-findings
futex-ai
Use before you send a message that asks the user for a decision, presents review findings or review items, or gives a final report, when the user asks for…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
documentation
futex-ai
Use before you edit a README.md, a crate README, anything under docs/, an architecture doc, or a protocol doc, when a behaviour change could leave a doc…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
typescript
futex-ai
Use before you write or change TypeScript or JavaScript, add an npm dependency, set up a new package, or write a frontend file, a Node script, or a test file…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
databases
futex-ai
Use before you add, edit, or name a database migration or a seed migration, when you touch a schema, Diesel code, a migration lock, or a crate named…
SkillAFreshness: A★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 19, 2026 (9 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/futex-ai/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from futex-ai
- 0.592score
writing-skills
futex-ai
Use when you create or edit a skill, write or change a skill description, or when an agent skipped a rule, did not load a skill, or loaded the wrong one.
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
git-commit
futex-ai
Use before you commit and directly after, when you write a commit message or a pull request title and description, when you squash, when the diff against…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
shared-types
futex-ai
Use when a Rust backend and a TypeScript or JavaScript frontend exchange data, before you add or change a request, response, query, event, message, or error…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
implementation-review
futex-ai
Use after you push a branch and the work needs a review, before you run a review or apply its findings, when a plan's review TODO is reached, when the user…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
rust
futex-ai
Use before you write or change Rust code, add a crate or a dependency to a Cargo workspace, write or move a Rust test, define or map an error type, or add a…
SkillAFreshness: A★ 1Claude Code +9 - 0.589score
git-merge
futex-ai
Use before you merge or rebase a branch, when origin/main has moved ahead of your branch, when you resolve merge conflicts, directly after you commit a merge…
SkillAFreshness: A★ 1Claude Code +9
Cite this page
deterministic-tests skill. Agent Mart. https://agentmart.dev/skills/futex-ai-deterministic-tests (last updated 2026-10-24)