Remove the version.gradle.kts Edit-block hook#21
Merged
Conversation
`protect-version-file.sh` was a PreToolUse hook that blocked Edit/Write/MultiEdit on `version.gradle.kts` to force version changes through the `bump-version` skill. In practice it was friction without protection: - It blocked the *clean* tool (Edit) but left Bash wide open — the Bash gate (`publish-version-gate.sh`) only inspects `./gradlew` commands, so a `sed -i` on the file sailed straight through. So it never actually prevented editing; it only diverted the agent onto a Bash write that then needed a permission prompt, defeating the autonomy the `bump-version` skill exists to provide. - Every protection that matters is outcome-based and lives elsewhere: CI's `checkVersionIncrement` rejects a version that already exists in Maven, and `publish-version-gate.sh` blocks a build/publish unless the branch is bumped above base. Neither cares which tool wrote the file. - `version-policy.md` itself recommends incrementing the version when a new branch starts — exactly the edit the hook fought. Dropping the block lets agents make the trivial version edit directly; the publish gate and CI check keep the published artifacts safe, and the `bump-version` skill remains as guidance for the non-trivial parts (alias variable, breaking round-up, conflict resolution, report regen). Companion step (per consuming repo, not in this repo): remove the `Edit|Write|MultiEdit -> protect-version-file.sh` entry from `.claude/settings.json`. Leave the `Bash` publish gate intact. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the shared-repo PreToolUse hook script that previously blocked direct Edit/Write/MultiEdit operations on version.gradle.kts, aligning behavior with the repo’s outcome-based version protections (CI checks and publish-version-gate.sh) and reducing agent friction.
Changes:
- Deleted
scripts/protect-version-file.sh, which implemented the Edit/Write/MultiEdit block forversion.gradle.kts.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
version.gradle.kts Edit-block hook
armiol
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Deletes
scripts/protect-version-file.sh— thePreToolUsehook that blockedEdit/Write/MultiEditonversion.gradle.kts.This is the shared-repo half of the change. The companion change in
configstops wiring the hook into consumers'.claude/settings.json(see "Rollout" below).Why
The hook forced all version changes through the
bump-versionskill, but in practice it was friction without protection:Edit) while leaving Bash wide open —publish-version-gate.shonly inspects./gradlewcommands, so ased -ion the file sailed straight through. It never actually prevented editing; it only diverted the agent onto a Bash write that then needed a permission prompt, defeating the autonomy thebump-versionskill exists to provide.checkVersionIncrementrejects a version that already exists in Maven.publish-version-gate.shblocks a build/publish unless the branch is bumped above base.guidelines/version-policy.mditself recommends incrementing the version when a new branch starts — exactly the edit the hook fought.Dropping the block lets agents make the trivial version edit directly. The
bump-versionskill remains as guidance for the non-trivial parts (alias variable, breaking round-up, conflict resolution, report regen) and now runs without a permission prompt.Scope
The only references to the Edit-block lived inside the script itself — no skill, guideline, doc, or in-repo settings pointed at it — so removing the script is the complete change here.
Rollout
Consumers wire this hook via the
config-distributed.claude/settings.jsontemplate, whichconfig/migrateclobber-copies on every./config/pull. Land the config change first (removes the wiring everywhere; the unused script lingering is harmless), then this PR (deletes the now-unreferenced script). After both are onmaster, a single./config/pullbrings each consumer fully consistent.