What problem does it solve? Project rules written in prose get broken repeatedly because nothing mechanically enforces them; this Skill turns one violated rule into a blocking PreToolUse hook with a test and a written rule statement. ## Core Features & Use Cases - Hook Generation from Template: Copies a working guard-invariant example hook and rewrites its scope, violation matcher, and block reason for the project's rule. - Test-Driven Enforcement: Writes the failing hook test first, covering block, allow, out-of-scope, and prose-mention false-positive cases. - Wiring and Documentation: Registers the hook in .claude/settings.json under PreToolUse and records the rule in .claude/rules/ next to the hook name. - Use Case: After a post-mortem finds service code used console.log instead of the shared logger, use this Skill to add a guard hook that blocks the violation in real editing sessions. ## Quick Start Ask the agent to turn the rule "service code never calls console.log" into an enforced invariant using the new-invariant skill.