feat(git): refuse git push to main with a PreToolUse hook

An agent on main can push straight to it when the server does not protect the branch. The git
plugin now ships a Claude Code hook that refuses such a push before it runs. It fails open, does
nothing on other runtimes, and has an opt-out read only from the hook's own environment.

Closes: #178

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
Defame1297andClaude Opus 5.5 committed 2026-12-04 21:18:09 +00:00
1 parent 55da336298
commit 77642183c2
8 files changed
+451 -6

No files matched your search

+5 -2
View File
@@ -1,5 +1,5 @@
name: holocron
version: 0.9.2
version: 0.9.3
description: AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.
license: MIT
@@ -86,6 +86,9 @@ executables:
# full-identity, version-in-key convention as above, kept by the same check.
git.rkdr.net/Mortis/Holocron/plugins/delivery#0.8.1:
hooks: true
# git ships the hook that refuses a push to main.
git.rkdr.net/Mortis/Holocron/plugins/git#1.4.0:
hooks: true
marketplace:
# apm's Claude marketplace mapper only emits description:/version: into the
@@ -93,7 +96,7 @@ marketplace:
# top-level apm.yml description:/version: above are NOT inherited into the
# compiled output despite being used elsewhere (e.g. by `apm audit`).
description: AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.
version: 0.9.2
version: 0.9.3
owner:
name: Mortis
url: https://git.rkdr.net/Mortis/