
dcg-safety
by stars-end
Global DX Skills
SKILL.md
name: dcg-safety description: | Destructive Command Guard (DCG) safety hook for all AI coding agents. Rust-based PreToolUse hook that blocks dangerous git and filesystem commands. Use when agent attempts destructive operations, safety verification is needed, or when checking protection status across VMs. Keywords: safety, git reset, rm -rf, destructive, guard, hooks, protection tags: [safety, hooks, git, protection] compatibility: Requires DCG binary installed via curl script. Works with Claude Code, Gemini CLI, Codex CLI, Antigravity. allowed-tools:
- Bash(dcg:*)
- Bash(which:*)
- Read
DCG Safety Guard
Replaces: git-safety-guard (deprecated)
DCG is a Rust-based safety hook that blocks dangerous commands before they execute.
What It Blocks
Git Operations
git reset --hard- Discards uncommitted changesgit checkout -- <files>- Discards file changesgit clean -f- Deletes untracked filesgit push --force- Rewrites remote historygit branch -D- Force deletes branchesgit stash drop/clear- Deletes stashed work
Filesystem Operations
rm -rf /orrm -rf ~- Recursive delete of important pathschmod -R 777- Insecure permissions
Database Operations (with database pack)
DROP TABLE,DROP DATABASETRUNCATE TABLEDELETE FROMwithout WHERE
What It ALLOWS
git reset --soft- Safe undorm -rf /tmp/*- Temp cleanupgit checkout <branch>- Branch switching (no--)
Quick Verification
# Check DCG installed
which dcg && dcg --version
# Test blocking (should output {"decision": "block"})
echo '{"tool": "Bash", "input": {"command": "git reset --hard"}}' | dcg
# Test allowing (should output {"decision": "allow"})
echo '{"tool": "Bash", "input": {"command": "git status"}}' | dcg
Installation (All VMs)
curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/destructive_command_guard/main/install.sh?$(date +%s)" | bash
Configuration
Claude Code (~/.claude/settings.json)
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [{"type": "command", "command": "dcg"}]
}
]
}
}
Gemini CLI (~/.gemini/settings.json)
{
"hooks": {
"PreToolUse": [
{"matcher": "Bash", "hooks": [{"type": "command", "command": "dcg"}]}
]
}
}
Enable Database Pack (~/.config/dcg/config.toml)
[packs]
enabled = ["database.postgresql"]
Verify Across VMs
# Check all VMs have DCG
for vm in homedesktop-wsl epyc6 macmini; do
ssh $vm "which dcg && dcg --version" 2>/dev/null || echo "❌ $vm missing DCG"
done
If Blocked Unexpectedly
DCG explains why in its output:
{
"decision": "block",
"reason": "git reset --hard discards uncommitted changes",
"pattern": "git.reset_hard",
"suggestion": "Use 'git reset --soft' to keep changes staged"
}
If you need to run a blocked command legitimately, ask the human to run it directly.
Last Updated: 2026-01-14 Repository: https://github.com/Dicklesworthstone/destructive_command_guard Replaces: ~/agent-skills/git-safety-guard/
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です