← All hooks

Test Coverage Gate

non-blockingstable

Fires on Stop/SubagentStop. Compares changed source files on the current branch against changed test files. If code files changed but no corresponding test files changed, emits a TEST-COVERAGE-VIOLATION sentinel — non-blocking.

ID hook/test-coverage-gateVersion 1.0.0Author convergent-systems-key
ai hooks run test-coverage-gate
EventStopLanguagepythonTriggeralwaysSide effects
  • emits TEST-COVERAGE-VIOLATION sentinel lines to stdout and stderr
  • writes violation record to ~/.ai/audit/violations/
linuxmacoswindowsRequires git. Uses git diff against origin/main (or the configured base branch). Falls back to HEAD~1 when no upstream is present. Cross-platform via 'ai hooks run'.
testingtddgovernanceclaude-code
Attribution: convergent-systems-key.