Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/T-rav/hydraflow --skill hfblock-destructive-git명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | hf.block-destructive-git |
| description | hf.block-destructive-git |
#!/bin/bash
# Hook: Block destructive git commands that are hard to reverse.
# Fires on PreToolUse for all Bash commands.
# Blocks: push --force, reset --hard, checkout ., restore ., clean -f, branch -D
set -euo pipefail
INPUT=$(cat)
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
if [ -z "$COMMAND" ]; then
exit 0
fi
# Block destructive git commands
if echo "$COMMAND" | grep -qE 'git\s+(push\s+.*--force|push\s+-f\b|reset\s+--hard|checkout\s+\.|restore\s+\.|clean\s+-f|branch\s+-D)'; then
echo "BLOCKED: Destructive git command detected." >&2
echo "" >&2
echo "The following are forbidden without explicit user approval:" >&2
echo " - git push --force / -f (overwrites remote history)" >&2
echo " - git reset --hard (discards uncommitted changes)" >&2
echo " - git checkout . (discards all working tree changes)" >&2
echo " - git restore . (discards all working tree changes)" >&2
echo " - git clean -f (deletes untracked files)" >&2
echo " - git branch -D (force-deletes branch)" >&2
echo "" >&2
echo "Ask the user for explicit approval before running destructive commands." >&2
exit 2
fi