Blocks weakening tests: a deleted test file (commit only), more assertions removed than added, an added vacuous assertion (assert True). Runs: commit, agent write, turn's end. Waiver: 'chock: allow test-integrity' on an added line; an agent needs it already in HEAD. Misses: in-place weakening (a changed value), a removal offset by any added assertion, a commented-out assertion, styles off assertion_pattern, tests off test_path_regex, vacuous forms not listed, a deletion at agent write.
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 Protect Test Integrity?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/open-coder-ai-protect-test-integrity)
---
name: protect-test-integrity
description: "Blocks weakening tests: a deleted test file (commit only), more assertions removed than added, an added vacuous assertion (assert True). Runs: commit, agent write, turn's end. Waiver: 'chock: allow test-integrity' on an added line; an agent needs it already in HEAD. Misses: in-place weakening (a changed value), a removal offset by any added assertion, a commented-out assertion, styles off assertion_pattern, tests off test_path_regex, vacuous forms not listed, a deletion at agent write."
metadata:
chock.artifact: hook
chock.enforcement: block
chock.coverage_without_chock: advisory
---
# Protect Test Integrity
Blocks weakening tests: a deleted test file (commit only), more assertions removed than added, an added vacuous assertion (assert True). Runs: commit, agent write, turn's end. Waiver: 'chock: allow test-integrity' on an added line; an agent needs it already in HEAD. Misses: in-place weakening (a changed value), a removal offset by any added assertion, a commented-out assertion, styles off assertion_pattern, tests off test_path_regex, vacuous forms not listed, a deletion at agent write.
```
on(commit|tool_use): block(test_integrity) test_path_regex(regex) assertion_pattern(regex) dummy_assertion_pattern(regex) ...
Test integrity: this change deletes a test file, removes more assertions than it adds, or adds a vacuous assertion. Fix the code under test, not the test. If the removal is deliberate (obsolete behaviour, a test moved elsewhere), a person adds 'chock: allow test-integrity' on an added line of that test file and commits from their own shell. In the agent (tool use, the turn's end, an agent's commit) only a waiver already committed in HEAD counts, so an agent asks a person.
```
This skill is advisory: the client reading it has no mechanism to enforce it. The same policy compiled by `chock` blocks at commit, on an agent's file writes and at turn end. See https://github.com/open-coder-ai/chock