Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Claude loads one when your task matches it, or you run it by name.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
GitHub Flow に準拠した Git ワークフローを 構造強制 するプラグインです。
v0.7.6
「デフォルトブランチ (master/main) への変更は、他ブランチからの GitHub 上の PR merge 経由のみで取り込む」という運用を構造的に保証します。ローカル側の write 経路 (commit / push / PR head) を 3 つの PreToolUse フックで多層防御し、cooperative 利用前提で誤操作・横紙破りを deny に倒します。
加えて、rebase によるリモート default branch 取り込みワークフローを Skill として提供します。
claude plugin marketplace add natsuume/natsuume-cc-marketplace
claude plugin install git-guardrails@natsuume-plugins
本プラグインは Claude Code 専用で、Codex marketplace では配布していません。
Bash)ファイル: hooks/scripts/block-default-branch-commit.sh
カレントブランチが master/main のときに git commit 系コマンドを deny します。
動作:
commit 文字列が無ければ即離脱 (粗フィルタ)cmd-parser.sh の split_command で COMMAND を segment に分割し (subshell (...) / brace group {...} は中身を unwrap して再分割)、各 segment を tokenize_segment でトークン化して検出する (quote / heredoc 内のテキストを実コマンドと誤認しない)git/*/git で、続く global option (-C / -c key=val 等) を walk して commit サブコマンドに到達する segment のみを commit invocation として検出$(...) / <(...) / >(...) / バッククォート内に git commit の形状が隠れている場合は保守的に denygit symbolic-ref --short HEAD でカレントブランチを取得git commit -m a && cd /other && git commit -m b のように複数の commit を連結したコマンドは、各 commit 呼び出しを独立に target-mismatch 検査します。最初の commit が問題なくても、その後の cd で対象 repo を切り替えて 2 つ目の commit を行う経路は detect されて denyCLAUDE_ISOLATED_GIT_ROOTS の許可ルート配下の repo への git -C <ABS> commit ... / git -C <ABS> add ... && git -C <ABS> commit ...) に一致する場合は、target-mismatch の deny と master/main 上 commit の deny の両方を行わずに通します (条件は「隔離 repo への commit の免除」参照)deny 例:
master ブランチで `git commit -m "fix"` を実行
→ "デフォルトブランチ (master) 上での git commit は禁止されています。
working branch を切ってから commit してください
(例: git switch -c feat/my-change)。"
Bash)ファイル: hooks/scripts/block-default-branch-push.sh
デフォルトブランチを更新するすべての push 系コマンドを deny します。
動作:
cmd-parser.sh の split_command で COMMAND を segment に分割し (subshell (...) / brace group {...} は中身を unwrap して再分割)、各 segment を tokenize_segment でトークン化して検出する (quote / heredoc 内のテキストを実コマンドと誤認しない)git/*/git で、続く global option (-C / -c key=val 等) を walk して push サブコマンドに到達する segment のみを push invocation として検出$(...) / <(...) / >(...) / バッククォート内に git push の形状が隠れている場合は保守的に deny (例: echo $(git push origin master) / echo `cd /other; git push origin feature`)git push / git push origin でも upstream 経由で master を更新するため)+ / refs/heads/ プレフィックス剥がし後に完全一致比較し、master/main が現れたら deny
git push origin master (明示)git push origin feat:master (refspec の右側) / git push origin master:feat (refspec の左側)git push --force-with-lease origin mastergit push origin +master / git push origin refs/heads/master / git push origin HEAD:refs/heads/main (refspec normalize 後に完全一致)git push origin "master" (shell quote 剥がし後に完全一致)--all / --mirror も deny: refspec を明示せず全ローカル branch を push するモードは、master/main が local に存在すれば自動的にそれを更新するため、token 完全一致比較を素通りする bypass になる。default branch 保護のため一律 denygit push origin feature && git push origin master のように && / || / ; / & / | で連結された複数の push を含むコマンドは、各 push 呼び出しを独立に検査します。最初の push が APPROVE でも 2 つ目が master を更新するならその時点で deny(cd /other; git push origin feature) / { cd /other; git push origin feature; } のような subshell / brace group は中身を展開してから検査するため、内部の cd による target-mismatch も検出される。閉じ括弧の直後に redirection が続く形 ((git push origin master) >/tmp/out / (git push origin master) > $(mktemp) 等) も、quote 文脈 + depth 追跡で対応する閉じ括弧を正確に特定してから解析するため中身の検出は損なわれない。閉じ括弧より後の redirection suffix は破棄せず独立した segment として扱われるため、suffix 自体に $(git push ...) のような置換が隠れていても後段の置換 shape check で deny される。group 内の生改行 ((echo prep<改行>git push origin master) 等) は ; (real separator) として扱われるため、unwrap の再分割で複数コマンドに正しく分かれる通す例:
git push (引数なし、master を更新しない)git push origin feature (master トークンを含まない)git push origin feature/main (working branch 名は完全一致しないので APPROVE)echo git push origin master / grep "git push origin master" README.md (segment 先頭が git ではないテキスト参照は invocation として検出されない)git push origin master という例文を含む git commit -m "..." (quote 内改行は 1 segment のまま空白に正規化されるため、本文が独立した invocation として分裂しない)Bash)ファイル: hooks/scripts/block-default-branch-pr.sh
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub natsuume/natsuume-cc-marketplace --plugin git-guardrailsPlugins from other owners that cover similar ground