Use in a Rust project before you say you added or fixed tests, or that a change is tested, and when asked whether the tests catch a change. Runs flot_gate, which changes the committed code in small ways and passes only if a test fails on each, and reports its verdict as it is.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Flot Gate?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tobilife-flot-gate)
---
name: flot-gate
description: Use in a Rust project before you say you added or fixed tests, or that a change is tested, and when asked whether the tests catch a change. Runs flot_gate, which changes the committed code in small ways and passes only if a test fails on each, and reports its verdict as it is.
---
# Prove the tests catch the change with flot gate
`flot_gate` judges HEAD's committed change since the base: it makes small
changes (mutants) to the code the change touched, runs the tests on each,
and passes only if a test fails on every one. It shows the tests catch the
change, not that the code is right. It needs no `flot.toml`, judges Rust,
JavaScript and TypeScript, Python, Go, and Java, and can take minutes.
## Before you say the change is tested
1. Commit everything: an uncommitted or untracked file makes the gate an
`ERROR`. A fixup commit is fine; the user can squash it.
2. Call `flot_gate` with no arguments unless the user named a base or a
policy.
3. Act on `verdict`, and follow `next`:
- `PASS`: a test caught every mutant of the change. Say exactly that,
not that the code is correct.
- `FAIL`: each entry of `receipt.mutants` with a `diff` and no
`allowed` is a change no test caught, at that file and line. Write or tighten a test that fails
on that change and passes on your code, commit it, and call
`flot_gate` again. Repeat until it passes.
- `UNPROVEN`: nothing shows the tests catch the change. Report each of
`receipt.reasons` to the user as it is. Never call it a pass.
- `ERROR`: report `error` as it is. If it names files that are not
committed, commit them and call again. If cargo-mutants is missing,
tell the user to run `cargo install --locked cargo-mutants`.
4. Never say the change is tested unless the verdict is `PASS`.
## Never, to make the gate pass
- Change the code only to make a mutant go away.
- Weaken, skip or delete a test.
- Edit, move or create the gate's policy, or pass another one.
- Add `#[mutants::skip]`, or a `.cargo/mutants.toml`.
The gate reads none of these as a pass: code hidden from the mutants is
`UNPROVEN`, and the repository's cargo-mutants config is not read. A person
decides what the policy excludes and allows.
## A mutant no test could catch
A mutant can be equivalent: a change no test could tell apart from the code,
as `>=` for `>` in a `larger(a, b)` that returns `a` or `b`. Do not force a
test for it. Show the user the mutant and why, and leave allowing it to
them: `flot gate allow RECEIPT "FILE:LINE: MUTATION" --reason TEXT` prints
the policy entry for them to add. A mutant the policy allows carries
`allowed`, its reason; report it with that reason.
## Checking a receipt
`flot_gate_verify` with `receipt` set to the reply's `receipt_path` checks
that the receipt still holds of HEAD here. When `verified` is false, its
`verdict` counts for nothing: report the `refusals`.
## Without the MCP tools
Run `flot gate --json` at the top of the work tree. It exits as its verdict:
0 `PASS`, 1 `FAIL`, 2 `UNPROVEN`, 3 `ERROR`.