Skip to content

chore: share Claude build-protection config and trim rule bloat#1086

Merged
tbouffard merged 1 commit into
mainfrom
chore/improve_claude_config
Jun 22, 2026
Merged

chore: share Claude build-protection config and trim rule bloat#1086
tbouffard merged 1 commit into
mainfrom
chore/improve_claude_config

Conversation

@redfish4ktc

@redfish4ktc redfish4ktc commented Jun 10, 2026

Copy link
Copy Markdown

Summary

Tidies the repository's Claude Code configuration so the existing build-protection hook actually reaches contributors, and removes two small bits of rule bloat.

Changes

Share the build-protection hook (.claude/settings.json, new)

The block-build.sh PreToolUse hook script was already tracked in the repo, but its registration lived only in the gitignored settings.local.json. As a result, anyone cloning the repo got the script without it ever firing.

This adds a committed .claude/settings.json that:

  • registers the block-build.sh PreToolUse hook via $CLAUDE_PROJECT_DIR (portable across machines), and
  • ships a minimal read-only permission allowlist (git status/diff/log/show/branch) to reduce first-run approval prompts.

Entries are intentionally portable: no IDE/MCP-specific or absolute-path rules, which belong in each contributor's own settings.local.json.

Trim rule bloat

  • coding-practices.md: drop the duplicated .prettierrc values (tab width, quotes, print width). Prettier formats automatically, so restating its config prevents no mistake and risks drifting from the source of truth. Replaced with a pointer to .prettierrc.
  • commit-conventions.md: remove the paths: ["**"] frontmatter. Matching every file is just a roundabout always-on rule; dropping it makes the always-on intent explicit and avoids the overly-broad path anti-pattern.

Notes

No production code or build behavior is affected; all changes are under .claude/.

Summary by CodeRabbit

  • Documentation

    • Updated architecture coding practices documentation regarding formatting standards.
    • Updated git commit conventions documentation.
  • Chores

    • Added development environment configuration file.

Make the build-protection hook actually reach contributors and tidy two rule files.

- Add a committed .claude/settings.json that registers the block-build.sh PreToolUse hook. The hook script was
  already tracked, but its registration lived only in the gitignored settings.local.json, so contributors who cloned
  the repo got the script without it ever firing. The file also ships a minimal read-only allowlist
  (git status/diff/log/show/branch) to cut first-run approval prompts. Entries are kept portable: no IDE/MCP-specific
  or absolute-path rules, which belong in each user's settings.local.json instead.
- coding-practices: drop the duplicated .prettierrc values (tab width, quotes, print width). Prettier formats
  automatically, so restating its config prevents no mistake and risks drifting from the source of truth.
- commit-conventions: remove the paths: ["**"] frontmatter. Matching every file is just a roundabout always-on rule;
  dropping it makes the always-on intent explicit and avoids the overly-broad path anti-pattern.
@redfish4ktc redfish4ktc added the chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...) label Jun 10, 2026
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 85532bd4-cba6-4ff6-99df-2959d352a9fe

📥 Commits

Reviewing files that changed from the base of the PR and between 7f2e169 and 41615bb.

📒 Files selected for processing (3)
  • .claude/rules/architecture/coding-practices.md
  • .claude/rules/git/commit-conventions.md
  • .claude/settings.json
💤 Files with no reviewable changes (1)
  • .claude/rules/git/commit-conventions.md

Walkthrough

This PR updates the Claude project configuration by simplifying formatting rules documentation, cleaning up commit convention metadata, and introducing a new .claude/settings.json file that configures Bash tool permissions and registers a PreToolUse hook to enforce build restrictions.

Changes

Claude Configuration and Rules Updates

Layer / File(s) Summary
Rules documentation updates
.claude/rules/architecture/coding-practices.md, .claude/rules/git/commit-conventions.md
Formatting rules now point to .prettierrc for Prettier configuration details instead of listing explicit settings, and commit convention document frontmatter is removed to start directly with the heading.
Tool permissions and PreToolUse hook configuration
.claude/settings.json
New settings file grants Bash tool access for git commands (status, diff, log, show, branch) and registers a PreToolUse hook to invoke block-build.sh for Bash tool usage matching.

Possibly related PRs

  • maxGraph/maxGraph#1029: The new .claude/settings.json configures the PreToolUse hook that runs block-build.sh, the build-blocking script introduced in that PR.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main changes: adding a shared Claude build-protection config and removing unnecessary rule bloat from documentation files.
Description check ✅ Passed The description provides detailed context, explains the rationale for changes, covers all three file modifications, and notes the scope is limited to .claude/ configuration only.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tbouffard tbouffard merged commit 6cc8e7a into main Jun 22, 2026
6 checks passed
@tbouffard tbouffard deleted the chore/improve_claude_config branch June 22, 2026 08:46
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants