claude-code-mods

rulebook-guard

Writing and git rules: replaces em dashes in prose, and asks before git commit --amend, an unformatted push, or personal info in notes and commits.

Fork and adapt Version 0.1.2

Rulebook Guard asks: This is git commit --amend. Your rule: make a new commit instead. Allow it anyway? Options: Block it, Allow once, Type something
Catches a git commit --amend.

Install

claude plugin marketplace add hamzafer/claude-code-mods
claude plugin install rulebook-guard@claude-code-mods

Restart Claude Code after installing. To try it without installing, clone the repo and run claude --plugin-dir mods/rulebook-guard.

How to use

Block it / Allow once
Refuse the call, or run it as written

How it behaves

  • Rewrites em dashes in .md, .mdx, .markdown and .txt writes, commit messages, PR text and Slack posts. Code files are left alone.
  • Asks before git commit --amend.
  • Asks before a git push with files that ruff format or Prettier would change.
  • Asks before an email address or phone number goes into ~/notes, memory files, CLAUDE.md files or a commit.
  • The rules are plain code in hooks/register.ts, so change them to match yours.