code-ratchets
Installation
SKILL.md
Code Ratchets
A ratchet is a pre-commit check that counts deprecated patterns in your codebase against a hard-coded expected count. It fails in two cases:
- Too many instances: Prevents proliferation via copy-paste
- Too few instances: Congratulates you and prompts lowering the expected count
This automates the manual code review process of saying "don't do this, we've stopped doing this."
Core Workflow
1. Identify the Pattern
Define what to count. Patterns work best when they're:
- Simple text or regex matches (grep-able)
- Unambiguous (low false positive rate)
- Discrete instances (countable)