From git-governor
View and configure git-governor rules and protected branches. Use when the user invokes /git-governor to view config, or with subcommands to set rule modes (deny/ask/allow), manage protected branch patterns, or reset config.
How this skill is triggered — by the user, by Claude, or both
Slash command
/git-governor:git-governorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
View and configure the git-governor plugin.
View and configure the git-governor plugin.
/git-governor [command] [args] [--global]
| Command | Description |
|---|---|
| (none) | Show effective config (default) |
set <rule> <mode> | Set a rule's mode |
protect <pattern> | Add a protected branch pattern |
unprotect <pattern> | Remove a protected branch pattern |
reset | Delete the config file |
The --global flag targets ~/.claude/git-governor.json instead of the project config.
| Scope | Path | Precedence |
|---|---|---|
| Project | <project>/.claude/git-governor.json | Highest (wins) |
| Global | ~/.claude/git-governor.json | Middle |
| Defaults | Built into the hook | Lowest |
For rules: project overrides global overrides defaults.
For protected branches: the first config that defines protected-branches wins entirely (no merging).
| Rule | Default | Description |
|---|---|---|
no-amend | deny | Block git commit --amend |
no-commit-on-protected | deny | Block commits directly on protected branches |
no-push-to-protected | ask | Prompt before pushing to protected branches |
no-force-push | deny | Block --force, --force-with-lease, and +refspec pushes |
no-reset-hard | deny | Block git reset --hard |
no-discard-all | deny | Block git checkout ., git restore ., git clean -f |
no-rebase-on-protected | deny | Block rebase while on a protected branch |
no-add-all | deny | Block git add -A and git add . |
no-merge-pr | ask | Require approval before gh pr merge |
require-git-repo | allow | Require a git repo for Write/Edit operations |
| Mode | Effect |
|---|---|
deny | Hard block — tool call prevented |
ask | Prompt user for confirmation |
allow | Disabled — no check |
ARGUMENTS: provided after the skill name, e.g. /git-governor set no-amend ask
status)~/.claude/git-governor.json if it exists.<CWD>/.claude/git-governor.json if it exists.- if not set at that level.Example output:
| Rule | Description | Default | Global | Project | Effective |
|-------------------------|-------------------------------------|---------|--------|---------|-----------|
| no-amend | Block git commit --amend | deny | - | ask | ask |
| no-commit-on-protected | Block commits on protected branches | deny | - | - | deny |
| no-push-to-protected | Prompt before pushing to protected | ask | deny | - | deny |
| no-force-push | Block force push | deny | - | - | deny |
| no-reset-hard | Block git reset --hard | deny | - | - | deny |
| no-discard-all | Block checkout/restore/clean all | deny | - | allow | allow |
| no-rebase-on-protected | Block rebase on protected branches | deny | - | - | deny |
| no-add-all | Block git add -A / git add . | deny | - | - | deny |
| require-git-repo | Require git repo for file edits | allow | - | - | allow |
Protected branches: ["main", "master"] (default)
To change a rule: /git-governor set <rule> <mode> (modes: deny, ask, allow)
To add a branch: /git-governor protect <pattern>
To remove a branch: /git-governor unprotect <pattern>
Add --global to target ~/.claude/git-governor.json instead of the project config.
set <rule> <mode><rule> against the valid rules list. If invalid, show the valid rules and stop.<mode> against: deny, ask, allow. If invalid, show valid modes and stop.--global: <CWD>/.claude/git-governor.json--global: ~/.claude/git-governor.json{}..rules.<rule> to the mode value (as a string)..rules object exists in the JSON.mkdir -p via Bash).Set <rule> = "<mode>" in <scope> config.protect <pattern>--global).{}.protected-branches array. If absent, start with [].unprotect <pattern>--global).protected-branches array. If absent, inform the user.protected-branches key entirely.reset--global).rm.Deleted <scope> config. Defaults will be used.helpDisplay the usage summary showing all commands, valid rules, and valid modes.
jq via Bash for JSON manipulation if needed, but prefer reading and writing via the dedicated tools.npx claudepluginhub allixsenos/claude-git-governor --plugin git-governorInspects branch governance and protected-file globs, then records a scoped, time-limited approval so a protected edit or publish can proceed under audit. Useful when the user says "show branch governance" or "approve this protected change".
Provides prompt-injection defense rules for GitHub issues and pull requests, plus optional workflow conventions for issue triage and CI safety.
Configures GitHub repository via gh CLI with main branch protection rules, issue/PR templates, standard labels, .gitignore, and metadata. For new or existing professional projects.