Branch Guard
Overview
Use this skill before any commit or push workflow. It checks whether the current branch is protected and can reject risky direct commits or pushes.
Workflow
- Run
scripts/check_branch.sh --command "<planned git command>". - If the current branch is protected, stop and create a feature branch first.
- If the branch is safe, continue with the requested git workflow.
- When branch policy is project-specific, read
.branch-guard.jsonfrom the git root.
Protected Branch Config
See references/config.md for the config file shape.
Resources
- Script:
scripts/check_branch.sh - Reference:
references/config.md