rulebook-guard

Reviewed at commit 3e2ed0b

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.

Made by
Hamza Zafar
What we checked

Replaces em dashes with commas in Markdown and text files Claude writes, in git commit and gh pr commands, and in Slack messages. It asks you before git commit --amend, a push with unformatted files, or an email or phone number going into notes, CLAUDE.md or a commit. It makes no network calls and stores nothing.

Review details

Static review of the source at the pinned commit; not run. Delta review of the changes since 62fa3d9; the rest carries over from the review at that commit. The change is a regex edit: the GIT pattern that finds git commit, amend and push commands is rewritten so the option forms cannot overlap and backtrack on long option runs (version 0.1.4). The earlier hardening of the pre-push format check stays: git runs with core.fsmonitor=false, the check runs in the session folder (a leading cd that leaves the session folder is ignored, paths resolved to real paths), ruff and Prettier get -- before file names, and the repository's own node_modules/.bin/prettier is only run when it lies inside node_modules and git tracks nothing under node_modules, otherwise a toast says it was not checked. Prettier still reads the repository's config, as npm test would. Carried over: tool.call handlers for Write, Edit, Bash and any tool (to match Slack post tools such as mcp__claude_ai_Slack__slack_send_message). It rewrites the content, new_string, command or message argument via next() when it contains an em dash, with a toast. It asks via $.ui.ask for amend, personal info (regex for emails and phone numbers) and unformatted pushes; anything other than Allow once, or no answer, denies the call. Before a push it runs git rev-parse, git diff --name-only, ruff format --check on changed .py files and Prettier --check on changed web files. Reads HOME to recognise ~/notes and Claude memory paths and to resolve ~ in a cd. No writes or network calls. Side effect of the new regex: a glued short option such as git -ck=v commit --amend is no longer recognised as a git prefix, so that unusual spelling would skip the amend question; this is a guardrail, not a security boundary.

What it uses
  • Reads your prompts: no
  • Sees tool calls: yes
  • Blocks or changes tool calls: yes
  • Reads or writes files: no
  • Runs programs on your machine: yes
  • Calls the model (uses tokens): no
  • Sends data over the network: no
  • Stores data: no
  • Shows something on screen: yes
Hooked events
Screenshot of rulebook-guard
Made this mod? Add a badge to your README

modsforClaude badge for rulebook-guard

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/rulebook-guard.svg)](https://modsforclaude.com/mods/rulebook-guard/)

← All mods