| name | ratchet |
| description | After a refactor that reduced complexity or violations, tighten the ratchet baselines (.xenon.yml, .cognitive_baseline.txt, .coverage_baseline.txt, .file_length_baseline.txt) to lock in the gain |
| argument-hint | [which gate: xenon|cognitive|coverage|file-length|all] |
| allowed-tools | ["read","grep","glob","edit","exec"] |
| triggers | ["user","model"] |
Tighten the ratchet baselines after a refactor that reduced complexity, increased coverage, or removed dead code. This enforces AGENTS.md §4: "Ratchet protocol: extract one block per commit; never lower threshold below proven CC." The ratchet only tightens — never loosen a threshold below its proven value.
The 4 ratchet baselines
| Gate | Baseline file | Regenerate command |
|---|
| Cyclomatic Complexity (xenon) | .xenon.yml | manual edit (max-absolute, max-average, max-modules) |
| Cognitive Complexity | .cognitive_baseline.txt | .\.venv\Scripts\python.exe bin\cognitive_complexity_gate.py --regenerate |
|