assertions-go-red
Skill0 starsChanged 3 days agoMITView on GitHub
Proving that every new or changed test assertion can fail: break the code on purpose, run the test, record the red output, restore; keep the red runs as evidence and name each mutation in the PR body; catch an assertion masked by an earlier one; stop the processes a test starts. Use when writing or changing tests, when a worker reports tests added, when reviewing a PR that adds assertions, or when a green test might be checking nothing, in any project.
In this repository21 other files it gives its agents.
- adhd-repliesSkill
- clean-codeSkill
- cloud-workerSkill
- context-hygieneSkill
- coordinator-methodSkill
- git-conventionsSkill
- matt-bridgeSkill
- merge-gateSkill
- model-mixSkill
- mod-uiSkill
- overnightSkill
- project-setupSkill
- release-watchSkill
- roadmap-trackerSkill
- screen-mapSkill
- shared-machine-checksSkill
- skill-auditSkill
- smart-modsSkill
- smart-ultracodeSkill
- verified-researchSkill
- windows-opsSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Run the test. It must go red on the assertion you are checking.
- Distinctive: line 23
When an earlier line goes red first, the test stops there and the later assertion is still unproven.
- Distinctive: line 25
If no mutation can reach it, the assertion adds nothing: drop it.
- Very specific: line 34
Stop by the recorded PID or group only (shared-machine-checks §5).
- Distinctive: line 43
Every new or changed assertion has a red run saved as evidence, or is a named setup guard.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
A test that cannot fail proves nothing. Before a PR is done, every assertion it adds or changes has been seen red. tdd writes the test first; clean-code holds the code rules; this skill checks that the finished assertions bite. The project's standards win over it.
1. Mutate and record
For each new or changed assertion:
- Break the code under test on purpose: flip a condition, drop a line, return a wrong value. This is a mutation.
- Run the test. It must go red on the assertion you are checking.
- Save the red output as an evidence file in the PR's evidence folder, named after the mutation.
- Restore the code and run the test again. It must be green, and
git diffmust show no trace of the mutation.
The PR body lists each mutation and the red line it produced, one row per assertion: mutation, test, red line.
A red run is saved as evidence, so its output holds no secrets: a failure message never prints the environment or a variable's value (no env dumps, repr=False on env fields, no --showlocals). Why: on 2026-11-13 a worker's first red run printed the whole environment, a personal access token included, into a log and its own output. If it happens: delete the log, check git history, the PR body and the evidence for the value without printing it (grep -rcF -- "$VAR" with the variable's name, never the literal value on a command line), and tell the person to rotate the token.
2. A mutation can mask another
- When an earlier line goes red first, the test stops there and the later assertion is still unproven.
- Record a mutation that reaches the later assertion: keep the earlier lines passing, break only what the later one checks.
- If no mutation can reach it, the assertion adds nothing: drop it.
3. Setup guards are exempt
A guard that fails only when the test itself is broken (the fixture loaded, the server answered) needs no mutation. Write this exemption in the project's standards, so reviewers do not ask for it.
4. Tests that start processes
- A test that starts a process, a server or a container stops it: record the process group when it starts, and kill that group in
afterEachorfinally, even when the test fails. - Stop by the recorded PID or group only (
shared-machine-checks§5). - The mutation run shows nothing is left running: after the red run, list the processes and containers the test started. The list must be empty.
5. Review
A reviewer treats an assertion with no recorded red run as unproven, and treats a mutation row with no evidence file as a claim to test (merge-gate). Removed or weakened assertions follow the same rule as any weakened test.
Done when
- Every new or changed assertion has a red run saved as evidence, or is a named setup guard.
- The PR body maps each mutation to its red line.
- Masked assertions got their own mutation or were dropped.
- The code was restored after each mutation, and no test left a process or container running.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

