Back to Hooks

Prevent Direct Push

Prevent direct pushes to protected branches (main, develop). Blocks git push commands targeting main or develop branches to enforce Git Flow workflow. Requires using feature/release/hotfix branches and pull requests instead of direct commits to protected branches.

Install Command
npx claude-code-templates@latest --hook git/prevent-direct-push
View on GitHub
claude-code — prevent-direct-push

Scanned by NVIDIA SkillSpector

Automated static analysis (no LLM) · v2.12.0 · 2026-10-17

3 observations
scanner score 42/100

SkillSpector looks for patterns such as shell commands, credential access, network calls or unpinned dependencies. An observation is something worth reading in the files before you install, not a confirmed vulnerability. Components that run code locally, like hooks, MCP servers and security tooling, naturally show more of them.

  • Tool Parameter Abuse
    Tool Misuse · prevent-direct-push.py:16
  • Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: shell.
    MCP Least Privilege · SKILL.md:1
  • subprocess module call
    Dangerous Code Execution · prevent-direct-push.py:22

Learn more about NVIDIA SkillSpector.

Content

JSON
{
"description": "Prevent direct pushes to protected branches (main, develop). Blocks git push com..."
"hooks": {
"PreToolUse": [1 item]
}
}

Stack Builder

0 components

Your stack is empty

Browse components and click the + button to add them to your stack for easy installation.