{ "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "input=$(cat); cmd=$(echo \"$input\" | python3 -c \"import sys,json; d=json.load(sys.stdin); print(d.get('command',''))\" 2>/dev/null || echo ''); case \"$cmd\" in *'git push'*' master '*|*'git push'*' main '*|*'git push'*' develop '*|*'git push'*':master'*|*'git push'*':main'*|*'git push'*':develop'*) echo '{\"decision\":\"block\",\"reason\":\"Push в master/main/develop запрещён. Используй feature/MBL- или hotfix/MBL- и Merge Request.\"}' ;; esac" } ] } ] } }