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.
npx claude-code-templates@latest --skill ••••••••••••••••••••Interactive Terminal Locked
Unlock this skill to run and inspect the interactive installation sequence.
{
"description": "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.",
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "python3 \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/prevent-direct-push.py"
}
]
}
]
}
}
How to Use & Getting Started
# Step 1: Initialize skill agent setup
npx skills add Prevent Direct Push --install-production
python -m pip install -r requirements.txt
codex plugin install Prevent Direct Push@latest
export API_KEY=secret_token_key_here
Installation Runbook & Walkthrough Locked
Unlock this skill to reveal complete step-by-step setup guides, terminal commands, configuration recipes, repository links, and interactive installation video walkthroughs.
Unlock full access to Prevent Direct Push
Get instant access to complete setup guides, repository source code, and integration assets.
More in hook
View all hook skills →Simple Notifications
Send desktop notifications when Claude Code finishes working or needs user input. Works on macOS and Linux systems.
Smart Commit
Intelligent git commit creation with automatic message generation and validation. Creates meaningful commits based on file changes.
Update Search Year
Automatically adds current year to WebSearch queries when no year is specified. This hook intercepts WebSearch tool usage and appends the current year to queries that don't already contain a year, ensuring search results are current and relevant.